List of usage examples for javax.swing BoxLayout LINE_AXIS
int LINE_AXIS
To view the source code for javax.swing BoxLayout LINE_AXIS.
Click Source Link
From source file:org.processmining.analysis.decisionmining.DecisionAttribute.java
/** * Builds a panel containing a checkbox to include or exclude this * attribute, and a combobox in order to chose an attribute type. */// w w w .j av a 2s .com private void buildAttributePanel() { myPanel = new JPanel(); myPanel.setLayout(new BoxLayout(myPanel, BoxLayout.LINE_AXIS)); JLabel myNameLabel = new JLabel("Attribute name: "); myNameLabel.setForeground(new Color(100, 100, 100)); myPanel.add(myNameLabel); myNameCheckBox = new JCheckBox(getName()); // per default select everything myNameCheckBox.setSelected(true); // register check/uncheck action myNameCheckBox.addActionListener(new ActionListener() { // specify action when the attribute selection scope is changed public void actionPerformed(ActionEvent e) { JCheckBox cb = (JCheckBox) e.getSource(); HLAttribute simAtt = getSimulationAttribute(); if (cb.isSelected() == true) { myTypeGuiRepresenation.enable(); // add attribute to simulation model // and to related activities createSimulationAttribute(); } else { myTypeGuiRepresenation.disable(); // remove attribute from simulation model // (automatically removes attribute from contained // activities) hlProcess.removeAttribute(simAtt.getID()); } } }); myPanel.add(myNameCheckBox); myPanel.add(Box.createHorizontalGlue()); createAttributeTypeGui(); // ArrayList<DecisionAttributeType> attributeTypes = new // ArrayList<DecisionAttributeType>(); // // per default set "nominal" // attributeTypes.add(DecisionAttributeType.NOMINAL); // attributeTypes.add(DecisionAttributeType.NUMERIC); // myTypeGuiRepresenation = new // GUIPropertyListWithoutGlue("Attribute type:", // "Please determine the type of the attribute", attributeTypes, this); myPanel.add(myTypeGuiRepresenation.getPropertyPanel()); }
From source file:org.processmining.analysis.decisionmining.DecisionAttributeForAuLdg.java
/** * Builds a panel containing a checkbox to include or exclude this attribute, * and a combobox in order to chose an attribute type. *///w w w . j a v a 2 s . c o m private void buildAttributePanel() { myPanel = new JPanel(); myPanel.setLayout(new BoxLayout(myPanel, BoxLayout.LINE_AXIS)); JLabel myNameLabel = new JLabel("Attribute name: "); myNameLabel.setForeground(new Color(100, 100, 100)); myPanel.add(myNameLabel); myNameCheckBox = new JCheckBox(getName()); // per default select everything myNameCheckBox.setSelected(true); // register check/uncheck action myNameCheckBox.addActionListener(new ActionListener() { // specify action when the attribute selection scope is changed public void actionPerformed(ActionEvent e) { JCheckBox cb = (JCheckBox) e.getSource(); HLAttribute simAtt = getSimulationAttribute(); if (cb.isSelected() == true) { myTypeGuiRepresenation.enable(); // add attribute to simulation model // and to related activities createSimulationAttribute(); } else { myTypeGuiRepresenation.disable(); // remove attribute from simulation model // (automatically removes attribute from contained activities) hlProcess.removeAttribute(simAtt.getID()); } } }); myPanel.add(myNameCheckBox); myPanel.add(Box.createHorizontalGlue()); createAttributeTypeGui(); // ArrayList<DecisionAttributeType> attributeTypes = new // ArrayList<DecisionAttributeType>(); // // per default set "nominal" // attributeTypes.add(DecisionAttributeType.NOMINAL); // attributeTypes.add(DecisionAttributeType.NUMERIC); // myTypeGuiRepresenation = new // GUIPropertyListWithoutGlue("Attribute type:", // "Please determine the type of the attribute", attributeTypes, this); myPanel.add(myTypeGuiRepresenation.getPropertyPanel()); }
From source file:org.processmining.analysis.performance.fsmevaluator.FSMEvaluationMenuUI.java
protected void showConfigurationPanel() { if (configurationPanel == null) { // setup configuration panel updateFrameworkResources();//from ww w . j a v a 2 s . com configurationPanel = new JPanel(); configurationPanel.setLayout(new BorderLayout()); configurationPanel.setBackground(COLOR_OUTER_BG); // setup logs panel ArrayList<String> values = new ArrayList<String>(); Iterator<String> itr = logReaders.keySet().iterator(); while (itr.hasNext()) { values.add(itr.next()); } logsEnumeration = new GUIPropertyListEnumeration("Event Log :", null, values, null, 180); // initializing Logs RoundedPanel content = new RoundedPanel(10, 5, 5); content.setBackground(COLOR_BG); content.setLayout(new BoxLayout(this, BoxLayout.Y_AXIS)); content.setLayout(new BoxLayout(content, BoxLayout.LINE_AXIS)); content.add(logsEnumeration.getPropertyPanel()); // initializing Time Sort initTimeSort(); RoundedPanel content2 = new RoundedPanel(10, 5, 5); content2.setBackground(COLOR_BG); content2.setLayout(new BoxLayout(this, BoxLayout.Y_AXIS)); content2.setLayout(new BoxLayout(content2, BoxLayout.LINE_AXIS)); content2.add(timeUnitSort.getPropertyPanel()); // initializing Measure ArrayList<String> values2 = new ArrayList<String>(); values2.add(MEAN); values2.add(MEDIAN); values2.add(MIN); values2.add(HEUST1); values2.add(HEUST2); estimatorSort = new GUIPropertyListEnumeration("Estimator:", null, values2, null, 180); RoundedPanel content3 = new RoundedPanel(10, 5, 5); content3.setBackground(COLOR_BG); content3.setLayout(new BoxLayout(this, BoxLayout.Y_AXIS)); content3.setLayout(new BoxLayout(content3, BoxLayout.LINE_AXIS)); content3.add(estimatorSort.getPropertyPanel()); // setup reference model / log configuration panel JPanel startPanel = new JPanel(); startPanel.setOpaque(false); startPanel.setBorder(BorderFactory.createEmptyBorder(5, 5, 5, 5)); startPanel.setLayout(new BoxLayout(startPanel, BoxLayout.X_AXIS)); startButton = new AutoFocusButton("start calculation"); if (RuntimeUtils.isRunningMacOsX() == true) { startButton.setOpaque(true); } startButton.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent arg0) { startCalculation(); } }); startButton.setEnabled(true); startPanel.add(Box.createHorizontalGlue()); startPanel.add(startButton); rightPanel = new JPanel(); rightPanel.setOpaque(false); rightPanel.setBorder(BorderFactory.createEmptyBorder()); rightPanel.setLayout(new BorderLayout()); // blank panel JPanel blankPanel = new JPanel(); blankPanel.setOpaque(false); blankPanel.setBorder(BorderFactory.createEmptyBorder()); blankPanel.setLayout(new BorderLayout()); JPanel leftPanel = new JPanel(); leftPanel.setOpaque(false); leftPanel.setBorder(BorderFactory.createEmptyBorder()); leftPanel.setLayout(new BorderLayout()); leftPanel.add(content, BorderLayout.CENTER); leftPanel.add(content2, BorderLayout.SOUTH); leftPanel.add(content3, BorderLayout.NORTH); // add benchmark item list to west rightPanel.add(blankPanel, BorderLayout.CENTER); rightPanel.add(startPanel, BorderLayout.SOUTH); configurationPanel.add(leftPanel, BorderLayout.WEST); configurationPanel.add(rightPanel, BorderLayout.CENTER); } // switch to configuration view setView(configurationPanel); }
From source file:org.prom5.analysis.decisionmining.DecisionAttribute.java
/** * Builds a panel containing a checkbox to include or exclude * this attribute, and a combobox in order to chose an attribute type. *///from ww w . j av a 2 s . c o m private void buildAttributePanel() { myPanel = new JPanel(); myPanel.setLayout(new BoxLayout(myPanel, BoxLayout.LINE_AXIS)); JLabel myNameLabel = new JLabel("Attribute name: "); myNameLabel.setForeground(new Color(100, 100, 100)); myPanel.add(myNameLabel); myNameCheckBox = new JCheckBox(getName()); // per default select everything myNameCheckBox.setSelected(true); // register check/uncheck action myNameCheckBox.addActionListener(new ActionListener() { // specify action when the attribute selection scope is changed public void actionPerformed(ActionEvent e) { JCheckBox cb = (JCheckBox) e.getSource(); HLAttribute simAtt = getSimulationAttribute(); if (cb.isSelected() == true) { myTypeGuiRepresenation.enable(); // add attribute to simulation model // and to related activities createSimulationAttribute(); } else { myTypeGuiRepresenation.disable(); // remove attribute from simulation model // (automatically removes attribute from contained activities) hlProcess.removeAttribute(simAtt.getID()); } } }); myPanel.add(myNameCheckBox); myPanel.add(Box.createHorizontalGlue()); createAttributeTypeGui(); // ArrayList<DecisionAttributeType> attributeTypes = new ArrayList<DecisionAttributeType>(); // // per default set "nominal" // attributeTypes.add(DecisionAttributeType.NOMINAL); // attributeTypes.add(DecisionAttributeType.NUMERIC); // myTypeGuiRepresenation = new GUIPropertyListWithoutGlue("Attribute type:", // "Please determine the type of the attribute", attributeTypes, this); myPanel.add(myTypeGuiRepresenation.getPropertyPanel()); }
From source file:org.rdv.ui.ControlPanel.java
/** * Setup the UI.//from w w w . j a v a 2 s . c om */ private void initPanel() { setLayout(new BorderLayout()); GridBagConstraints c = new GridBagConstraints(); JPanel container = new JPanel(); container.setLayout(new GridBagLayout()); Box firstRowPanel = new Box(BoxLayout.LINE_AXIS); beginButton = new JButton(); beginButton.setName("beginButton"); beginButton.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { setLocationBegin(); } }); firstRowPanel.add(beginButton); rtButton = new JButton(); rtButton.setName("rtButton"); rtButton.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { if (rtButton.isSelected()) { rbnbController.pause(); } else { rbnbController.monitor(); } } }); firstRowPanel.add(rtButton); playButton = new JButton(); playButton.setName("playButton"); playButton.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { if (playButton.isSelected()) { rbnbController.pause(); } else { rbnbController.play(); } } }); firstRowPanel.add(playButton); endButton = new JButton(); endButton.setName("endButton"); endButton.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { setLocationEnd(); } }); firstRowPanel.add(endButton); firstRowPanel.add(Box.createHorizontalStrut(8)); SpinnerListModel playbackRateModel = new SpinnerListModel(playbackRates); playbackRateSpinner = new JSpinner(playbackRateModel); playbackRateSpinner.setName("playbackRateSpinner"); JSpinner.ListEditor playbackRateEditor = new JSpinner.ListEditor(playbackRateSpinner); playbackRateEditor.getTextField().setEditable(false); playbackRateSpinner.setEditor(playbackRateEditor); playbackRateSpinner.setPreferredSize(new Dimension(80, playbackRateSpinner.getPreferredSize().height)); playbackRateSpinner.setMinimumSize(playbackRateSpinner.getPreferredSize()); playbackRateSpinner.setMaximumSize(playbackRateSpinner.getPreferredSize()); playbackRateSpinner.addChangeListener(new ChangeListener() { public void stateChanged(ChangeEvent e) { playbackRateChanged(); } }); firstRowPanel.add(playbackRateSpinner); firstRowPanel.add(Box.createHorizontalStrut(8)); timeScaleComboBox = new JComboBox(); timeScaleComboBox.setName("timeScaleComboBox"); timeScaleComboBox.setEditable(true); timeScaleComboBox.setPreferredSize(new Dimension(96, timeScaleComboBox.getPreferredSize().height)); timeScaleComboBox.setMinimumSize(timeScaleComboBox.getPreferredSize()); timeScaleComboBox.setMaximumSize(timeScaleComboBox.getPreferredSize()); for (int i = 0; i < timeScales.length; i++) { timeScaleComboBox.addItem(DataViewer.formatSeconds(timeScales[i])); } timeScaleComboBox.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { timeScaleChange(); } }); firstRowPanel.add(timeScaleComboBox); firstRowPanel.add(Box.createHorizontalGlue()); locationButton = new JButton(); locationButton.setName("locationButton"); locationButton.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent ae) { TimeRange timeRange = RBNBHelper.getChannelsTimeRange(); double time = DateTimeDialog.showDialog(ControlPanel.this, rbnbController.getLocation(), timeRange.start, timeRange.end); if (time >= 0) { rbnbController.setLocation(time); } } }); firstRowPanel.add(locationButton); c.fill = GridBagConstraints.HORIZONTAL; c.weightx = 1; c.weighty = 0; c.gridx = 0; c.gridy = 0; c.gridwidth = GridBagConstraints.REMAINDER; c.gridheight = 1; c.ipadx = 0; c.ipady = 0; c.insets = new java.awt.Insets(8, 8, 8, 8); c.anchor = GridBagConstraints.NORTHWEST; container.add(firstRowPanel, c); zoomTimeSlider = new TimeSlider(); zoomTimeSlider.setRangeChangeable(false); zoomTimeSlider.addTimeAdjustmentListener(this); c.fill = GridBagConstraints.HORIZONTAL; c.weightx = 1; c.weighty = 0; c.gridx = 0; c.gridy = 1; c.gridwidth = GridBagConstraints.REMAINDER; c.gridheight = 1; c.ipadx = 0; c.ipady = 0; c.insets = new java.awt.Insets(0, 8, 0, 8); c.anchor = GridBagConstraints.NORTHWEST; container.add(zoomTimeSlider, c); JPanel zoomTimePanel = new JPanel(); zoomTimePanel.setLayout(new BorderLayout()); zoomMinimumLabel = new JLabel(); zoomMinimumLabel.setName("zoomMinimumLabel"); zoomTimePanel.add(zoomMinimumLabel, BorderLayout.WEST); zoomRangeLabel = new JLabel(); zoomRangeLabel.setName("zoomRangeLabel"); zoomRangeLabel.setHorizontalAlignment(JLabel.CENTER); zoomTimePanel.add(zoomRangeLabel, BorderLayout.CENTER); zoomMaximumLabel = new JLabel(); zoomMaximumLabel.setName("zoomMaximumLabel"); zoomTimePanel.add(zoomMaximumLabel, BorderLayout.EAST); c.fill = GridBagConstraints.HORIZONTAL; c.weightx = 1; c.weighty = 0; c.gridx = 0; c.gridy = 2; c.gridwidth = GridBagConstraints.REMAINDER; c.gridheight = 1; c.ipadx = 0; c.ipady = 0; c.insets = new java.awt.Insets(8, 8, 0, 8); c.anchor = GridBagConstraints.NORTHWEST; container.add(zoomTimePanel, c); globalTimeSlider = new TimeSlider(); globalTimeSlider.setValueChangeable(false); globalTimeSlider.addTimeAdjustmentListener(this); c.fill = GridBagConstraints.HORIZONTAL; c.weightx = 1; c.weighty = 1; c.gridx = 0; c.gridy = 3; c.gridwidth = GridBagConstraints.REMAINDER; c.gridheight = 1; c.ipadx = 0; c.ipady = 0; c.insets = new java.awt.Insets(8, 8, 8, 8); c.anchor = GridBagConstraints.NORTHWEST; container.add(globalTimeSlider, c); add(container, BorderLayout.CENTER); log.info("Initialized control panel."); }
From source file:org.yccheok.jstock.gui.OptionsAlertJPanel.java
/** This method is called from within the constructor to * initialize the form./*from ww w.j a v a 2 s.c o m*/ * WARNING: Do NOT modify this code. The content of this method is * always regenerated by the Form Editor. */ // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents private void initComponents() { jXHeader1 = new org.jdesktop.swingx.JXHeader(); jPanel1 = new javax.swing.JPanel(); jPanel3 = new javax.swing.JPanel(); jCheckBox2 = new javax.swing.JCheckBox(); jButton1 = new javax.swing.JButton(); jLabel7 = new javax.swing.JLabel(); jLabel11 = new javax.swing.JLabel(); jTextField1 = new javax.swing.JTextField(); jLabel12 = new javax.swing.JLabel(); jPanel2 = new javax.swing.JPanel(); filler1 = new javax.swing.Box.Filler(new java.awt.Dimension(0, 0), new java.awt.Dimension(0, 0), new java.awt.Dimension(32767, 32767)); jLabel1 = new javax.swing.JLabel(); filler3 = new javax.swing.Box.Filler(new java.awt.Dimension(24, 0), new java.awt.Dimension(24, 0), new java.awt.Dimension(24, 32767)); jButton2 = new javax.swing.JButton(); filler2 = new javax.swing.Box.Filler(new java.awt.Dimension(0, 0), new java.awt.Dimension(0, 0), new java.awt.Dimension(32767, 32767)); jPanel5 = new javax.swing.JPanel(); jCheckBox1 = new javax.swing.JCheckBox(); jCheckBox4 = new javax.swing.JCheckBox(); jButton3 = new javax.swing.JButton(); setLayout(new java.awt.BorderLayout()); java.util.ResourceBundle bundle = java.util.ResourceBundle.getBundle("org/yccheok/jstock/data/gui"); // NOI18N jXHeader1.setDescription(bundle.getString("OptionsAlertJPanel_description")); // NOI18N jXHeader1.setIcon(new javax.swing.ImageIcon(getClass().getResource("/images/32x32/bell.png"))); // NOI18N jXHeader1.setTitle(bundle.getString("OptionsAlertJPanel_Alert")); // NOI18N add(jXHeader1, java.awt.BorderLayout.NORTH); jPanel3.setBorder( javax.swing.BorderFactory.createTitledBorder(bundle.getString("OptionsAlertJPanel_Email"))); // NOI18N jCheckBox2.setText(bundle.getString("OptionsAlertJPanel_SendMessageToEmails")); // NOI18N jCheckBox2.setBorder(javax.swing.BorderFactory.createEmptyBorder(0, 0, 0, 0)); jCheckBox2.setMargin(new java.awt.Insets(0, 0, 0, 0)); jCheckBox2.addItemListener(new java.awt.event.ItemListener() { public void itemStateChanged(java.awt.event.ItemEvent evt) { jCheckBox2ItemStateChanged(evt); } }); jButton1.setIcon(new javax.swing.ImageIcon(getClass().getResource("/images/16x16/mail_send.png"))); // NOI18N jButton1.setText(bundle.getString("OptionsAlertJPanel_TestEmail")); // NOI18N jButton1.setEnabled(false); jButton1.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jButton1ActionPerformed(evt); } }); jLabel7.setIcon(new javax.swing.ImageIcon(getClass().getResource("/images/16x16/spinner.gif"))); // NOI18N jLabel11.setText(bundle.getString("OptionsAlertJPanel_CCCopy")); // NOI18N jLabel11.setEnabled(false); jTextField1.setEnabled(false); jTextField1.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jTextField1ActionPerformed(evt); } }); jLabel12.setFont(jLabel12.getFont().deriveFont(jLabel12.getFont().getSize() - 1f)); jLabel12.setText(bundle.getString("OptionsAlertJPanel_EmailExample")); // NOI18N jLabel12.setEnabled(false); jPanel2.setBorder( javax.swing.BorderFactory.createTitledBorder(bundle.getString("OptionsAlertJPanel_GmalAccount"))); // NOI18N jPanel2.setLayout(new javax.swing.BoxLayout(jPanel2, javax.swing.BoxLayout.LINE_AXIS)); jPanel2.add(filler1); jLabel1.setBackground(new java.awt.Color(140, 196, 116)); jLabel1.setFont(jLabel1.getFont().deriveFont(jLabel1.getFont().getStyle() | java.awt.Font.BOLD, jLabel1.getFont().getSize() + 1)); jLabel1.setForeground(new java.awt.Color(255, 255, 255)); jLabel1.setText("username@email.com"); jLabel1.setBorder(javax.swing.BorderFactory.createEmptyBorder(5, 5, 5, 5)); jLabel1.setOpaque(true); jPanel2.add(jLabel1); jPanel2.add(filler3); jButton2.setText(bundle.getString("OptionsAlertJPanel_SignOut")); // NOI18N jButton2.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jButton2ActionPerformed(evt); } }); jPanel2.add(jButton2); jPanel2.add(filler2); javax.swing.GroupLayout jPanel3Layout = new javax.swing.GroupLayout(jPanel3); jPanel3.setLayout(jPanel3Layout); jPanel3Layout.setHorizontalGroup(jPanel3Layout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel3Layout.createSequentialGroup().addContainerGap().addGroup(jPanel3Layout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel3Layout.createSequentialGroup().addGroup(jPanel3Layout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(jCheckBox2) .addGroup(jPanel3Layout.createSequentialGroup().addComponent(jButton1) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) .addComponent(jLabel7)) .addGroup(jPanel3Layout.createSequentialGroup().addComponent(jLabel11) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) .addComponent(jTextField1, javax.swing.GroupLayout.PREFERRED_SIZE, 183, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) .addComponent(jLabel12))) .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) .addComponent(jPanel2, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)))); jPanel3Layout.setVerticalGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel3Layout.createSequentialGroup().addContainerGap().addComponent(jCheckBox2) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) .addComponent(jPanel2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(jLabel11) .addComponent(jTextField1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(jLabel12)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING) .addComponent(jButton1).addComponent(jLabel7)) .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))); jPanel5.setBorder( javax.swing.BorderFactory.createTitledBorder(bundle.getString("OptionsAlertJPanel_System"))); // NOI18N jCheckBox1.setText(bundle.getString("OptionsAlertJPanel_ShowAMessage")); // NOI18N jCheckBox1.setBorder(javax.swing.BorderFactory.createEmptyBorder(0, 0, 0, 0)); jCheckBox1.setMargin(new java.awt.Insets(0, 0, 0, 0)); jCheckBox4.setText(bundle.getString("OptionsAlertJPanel_PlayingAlertSound")); // NOI18N jCheckBox4.setBorder(javax.swing.BorderFactory.createEmptyBorder(0, 0, 0, 0)); jCheckBox4.setMargin(new java.awt.Insets(0, 0, 0, 0)); jCheckBox4.addItemListener(new java.awt.event.ItemListener() { public void itemStateChanged(java.awt.event.ItemEvent evt) { jCheckBox4ItemStateChanged(evt); } }); jButton3.setIcon(new javax.swing.ImageIcon(getClass().getResource("/images/16x16/sound.png"))); // NOI18N jButton3.setText(bundle.getString("OptionsAlertJPanel_TestSound")); // NOI18N jButton3.setEnabled(false); jButton3.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jButton3ActionPerformed(evt); } }); javax.swing.GroupLayout jPanel5Layout = new javax.swing.GroupLayout(jPanel5); jPanel5.setLayout(jPanel5Layout); jPanel5Layout .setHorizontalGroup(jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel5Layout.createSequentialGroup().addContainerGap() .addGroup(jPanel5Layout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false) .addGroup(jPanel5Layout.createSequentialGroup().addComponent(jCheckBox4) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(jButton3)) .addComponent(jCheckBox1)) .addGap(134, 134, 134))); jPanel5Layout .setVerticalGroup(jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel5Layout.createSequentialGroup() .addContainerGap().addComponent(jCheckBox1).addGap(16, 16, 16) .addGroup(jPanel5Layout .createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(jCheckBox4).addComponent(jButton3)) .addContainerGap())); javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1); jPanel1.setLayout(jPanel1Layout); jPanel1Layout.setHorizontalGroup(jPanel1Layout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel1Layout.createSequentialGroup().addContainerGap() .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(jPanel5, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(jPanel3, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) .addContainerGap())); jPanel1Layout.setVerticalGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel1Layout.createSequentialGroup().addContainerGap() .addComponent(jPanel5, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) .addComponent(jPanel3, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))); add(jPanel1, java.awt.BorderLayout.CENTER); }
From source file:uk.chromis.pos.config.JPanelConfiguration.java
/** * This method is called from within the constructor to initialize the form. * WARNING: Do NOT modify this code. The content of this method is always * regenerated by the Form Editor.//from w w w . java 2 s .com */ // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents private void initComponents() { jTabbedPane1 = new javax.swing.JTabbedPane(); jPanelDatabase = new javax.swing.JPanel(); jPanelGeneral = new javax.swing.JPanel(); jPanelLocale = new javax.swing.JPanel(); jPanelPayment = new javax.swing.JPanel(); jPanelPeripheral = new javax.swing.JPanel(); jPanelSystem = new javax.swing.JPanel(); jPanelTicketSetup = new javax.swing.JPanel(); jPanel1 = new javax.swing.JPanel(); jbtnRestore = new javax.swing.JButton(); jbtnExit = new javax.swing.JButton(); jbtnSave = new javax.swing.JButton(); setFont(new java.awt.Font("Arial", 0, 12)); // NOI18N setMinimumSize(new java.awt.Dimension(780, 700)); setPreferredSize(new java.awt.Dimension(780, 700)); jTabbedPane1.setFont(new java.awt.Font("Arial", 0, 12)); // NOI18N jTabbedPane1.setPreferredSize(new java.awt.Dimension(730, 650)); jPanelDatabase.setFont(new java.awt.Font("Arial", 0, 12)); // NOI18N jPanelDatabase.setPreferredSize(new java.awt.Dimension(0, 450)); jPanelDatabase.setLayout(new javax.swing.BoxLayout(jPanelDatabase, javax.swing.BoxLayout.LINE_AXIS)); jTabbedPane1.addTab("Database Setup", jPanelDatabase); jPanelGeneral.setFont(new java.awt.Font("Arial", 0, 12)); // NOI18N jPanelGeneral.setPreferredSize(new java.awt.Dimension(0, 400)); jPanelGeneral.setLayout(new javax.swing.BoxLayout(jPanelGeneral, javax.swing.BoxLayout.LINE_AXIS)); jTabbedPane1.addTab("General", jPanelGeneral); jPanelLocale.setFont(new java.awt.Font("Arial", 0, 12)); // NOI18N jPanelLocale.setPreferredSize(new java.awt.Dimension(730, 400)); jPanelLocale.setLayout(new javax.swing.BoxLayout(jPanelLocale, javax.swing.BoxLayout.LINE_AXIS)); jTabbedPane1.addTab("Locale", jPanelLocale); jPanelPayment.setFont(new java.awt.Font("Arial", 0, 12)); // NOI18N jPanelPayment.setPreferredSize(new java.awt.Dimension(0, 400)); jPanelPayment.setLayout(new javax.swing.BoxLayout(jPanelPayment, javax.swing.BoxLayout.LINE_AXIS)); jTabbedPane1.addTab("Payment Method", jPanelPayment); jPanelPeripheral.setFont(new java.awt.Font("Arial", 0, 12)); // NOI18N jPanelPeripheral.setPreferredSize(new java.awt.Dimension(0, 400)); jPanelPeripheral.setLayout(new javax.swing.BoxLayout(jPanelPeripheral, javax.swing.BoxLayout.LINE_AXIS)); jTabbedPane1.addTab("Peripherals", jPanelPeripheral); jPanelSystem.setFont(new java.awt.Font("Arial", 0, 12)); // NOI18N jPanelSystem.setPreferredSize(new java.awt.Dimension(0, 500)); jPanelSystem.setLayout(new javax.swing.BoxLayout(jPanelSystem, javax.swing.BoxLayout.LINE_AXIS)); jTabbedPane1.addTab("System Options", jPanelSystem); jPanelTicketSetup.setFont(new java.awt.Font("Arial", 0, 12)); // NOI18N jPanelTicketSetup.setPreferredSize(new java.awt.Dimension(0, 400)); jPanelTicketSetup.setLayout(new javax.swing.BoxLayout(jPanelTicketSetup, javax.swing.BoxLayout.LINE_AXIS)); jTabbedPane1.addTab("Ticket Setup", jPanelTicketSetup); jbtnRestore.setFont(new java.awt.Font("Arial", 0, 12)); // NOI18N jbtnRestore.setText(AppLocal.getIntString("Button.Factory")); // NOI18N jbtnRestore.setMaximumSize(new java.awt.Dimension(103, 33)); jbtnRestore.setMinimumSize(new java.awt.Dimension(103, 33)); jbtnRestore.setPreferredSize(new java.awt.Dimension(80, 33)); jbtnRestore.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jbtnRestoreActionPerformed(evt); } }); jbtnExit.setFont(new java.awt.Font("Arial", 0, 12)); // NOI18N jbtnExit.setText(AppLocal.getIntString("Button.Exit")); // NOI18N jbtnExit.setMaximumSize(new java.awt.Dimension(70, 33)); jbtnExit.setMinimumSize(new java.awt.Dimension(70, 33)); jbtnExit.setPreferredSize(new java.awt.Dimension(80, 33)); jbtnExit.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jbtnExitActionPerformed(evt); } }); jbtnSave.setFont(new java.awt.Font("Arial", 0, 12)); // NOI18N jbtnSave.setText(AppLocal.getIntString("Button.Save")); // NOI18N jbtnSave.setMaximumSize(new java.awt.Dimension(70, 33)); jbtnSave.setMinimumSize(new java.awt.Dimension(70, 33)); jbtnSave.setPreferredSize(new java.awt.Dimension(80, 33)); jbtnSave.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jbtnSaveActionPerformed(evt); } }); javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1); jPanel1.setLayout(jPanel1Layout); jPanel1Layout .setHorizontalGroup( jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup( jPanel1Layout.createSequentialGroup().addContainerGap() .addComponent(jbtnRestore, javax.swing.GroupLayout.PREFERRED_SIZE, 80, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(230, 230, 230) .addComponent(jbtnExit, javax.swing.GroupLayout.PREFERRED_SIZE, 80, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 250, Short.MAX_VALUE) .addComponent(jbtnSave, javax.swing.GroupLayout.PREFERRED_SIZE, 80, javax.swing.GroupLayout.PREFERRED_SIZE) .addContainerGap())); jPanel1Layout.setVerticalGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(jbtnRestore, javax.swing.GroupLayout.PREFERRED_SIZE, 33, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(jbtnExit, javax.swing.GroupLayout.PREFERRED_SIZE, 33, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(jbtnSave, javax.swing.GroupLayout.PREFERRED_SIZE, 33, javax.swing.GroupLayout.PREFERRED_SIZE))); javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this); this.setLayout(layout); layout.setHorizontalGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(layout.createSequentialGroup().addContainerGap() .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false) .addComponent(jPanel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(jTabbedPane1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) .addContainerGap(37, Short.MAX_VALUE))); layout.setVerticalGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup() .addComponent(jTabbedPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 645, Short.MAX_VALUE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) .addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addContainerGap())); }
From source file:uk.nhs.cfh.dsp.srth.desktop.modules.querycreationtreepanel.ConstraintPanel.java
/** * Inits the components.//from w w w . j a va 2s. com */ private void initComponents() { String[] fields = new String[] { "has_dose", "has_value" }; fieldBox = new JComboBox(fields); fieldBox.addActionListener(new AbstractAction() { public void actionPerformed(ActionEvent arg0) { // get selected item selectedField = fieldBox.getSelectedItem().toString(); } }); // select has_value by default fieldBox.setSelectedItem(fields[1]); JPanel p1 = new JPanel(); p1.setLayout(new BoxLayout(p1, BoxLayout.LINE_AXIS)); p1.add(new JLabel("Field Name")); p1.add(Box.createHorizontalStrut(10)); p1.add(fieldBox); Operator[] ops = { Operator.EQUAL_TO, Operator.BETWEEN, Operator.LESS_THAN, Operator.GREATER_THAN }; operatorsBox = new JComboBox(ops); // select operator 'equal to' by default operatorsBox.setSelectedItem(Operator.EQUAL_TO); selectedOperator = Operator.EQUAL_TO; operatorsBox.addActionListener(new AbstractAction() { public void actionPerformed(ActionEvent e) { // get selected operator selectedOperator = Operator.valueOf(operatorsBox.getSelectedItem().toString()); if (selectedOperator == Operator.BETWEEN) { // enable second value spinner valueSpinner2.setEnabled(true); valueSpinnerCheckBox2.setEnabled(true); } else if (selectedOperator == Operator.EQUAL_TO) { // disable value 1 checkbox valueSpinnerCheckBox1.setEnabled(false); // disable value spinner 2 valueSpinner2.setEnabled(false); valueSpinnerCheckBox2.setEnabled(false); } else { // disable value 1 checkbox valueSpinnerCheckBox1.setEnabled(true); // disable value spinner 2 valueSpinner2.setEnabled(false); valueSpinnerCheckBox2.setEnabled(false); } } }); JPanel p2 = new JPanel(); p2.setLayout(new BoxLayout(p2, BoxLayout.LINE_AXIS)); p2.add(new JLabel("Operator")); p2.add(Box.createHorizontalStrut(20)); p2.add(operatorsBox); // create spinners SpinnerNumberModel model1 = new SpinnerNumberModel(0, 0, 10000, 0.1); SpinnerNumberModel model2 = new SpinnerNumberModel(0, 0, 10000, 0.1); valueSpinner1 = new JSpinner(model1); valueSpinner1.setName("valueSpinner1"); valueSpinner2 = new JSpinner(model2); valueSpinner2.setName("valueSpinner2"); // disable spinner 2 by default valueSpinner2.setEnabled(false); // create check boxes for inclusive ranges... valueSpinnerCheckBox1 = new JCheckBox(new AbstractAction("Inclusive") { public void actionPerformed(ActionEvent e) { value1Inclusive = valueSpinnerCheckBox1.isSelected(); } }); valueSpinnerCheckBox2 = new JCheckBox(new AbstractAction("Inclusive") { public void actionPerformed(ActionEvent e) { value2Inclusive = valueSpinnerCheckBox2.isSelected(); } }); JPanel p3 = new JPanel(); p3.setLayout(new BoxLayout(p3, BoxLayout.LINE_AXIS)); p3.add(new JLabel("Lower Bound")); p3.add(Box.createHorizontalStrut(10)); p3.add(valueSpinner1); JPanel lowerBoundPanel = new JPanel(new GridLayout(0, 1)); lowerBoundPanel.add(p3); lowerBoundPanel.add(valueSpinnerCheckBox1); JPanel p4 = new JPanel(); p4.setLayout(new BoxLayout(p4, BoxLayout.LINE_AXIS)); p4.add(new JLabel("Upper Bound")); p4.add(Box.createHorizontalStrut(10)); p4.add(valueSpinner2); JPanel upperBoundPanel = new JPanel(new GridLayout(0, 1)); upperBoundPanel.add(p4); upperBoundPanel.add(valueSpinnerCheckBox2); // set grid layout this.setLayout(new BoxLayout(this, BoxLayout.PAGE_AXIS)); add(p1); add(p2); add(lowerBoundPanel); add(upperBoundPanel); }
From source file:uk.nhs.cfh.dsp.srth.desktop.modules.querycreationtreepanel.QueryComponentExpressionPanel.java
/** * Creates the excluded terms panel.// w w w . jav a 2 s. c o m */ private synchronized void createExcludedTermsPanel() { // create table for displaying excluded constraints excludedConstraintTableModel = new TerminologyConstraintTableModel(); excludedConstraintsTable = new JTable(excludedConstraintTableModel); excludedConstraintsTable.setDefaultRenderer(TerminologyConstraint.class, new TerminologyConstraintTableCellRenderer(humanReadableRender)); excludedConstraintsTable.addMouseListener(new MouseAdapter() { @Override public void mouseClicked(MouseEvent e) { // get row a click int row = excludedConstraintsTable.rowAtPoint(e.getPoint()); if (row > -1 && e.getClickCount() == 2) { // addingNew = false; editingExisting = true; // get constraint at row activeTerminologyConstraint = excludedConstraintTableModel.getConstraintAtRow(row); // set constraint in activeConstraintPanel and display activeConstraintsDialog activeConstraintPanel.setConstraint(activeTerminologyConstraint); activeConstraintsDialog.setVisible(true); } } }); // create a label and control buttons for editing excluded constraints JPanel p3 = new JPanel(); p3.setLayout(new BoxLayout(p3, BoxLayout.LINE_AXIS)); p3.add(new JLabel("Edit excluded constraints")); p3.add(Box.createHorizontalGlue()); // add panel for editing excluded terms JideButton addExclusionTermButton = new JideButton(new AbstractAction("", addExclusionIcon) { public void actionPerformed(ActionEvent e) { // show activeConstraintsDialog // addingNew = true; activeConstraintsDialog.setVisible(true); } }); addExclusionTermButton.setName("addExclusionTermButton"); JideButton deleteExclusionTermButton = new JideButton(new AbstractAction("", deleteExclusionIcon) { public void actionPerformed(ActionEvent e) { final int row = excludedConstraintsTable.getSelectedRow(); if (row > -1) { QueryStatement oldValue = queryService.getActiveQuery(); // get term at row TerminologyConstraint term = (TerminologyConstraint) excludedConstraintTableModel .getValueAt(row, 1); // remove term from sub query componentExpression.removeExcludedConstraint(term); Runnable runnable = new Runnable() { public void run() { excludedConstraintTableModel.deleteRow(row); } }; SwingUtilities.invokeLater(runnable); // notify listeners propertyChangeTrackerService.firePropertyChanged(ACTIVE_QUERY_CHANGED, oldValue, queryService.getActiveQuery(), QueryComponentExpressionPanel.this); } } }); deleteExclusionTermButton.setName("deleteExclusionTermButton"); // add buttons to p3 p3.add(addExclusionTermButton); p3.add(deleteExclusionTermButton); // create panel that contains excluded constraints excludedConstraintsPanel = new JPanel(new BorderLayout()); excludedConstraintsPanel.setBorder(BorderFactory.createTitledBorder("Excluded constraints")); excludedConstraintsPanel.add(p3, BorderLayout.NORTH); JScrollPane scrollPane = new JScrollPane(); scrollPane.setViewportView(excludedConstraintsTable); excludedConstraintsPanel.add(scrollPane, BorderLayout.CENTER); }
From source file:uk.nhs.cfh.dsp.srth.desktop.modules.querycreationtreepanel.QueryComponentExpressionPanel.java
/** * Creates the additional constraints table panel. *//*w ww. ja v a 2 s. c o m*/ private synchronized void createAdditionalConstraintsTablePanel() { constraintsTableModel = new ConstraintTableModel(constraints); constraintsTable = new JXTable(constraintsTableModel); constraintsTable.setPreferredScrollableViewportSize(new Dimension(400, 80)); constraintsTable.addMouseListener(new MouseAdapter() { @Override public void mouseClicked(MouseEvent e) { // get row at click point int row = constraintsTable.rowAtPoint(e.getPoint()); if (row > -1) { // check if double click if (e.getClickCount() == 2) { // get term at row Constraint constraint = constraintsTableModel.getConstraintAtRow(row); // set as active constraint activeAdditionalConstraint = constraint; // show in active constraint dialog constraintPanel.setConstraint(activeAdditionalConstraint); // set editing tag to true editingExisting = true; constraintCollapsiblePane.setCollapsed(false); } } } }); // add panel for editing excluded terms JideButton addConstraintButton = new JideButton(new AbstractAction("", addConstraintIcon) { public void actionPerformed(ActionEvent e) { constraintCollapsiblePane.setCollapsed(false); // disable editing tag editingExisting = false; } }); addConstraintButton.setName("addConstraintButton"); addConstraintButton.setBorderPainted(false); JideButton deleteConstraintButton = new JideButton(new AbstractAction("", deleteConstraintIcon) { public void actionPerformed(ActionEvent e) { final int row = constraintsTable.getSelectedRow(); if (row > -1) { // get constraint at row Constraint cons = constraintsTableModel.getConstraintAtRow(row); // remove from subquery componentExpression.removeAdditionalConstraint(cons); Runnable runnable = new Runnable() { public void run() { // delete constraint at row constraintsTableModel.deleteRow(row); constraintsTable.revalidate(); QueryComponentExpressionPanel.this.revalidate(); } }; SwingUtilities.invokeLater(runnable); // notify listeners of query change queryService.queryChanged(queryService.getActiveQuery(), QueryComponentExpressionPanel.this); } } }); deleteConstraintButton.setName("deleteConstraintButton"); deleteConstraintButton.setBorderPainted(false); JPanel buttonsPanel = new JPanel(); buttonsPanel.setLayout(new BoxLayout(buttonsPanel, BoxLayout.LINE_AXIS)); buttonsPanel.add(new JLabel("Edit constraints")); buttonsPanel.add(Box.createHorizontalGlue()); buttonsPanel.add(addConstraintButton); buttonsPanel.add(deleteConstraintButton); additionalConstraintsPanel = new JPanel(new BorderLayout()); additionalConstraintsPanel.setBorder(BorderFactory.createTitledBorder("Additional Constraints")); additionalConstraintsPanel.add(buttonsPanel, BorderLayout.NORTH); additionalConstraintsPanel.add(new JScrollPane(constraintsTable), BorderLayout.CENTER); additionalConstraintsPanel.add(constraintCollapsiblePane, BorderLayout.SOUTH); }