List of usage examples for javax.swing SwingConstants CENTER
int CENTER
To view the source code for javax.swing SwingConstants CENTER.
Click Source Link
From source file:dk.dma.epd.common.prototype.gui.notification.ChatServicePanel.java
/** * Updates the chat message panel in the Swing event thread *//* ww w. j a v a 2 s . c o m*/ public void updateChatMessagePanel() { // Ensure that we operate in the Swing event thread if (!SwingUtilities.isEventDispatchThread()) { SwingUtilities.invokeLater(new Runnable() { @Override public void run() { updateChatMessagePanel(); } }); return; } // Set the title header titleHeader.setText(chatData != null ? NameUtils.getName(chatData.getId(), NameFormat.MEDIUM) : " "); titleHeader.setVisible(chatData != null); // Only enable send-function when there is chat data, and hence a target sendBtn.setEnabled(chatData != null); messageText.setEditable(chatData != null); // Remove all components from the messages panel messagesPanel.removeAll(); Insets insets = new Insets(0, 2, 2, 2); Insets insets2 = new Insets(6, 2, 0, 2); if (chatData != null && chatData.getMessageCount() > 0) { // First, add a filler component int y = 0; messagesPanel.add(new JLabel(""), new GridBagConstraints(0, y++, 1, 1, 0.0, 1.0, NORTH, VERTICAL, insets, 0, 0)); // Add the messages long lastMessageTime = 0; for (EPDChatMessage message : chatData.getMessages()) { // Check if we need to add a time label if (message.getSendDate().getTime() - lastMessageTime > PRINT_DATE_INTERVAL) { JLabel dateLabel = new JLabel( String.format(message.isOwnMessage() ? "Sent to %s" : "Received %s", Formatter.formatShortDateTimeNoTz(new Date(message.getSendDate().getTime())))); dateLabel.setFont(dateLabel.getFont().deriveFont(9.0f).deriveFont(Font.PLAIN)); dateLabel.setHorizontalAlignment(SwingConstants.CENTER); dateLabel.setForeground(Color.LIGHT_GRAY); messagesPanel.add(dateLabel, new GridBagConstraints(0, y++, 1, 1, 1.0, 0.0, NORTH, HORIZONTAL, insets2, 0, 0)); } // Add a chat message field JPanel msg = new JPanel(); msg.setBorder(new ChatMessageBorder(message)); JLabel msgLabel = new ChatMessageLabel(message.getMsg(), message.isOwnMessage()); msg.add(msgLabel); messagesPanel.add(msg, new GridBagConstraints(0, y++, 1, 1, 1.0, 0.0, NORTH, HORIZONTAL, insets, 0, 0)); lastMessageTime = message.getSendDate().getTime(); } // Scroll to the bottom validate(); scrollPane.getVerticalScrollBar().setValue(scrollPane.getVerticalScrollBar().getMaximum()); messagesPanel.repaint(); } else if (chatData == null && noDataComponent != null) { // The noDataComponent may e.g. be a message messagesPanel.add(noDataComponent, new GridBagConstraints(0, 0, 1, 1, 1.0, 1.0, NORTH, BOTH, insets, 0, 0)); } }
From source file:edu.harvard.i2b2.query.ui.TopPanel.java
/** * This method is called from within the constructor to initialize the form. *//*from w w w. j a v a 2s.c o m*/ private void initComponents() { jAnalysisLabel = new javax.swing.JLabel(); jNameLabel = new javax.swing.JLabel(); jSetSizeLabel = new javax.swing.JLabel(); jNameTextField = new javax.swing.JTextField(); jSetSizeFiled = new javax.swing.JLabel(); jDeleteButton = new javax.swing.JButton(); jScrollPane1 = new ConceptTreePanel("Group 1", this); jRunQueryButton = new javax.swing.JButton(); jCancelButton = new javax.swing.JButton(); jClearGroupsButton = new javax.swing.JButton(); jScrollPane2 = new ConceptTreePanel("Group 2", this); jScrollPane3 = new ConceptTreePanel("Group 3", this); jScrollPane4 = new javax.swing.JScrollPane(); jPanel1 = new javax.swing.JPanel(); // jVisitComboBox = new javax.swing.JComboBox(); jAndOrLabel1 = new javax.swing.JLabel(); jAndOrLabel2 = new javax.swing.JLabel(); jMorePanelsButton = new javax.swing.JButton(); jWorkflowToolBar = new javax.swing.JToolBar(); // jTimelineToggleButton = new javax.swing.JToggleButton(); jPatientCountToggleButton = new javax.swing.JToggleButton(); // jPatientSetToggleButton = new javax.swing.JToggleButton(); jToolbarPanel = new javax.swing.JPanel(); jQueryNamePanel = new javax.swing.JPanel(); // jOptionsScrollPane = new javax.swing.JScrollPane(); jOptionsPanel = new AnalysisPanel(); jShowTimelineCheckBox = new javax.swing.JCheckBox(); jGetAllPatientsCheckBox = new javax.swing.JCheckBox(); // jGetPatientCountCheckBox = new javax.swing.JCheckBox(); // jGetPatientSetCheckBox = new javax.swing.JCheckBox(); setLayout(null); // jScrollPane4.setHorizontalScrollBarPolicy(javax.swing. // ScrollPaneConstants.HORIZONTAL_SCROLLBAR_ALWAYS); jPanel1.setLayout(null); jPanel1.add(jScrollPane1); jScrollPane1.setBounds(0, 0, 180, 200); jPanel1.add(jScrollPane2); jScrollPane2.setBounds(185, 0, 180, 200); jPanel1.add(jScrollPane3); jScrollPane3.setBounds(370, 0, 180, 200); // jAndOrLabel1.setHorizontalAlignment(javax.swing.SwingConstants.CENTER) // ; jAndOrLabel1.setText("and"); // jAndOrLabel1.setBorder(javax.swing.BorderFactory.createEtchedBorder()) // ; // jPanel1.add(jAndOrLabel1); // jAndOrLabel1.setBounds(190, 90, 30, 18); // jAndOrLabel2.setHorizontalAlignment(javax.swing.SwingConstants.CENTER) // ; // jAndOrLabel2.setText("and"); // jAndOrLabel2.setBorder(javax.swing.BorderFactory.createEtchedBorder()) // ; // jPanel1.add(jAndOrLabel2); // jAndOrLabel2.setBounds(410, 90, 30, 18); jQueryNamePanel.setLayout(null); jQueryNamePanel.setBorder(javax.swing.BorderFactory.createEtchedBorder()); jNameLabel.setText(" Query Name: "); jNameLabel.setToolTipText("You may drag this item to workplace to save the query definition"); jNameLabel.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0))); jNameLabel.setBounds(2, 2, 70, 23); add(jNameLabel); // jQueryNamePanel.add(jNameLabel); jNameLabel.setTransferHandler(new NameLabelTextHandler()); jNameLabel.addMouseListener(new DragMouseAdapter()); jNameLabel.addMouseMotionListener(new java.awt.event.MouseMotionAdapter() { public void mouseMoved(java.awt.event.MouseEvent evt) { jNameLabelMouseMoved(evt); } }); jNameLabel.addMouseListener(new java.awt.event.MouseAdapter() { public void mouseExited(java.awt.event.MouseEvent evt) { jNameLabelMouseExited(evt); } }); jNameTextField.setText(""); jNameTextField.setBounds(95, 10, 370, 20); jNameTextField.setEditable(false); jNameTextField.setDragEnabled(true); jNameTextField.setTransferHandler(new TransferHandler("Text")); // jQueryNamePanel.add(jNameTextField); // add(jNameTextField); // add(jQueryNamePanel); // jQueryNamePanel.setBounds(5, 5, 400, 50); jClearGroupsButton.setFont(new java.awt.Font("Tahoma", 1, 10)); jClearGroupsButton.setText("X"); jClearGroupsButton.setHorizontalAlignment(javax.swing.SwingConstants.LEFT); jClearGroupsButton.setHorizontalTextPosition(javax.swing.SwingConstants.LEFT); jClearGroupsButton.setMargin(new java.awt.Insets(2, 2, 2, 2)); jClearGroupsButton.setToolTipText("Reset all panels"); if (System.getProperty("os.name").toLowerCase().indexOf("mac") > -1) { jClearGroupsButton.setMargin(new java.awt.Insets(-10, -15, -10, -20)); } jClearGroupsButton.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jClearGroupsButtonActionPerformed(evt); } }); jClearGroupsButton.setBounds(600, 10, 30, 20); add(jClearGroupsButton); jAnalysisLabel.setText("Analysis Types"); // jAnalysisLabel.setBackground(Color.WHITE); // jAnalysisLabel.setOpaque(true); jAnalysisLabel.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0))); jAnalysisLabel.setBounds(2, 2, 70, 23); jAnalysisLabel.setHorizontalAlignment(javax.swing.SwingConstants.CENTER); jAnalysisLabel.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER); add(jAnalysisLabel); jPanel1.setPreferredSize(new Dimension(700, 150)); jScrollPane4.setViewportView(jPanel1); add(jScrollPane4); jScrollPane4.setBounds(20, 35, 635, 220); jScrollPane4.setHorizontalScrollBarPolicy(javax.swing.ScrollPaneConstants.HORIZONTAL_SCROLLBAR_ALWAYS); jScrollPane4.setVerticalScrollBarPolicy(javax.swing.ScrollPaneConstants.VERTICAL_SCROLLBAR_NEVER); // jScrollPane4.setBorder(javax.swing.BorderFactory // .createLineBorder(new java.awt.Color(0, 0, 0))); jCancelButton.setText("Cancel"); jCancelButton.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jCancelButtonActionPerformed(evt); } }); // add(jCancelButton); // jCancelButton.setBounds(20, 255, 90, 23); // jCancelButton.setFont(new Font("Tahoma", Font.PLAIN, 10)); jGetAllPatientsCheckBox.setText("Get Everyone"); jGetAllPatientsCheckBox.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0))); // jGetAllPatientsCheckBox // .setBorder(new javax.swing.border.SoftBevelBorder( // javax.swing.border.BevelBorder.RAISED)); jGetAllPatientsCheckBox.setBorderPainted(true); jGetAllPatientsCheckBox.setContentAreaFilled(false); jGetAllPatientsCheckBox.setHorizontalAlignment(javax.swing.SwingConstants.CENTER); jGetAllPatientsCheckBox.setHorizontalTextPosition(javax.swing.SwingConstants.RIGHT); jGetAllPatientsCheckBox.setMargin(new java.awt.Insets(0, 0, 0, 0)); jGetAllPatientsCheckBox.setToolTipText("Get all the patients in datamart"); add(jGetAllPatientsCheckBox); jGetAllPatientsCheckBox.setBounds(5, 255, 110, 15); jGetAllPatientsCheckBox.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jGetAllPatientsCheckBoxActionPerformed(evt); } }); jRunQueryButton.setText("Run Query Above"); jRunQueryButton.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jRunQueryButtonActionPerformed(evt); } }); add(jRunQueryButton); jRunQueryButton.setBounds(100, 255, 625, 23); jSetSizeLabel.setText(" Patient(s) returned:"); add(jSetSizeLabel); jSetSizeLabel.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0))); jSetSizeLabel.setBounds(20, 275, 70, 23); // jSetSizeFiled.setText(" subjects"); // jSetSizeFiled.setEditable(false); // jSetSizeFiled.setHorizontalAlignment(SwingConstants.LEFT); // add(jSetSizeFiled); // jSetSizeLabel.setBounds(20, 275, 70, 23); jToolbarPanel.setLayout(new java.awt.BorderLayout()); // jWorkflowToolBar.setRollover(true); // jWorkflowToolBar.setInheritsPopupMenu(true); // jTimelineToggleButton // .setIcon(new javax.swing.ImageIcon( // "C:\\Documents and Settings\\wp066\\My Documents\\icons\\wb16.gif")); // /jTimelineToggleButton.setText("Show TimeLine"); // jTimelineToggleButton.setFocusPainted(false); // jWorkflowToolBar.add(jTimelineToggleButton); jPatientCountToggleButton.setIcon( new javax.swing.ImageIcon("C:\\Documents and Settings\\wp066\\My Documents\\icons\\wb16.gif")); jPatientCountToggleButton.setText("Get Patient Count"); jPatientCountToggleButton.setFocusPainted(false); jWorkflowToolBar.add(jPatientCountToggleButton); // jPatientSetToggleButton // .setIcon(new javax.swing.ImageIcon( // "C:\\Documents and Settings\\wp066\\My Documents\\icons\\wb16.gif")); // jPatientSetToggleButton.setText("Get Patient Set"); // jPatientSetToggleButton.setFocusPainted(false); // jWorkflowToolBar.add(jPatientSetToggleButton); jWorkflowToolBar.setPreferredSize(new Dimension(380, 40)); jToolbarPanel.add(jWorkflowToolBar, java.awt.BorderLayout.PAGE_START); jToolbarPanel.add(jWorkflowToolBar, java.awt.BorderLayout.CENTER); // add(jToolbarPanel); jToolbarPanel.setBounds(20, 130, 240, 23); jMorePanelsButton.setText("<html><center>Add<br>" + "<left>Group"); jMorePanelsButton.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jMorePanelsButtonActionPerformed(evt); } }); // add(jMorePanelsButton); // jMorePanelsButton.setBounds(655, 35, 60, 220); jPanel1.add(jMorePanelsButton); jMorePanelsButton.setBounds(550, 0, 60, 200); // jOptionsPanel.setLayout(null); // jOptionsScrollPane.setBorder(javax.swing.BorderFactory // .createEtchedBorder()); // jOptionsPanel.setPreferredSize(new java.awt.Dimension(100, 100)); jShowTimelineCheckBox.setText("Timeline"); jShowTimelineCheckBox.setBorder(javax.swing.BorderFactory.createEmptyBorder(0, 0, 0, 0)); jShowTimelineCheckBox.setMargin(new java.awt.Insets(0, 0, 0, 0)); jShowTimelineCheckBox.setToolTipText("Get the patient set and display it in timeline view"); // jOptionsPanel.add(jShowTimelineCheckBox); jShowTimelineCheckBox.setBounds(5, 20, 110, 15); // jGetPatientCountCheckBox.setText("Patient Count"); // jGetPatientCountCheckBox.setBorder(javax.swing.BorderFactory // .createEmptyBorder(0, 0, 0, 0)); // jGetPatientCountCheckBox.setMargin(new java.awt.Insets(0, 0, 0, 0)); // jGetPatientCountCheckBox.setToolTipText("Get the patient count XML"); // jOptionsPanel.add(jGetPatientCountCheckBox); // jGetPatientCountCheckBox.setBounds(5, 50, 110, 15); // jGetPatientSetCheckBox.setText("Patient Set"); // jGetPatientSetCheckBox.setBorder(javax.swing.BorderFactory // .createEmptyBorder(0, 0, 0, 0)); // jGetPatientSetCheckBox.setMargin(new java.awt.Insets(0, 0, 0, 0)); // jOptionsPanel.add(jGetPatientSetCheckBox); // jGetPatientSetCheckBox.setBounds(10, 80, 80, 15); // jOptionsScrollPane.setViewportView(jOptionsPanel); add(jOptionsPanel); jOptionsPanel.setBounds(500, 30, 120, 190); /* * jDeleteButton.setText("Delete"); jDeleteButton.addActionListener(new * java.awt.event.ActionListener() { public void * actionPerformed(java.awt.event.ActionEvent evt) { * jDeleteButtonActionPerformed(evt); } }); * * jVisitComboBox.setModel(new javax.swing.DefaultComboBoxModel(new * String[] { "Groups don't have to occur in the same visit", "Groups * must all occur in the same visit" })); add(jVisitComboBox); * jVisitComboBox.setBounds(20, 40, 240, 22); * * //add(jDeleteButton); //jDeleteButton.setBounds(20, 10, 65, 23); * * add(jScrollPane1); jScrollPane1.setBounds(20, 70, 170, 320); * * jRunQueryButton.setText("Run Query"); * jRunQueryButton.addActionListener(new java.awt.event.ActionListener() * { public void actionPerformed(java.awt.event.ActionEvent evt) { * jRunQueryButtonActionPerformed(evt); } }); * * add(jRunQueryButton); jRunQueryButton.setBounds(20, 10, 87, 23); * * jCancelButton.setText("Remove All"); * jCancelButton.addActionListener(new java.awt.event.ActionListener() { * public void actionPerformed(java.awt.event.ActionEvent evt) { * jRemoveAllButtonActionPerformed(evt); } }); * * add(jCancelButton); jCancelButton.setBounds(115, 10, 90, 23); * * //jScrollPane4.setHorizontalScrollBarPolicy(javax.swing. * ScrollPaneConstants.HORIZONTAL_SCROLLBAR_ALWAYS); * jPanel1.setLayout(null); * jScrollPane4.getHorizontalScrollBar().setUnitIncrement(20); * //jPanel1.setVisible(false); * * //jScrollPane1.setToolTipText("scrollpane 1"); * jPanel1.add(jScrollPane1); jScrollPane1.setBounds(0, 0, 170, 350); * * jPanel1.add(jScrollPane2); jScrollPane2.setBounds(210, 0, 170, 350); */ jAndOrLabel1.setBackground(new java.awt.Color(255, 255, 255)); jAndOrLabel1.setHorizontalAlignment(javax.swing.SwingConstants.CENTER); jAndOrLabel1.setText("and"); jAndOrLabel1.setToolTipText("Click to change the relationship"); jAndOrLabel1.setBorder(javax.swing.BorderFactory.createEtchedBorder()); jAndOrLabel1.addMouseListener(new java.awt.event.MouseAdapter() { @Override public void mouseClicked(java.awt.event.MouseEvent evt) { jAndOrLabel1MouseClicked(evt); } }); // jPanel1.add(jAndOrLabel1); jAndOrLabel2.setHorizontalAlignment(javax.swing.SwingConstants.CENTER); jAndOrLabel2.setText("and"); jAndOrLabel2.setToolTipText("Click to change the relationship"); jAndOrLabel2.setBorder(javax.swing.BorderFactory.createEtchedBorder()); jAndOrLabel2.addMouseListener(new java.awt.event.MouseAdapter() { @Override public void mouseClicked(java.awt.event.MouseEvent evt) { jAndOrLabel2MouseClicked(evt); } }); // jPanel1.add(jAndOrLabel2); // jTree1.addTreeWillExpandListener(this); // jTree1.addTreeExpansionListener(this); // jScrollPane1.setViewportView(new QueryConceptTreePanel("Group 1")); // jScrollPane1.setToolTipText("Double click on a folder to view the // items inside"); // jTree2.addTreeExpansionListener(this); // jScrollPane2.setViewportView(new QueryConceptTreePanel("Group 2")); // jTree3.addTreeExpansionListener(this); // treepanel = new QueryConceptTreePanel("", this); // jScrollPane3.setViewportView(new QueryConceptTreePanel("Group 3")); // jSlider1.setMajorTickSpacing(20); /* * jSlider1.setPaintTicks(true); jSlider1.setValue(0); * jSlider1.setMinorTickSpacing(10); jSlider1.setToolTipText("Slider on * left is more Sensitive Query, " + "on right is more Specific"); * add(jSlider1); jSlider1.setBounds(380, 40, 140, 18); * * //jLabel1.setFont(new java.awt.Font("Tahoma", 1, 11)); * jLabel1.setHorizontalAlignment(javax.swing.SwingConstants.TRAILING); * jLabel1.setText("Sensitivity <"); add(jLabel1); * jLabel1.setBounds(290, 40, 80, 20); * * //jLabel2.setFont(new java.awt.Font("Tahoma", 1, 11)); * jLabel2.setText("> Specificity"); add(jLabel2); * jLabel2.setBounds(525, 40, 70, 20); */ dataModel.addPanel(jScrollPane1, null, 0); dataModel.addPanel(jScrollPane2, jAndOrLabel1, 0); dataModel.addPanel(jScrollPane3, jAndOrLabel2, 555); }
From source file:ca.uhn.hl7v2.testpanel.ui.conn.Hl7ConnectionPanel.java
/** * Create the panel./* ww w . ja va 2 s . c o m*/ */ public Hl7ConnectionPanel(Controller theController) { setBorder(new EtchedBorder(EtchedBorder.LOWERED, null, null)); GridBagLayout gridBagLayout = new GridBagLayout(); gridBagLayout.columnWidths = new int[] { 150, 0 }; gridBagLayout.rowHeights = new int[] { 0, 0, 0, 0, 0, 0, 0, 0 }; gridBagLayout.columnWeights = new double[] { 0.0, 1.0 }; gridBagLayout.rowWeights = new double[] { 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1.0, Double.MIN_VALUE }; setLayout(gridBagLayout); mySinglePortRadio = new JRadioButton("Single Port MLLP"); mySinglePortRadio.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { updatePortsModel(); updatePortsUi(); } }); myPortButtonGroup.add(mySinglePortRadio); GridBagConstraints gbc_SinglePortRadio = new GridBagConstraints(); gbc_SinglePortRadio.anchor = GridBagConstraints.WEST; gbc_SinglePortRadio.insets = new Insets(0, 0, 5, 5); gbc_SinglePortRadio.gridx = 0; gbc_SinglePortRadio.gridy = 0; add(mySinglePortRadio, gbc_SinglePortRadio); JPanel panel_4 = new JPanel(); panel_4.setBorder(new EtchedBorder(EtchedBorder.LOWERED, null, null)); GridBagConstraints gbc_panel_4 = new GridBagConstraints(); gbc_panel_4.fill = GridBagConstraints.BOTH; gbc_panel_4.insets = new Insets(0, 0, 5, 0); gbc_panel_4.gridx = 1; gbc_panel_4.gridy = 0; add(panel_4, gbc_panel_4); GridBagLayout gbl_panel_4 = new GridBagLayout(); gbl_panel_4.columnWidths = new int[] { 0, 0, 0 }; gbl_panel_4.rowHeights = new int[] { 0, 0 }; gbl_panel_4.columnWeights = new double[] { 0.0, 1.0, Double.MIN_VALUE }; gbl_panel_4.rowWeights = new double[] { 0.0, Double.MIN_VALUE }; panel_4.setLayout(gbl_panel_4); mySinglePortTextBox = new JTextField(); mySinglePortTextBox.getDocument().addDocumentListener(new SimpleDocumentListener() { @Override public void update(DocumentEvent theE) { String text = mySinglePortTextBox.getText(); text = text.replaceAll("[^0-9]+", ""); if (!StringUtils.equals(mySinglePortTextBox.getText(), text)) { final String newVal = text; SwingUtilities.invokeLater(new Runnable() { public void run() { mySinglePortTextBox.setText(newVal); } }); } if (mySinglePortRadio.isSelected()) { if (text.length() > 0) { myConnection.setIncomingOrSinglePort(Integer.parseInt(text)); } else { myConnection.setIncomingOrSinglePort(-1); } } } }); mylabel = new JLabel("Port"); mylabel.setHorizontalAlignment(SwingConstants.CENTER); mylabel.setPreferredSize(new Dimension(60, 16)); mylabel.setMinimumSize(new Dimension(60, 16)); mylabel.setMaximumSize(new Dimension(60, 16)); GridBagConstraints gbc_label = new GridBagConstraints(); gbc_label.anchor = GridBagConstraints.EAST; gbc_label.insets = new Insets(0, 0, 0, 5); gbc_label.gridx = 0; gbc_label.gridy = 0; panel_4.add(mylabel, gbc_label); GridBagConstraints gbc_SinglePortTextBox = new GridBagConstraints(); gbc_SinglePortTextBox.insets = new Insets(0, 5, 0, 0); gbc_SinglePortTextBox.anchor = GridBagConstraints.WEST; gbc_SinglePortTextBox.gridx = 1; gbc_SinglePortTextBox.gridy = 0; panel_4.add(mySinglePortTextBox, gbc_SinglePortTextBox); mySinglePortTextBox.setMinimumSize(new Dimension(100, 28)); mySinglePortTextBox.setMaximumSize(new Dimension(100, 2147483647)); mySinglePortTextBox.setColumns(10); myDualPortRadio = new JRadioButton("Dual Port MLLP"); myDualPortRadio.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { updatePortsModel(); updatePortsUi(); } }); myPortButtonGroup.add(myDualPortRadio); GridBagConstraints gbc_DualPortRadio = new GridBagConstraints(); gbc_DualPortRadio.anchor = GridBagConstraints.WEST; gbc_DualPortRadio.insets = new Insets(0, 0, 5, 5); gbc_DualPortRadio.gridx = 0; gbc_DualPortRadio.gridy = 1; add(myDualPortRadio, gbc_DualPortRadio); JPanel panel = new JPanel(); panel.setBorder(new EtchedBorder(EtchedBorder.LOWERED, null, null)); GridBagConstraints gbc_BottomPanel = new GridBagConstraints(); gbc_BottomPanel.insets = new Insets(0, 0, 5, 0); gbc_BottomPanel.fill = GridBagConstraints.BOTH; gbc_BottomPanel.gridx = 1; gbc_BottomPanel.gridy = 1; add(panel, gbc_BottomPanel); GridBagLayout gbl_panel = new GridBagLayout(); gbl_panel.columnWidths = new int[] { 0, 0, 0, 0, 0, 0 }; gbl_panel.rowHeights = new int[] { 0, 0 }; gbl_panel.columnWeights = new double[] { 0.0, 0.0, 0.0, 0.0, 0.0, Double.MIN_VALUE }; gbl_panel.rowWeights = new double[] { 0.0, Double.MIN_VALUE }; panel.setLayout(gbl_panel); JLabel lblInbound = new JLabel("Inbound"); lblInbound.setHorizontalAlignment(SwingConstants.CENTER); lblInbound.setPreferredSize(new Dimension(60, 16)); lblInbound.setMinimumSize(new Dimension(60, 16)); lblInbound.setMaximumSize(new Dimension(60, 16)); GridBagConstraints gbc_lblInbound = new GridBagConstraints(); gbc_lblInbound.insets = new Insets(0, 5, 0, 5); gbc_lblInbound.anchor = GridBagConstraints.EAST; gbc_lblInbound.gridx = 0; gbc_lblInbound.gridy = 0; panel.add(lblInbound, gbc_lblInbound); myDualIncomingTextBox = new JTextField(); myDualIncomingTextBox.getDocument().addDocumentListener(new SimpleDocumentListener() { @Override public void update(DocumentEvent theE) { String text = myDualIncomingTextBox.getText(); text = text.replaceAll("[^0-9]+", ""); if (!StringUtils.equals(myDualIncomingTextBox.getText(), text)) { final String newVal = text; SwingUtilities.invokeLater(new Runnable() { public void run() { myDualIncomingTextBox.setText(newVal); } }); } if (myDualPortRadio.isSelected()) { if (text.length() > 0) { myConnection.setIncomingOrSinglePort(Integer.parseInt(text)); } else { myConnection.setIncomingOrSinglePort(-1); } } } }); myDualIncomingTextBox.setMaximumSize(new Dimension(100, 2147483647)); myDualIncomingTextBox.setMinimumSize(new Dimension(100, 28)); GridBagConstraints gbc_DualIncomingTextBox = new GridBagConstraints(); gbc_DualIncomingTextBox.anchor = GridBagConstraints.WEST; gbc_DualIncomingTextBox.insets = new Insets(0, 0, 0, 5); gbc_DualIncomingTextBox.gridx = 1; gbc_DualIncomingTextBox.gridy = 0; panel.add(myDualIncomingTextBox, gbc_DualIncomingTextBox); myDualIncomingTextBox.setColumns(10); JLabel lblOutbound = new JLabel("Outbound"); GridBagConstraints gbc_lblOutbound = new GridBagConstraints(); gbc_lblOutbound.anchor = GridBagConstraints.EAST; gbc_lblOutbound.insets = new Insets(0, 0, 0, 5); gbc_lblOutbound.gridx = 2; gbc_lblOutbound.gridy = 0; panel.add(lblOutbound, gbc_lblOutbound); myDualOutgoingTextBox = new JTextField(); myDualOutgoingTextBox.getDocument().addDocumentListener(new SimpleDocumentListener() { @Override public void update(DocumentEvent theE) { String text = myDualOutgoingTextBox.getText(); text = text.replaceAll("[^0-9]+", ""); if (!StringUtils.equals(myDualOutgoingTextBox.getText(), text)) { final String newVal = text; SwingUtilities.invokeLater(new Runnable() { public void run() { myDualOutgoingTextBox.setText(newVal); } }); } if (myDualPortRadio.isSelected()) { if (text.length() > 0) { myConnection.setOutgoingPort(Integer.parseInt(text)); } else { myConnection.setOutgoingPort(-1); } } } }); myDualOutgoingTextBox.setMinimumSize(new Dimension(100, 28)); myDualOutgoingTextBox.setMaximumSize(new Dimension(100, 2147483647)); GridBagConstraints gbc_DualOutgoingTextBox = new GridBagConstraints(); gbc_DualOutgoingTextBox.insets = new Insets(0, 0, 0, 5); gbc_DualOutgoingTextBox.anchor = GridBagConstraints.WEST; gbc_DualOutgoingTextBox.gridx = 3; gbc_DualOutgoingTextBox.gridy = 0; panel.add(myDualOutgoingTextBox, gbc_DualOutgoingTextBox); myDualOutgoingTextBox.setColumns(10); myHl7OverHttpRadioButton = new JRadioButton("HL7 over HTTP"); myHl7OverHttpRadioButton.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { updatePortsModel(); updatePortsUi(); } }); myPortButtonGroup.add(myHl7OverHttpRadioButton); GridBagConstraints gbc_Hl7OverHttpRadioButton = new GridBagConstraints(); gbc_Hl7OverHttpRadioButton.anchor = GridBagConstraints.WEST; gbc_Hl7OverHttpRadioButton.insets = new Insets(0, 0, 5, 5); gbc_Hl7OverHttpRadioButton.gridx = 0; gbc_Hl7OverHttpRadioButton.gridy = 2; add(myHl7OverHttpRadioButton, gbc_Hl7OverHttpRadioButton); mypanel = new JPanel(); mypanel.setBorder(new EtchedBorder(EtchedBorder.LOWERED, null, null)); GridBagConstraints gbc_panel = new GridBagConstraints(); gbc_panel.insets = new Insets(0, 0, 5, 0); gbc_panel.fill = GridBagConstraints.BOTH; gbc_panel.gridx = 1; gbc_panel.gridy = 2; add(mypanel, gbc_panel); GridBagLayout gbl_panel2 = new GridBagLayout(); gbl_panel2.columnWidths = new int[] { 0, 0 }; gbl_panel2.rowHeights = new int[] { 0, 0 }; gbl_panel2.columnWeights = new double[] { 0.0, 1.0 }; gbl_panel2.rowWeights = new double[] { 0.0, Double.MIN_VALUE }; mypanel.setLayout(gbl_panel2); mylabel_1 = new JLabel("URL"); mylabel_1.setHorizontalAlignment(SwingConstants.CENTER); mylabel_1.setPreferredSize(new Dimension(60, 16)); mylabel_1.setMinimumSize(new Dimension(60, 16)); mylabel_1.setMaximumSize(new Dimension(60, 16)); GridBagConstraints gbc_label_1 = new GridBagConstraints(); gbc_label_1.anchor = GridBagConstraints.EAST; gbc_label_1.insets = new Insets(0, 0, 0, 5); gbc_label_1.gridx = 0; gbc_label_1.gridy = 0; mypanel.add(mylabel_1, gbc_label_1); myHoHUrlTextField = new JTextField(); myHoHUrlTextField.getDocument().addDocumentListener(new SimpleDocumentListener() { @Override public void update(DocumentEvent theE) { if (myHohUrlTextFieldUpdating) { return; } String value = myHoHUrlTextField.getText(); try { URL url = new URL(value); boolean tls; if (url.getProtocol().equals("http")) { tls = false; } else if (url.getProtocol().equals("https")) { tls = true; } else { ourLog.info("Unknown protocol: {}", url.getProtocol()); myHoHUrlTextField.setBackground(ERROR_BG); return; } myConnection.setTls(tls); myConnection.setHost(url.getHost()); myConnection .setIncomingOrSinglePort(url.getPort() != -1 ? url.getPort() : url.getDefaultPort()); myConnection.setHttpUriPath(url.getPath()); myHohUrlTextFieldUpdating = true; updatePortsUi(); myHohUrlTextFieldUpdating = false; myTlsCheckbox.setSelected(tls); myHohTlsCheckbox.setSelected(tls); myHoHUrlTextField.setBackground(Color.white); } catch (MalformedURLException e) { myHoHUrlTextField.setBackground(ERROR_BG); } } }); GridBagConstraints gbc_HohUsernameTextbox = new GridBagConstraints(); gbc_HohUsernameTextbox.fill = GridBagConstraints.HORIZONTAL; gbc_HohUsernameTextbox.gridx = 1; gbc_HohUsernameTextbox.gridy = 0; mypanel.add(myHoHUrlTextField, gbc_HohUsernameTextbox); myHoHUrlTextField.setColumns(10); JLabel lblEncoding = new JLabel("Encoding"); GridBagConstraints gbc_lblEncoding = new GridBagConstraints(); gbc_lblEncoding.insets = new Insets(0, 0, 5, 5); gbc_lblEncoding.gridx = 0; gbc_lblEncoding.gridy = 3; add(lblEncoding, gbc_lblEncoding); JPanel encodingPanel = new JPanel(); GridBagConstraints gbc_encodingPanel = new GridBagConstraints(); gbc_encodingPanel.fill = GridBagConstraints.HORIZONTAL; gbc_encodingPanel.insets = new Insets(0, 0, 5, 0); gbc_encodingPanel.gridx = 1; gbc_encodingPanel.gridy = 3; add(encodingPanel, gbc_encodingPanel); encodingPanel.setBorder(new EtchedBorder(EtchedBorder.LOWERED, null, null)); GridBagLayout gbl_encodingPanel = new GridBagLayout(); gbl_encodingPanel.columnWidths = new int[] { 144, 58, 0 }; gbl_encodingPanel.rowHeights = new int[] { 23, 0 }; gbl_encodingPanel.columnWeights = new double[] { 0.0, 0.0, Double.MIN_VALUE }; gbl_encodingPanel.rowWeights = new double[] { 0.0, Double.MIN_VALUE }; encodingPanel.setLayout(gbl_encodingPanel); myXmlRadio = new JRadioButton("XML"); myXmlRadio.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent theE) { updateEncodingModel(); } }); myEr7Radio = new JRadioButton("ER7 (Pipe and hat)"); myEr7Radio.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { updateEncodingModel(); } }); encodingButtonGroup.add(myEr7Radio); GridBagConstraints gbc_Er7Radio = new GridBagConstraints(); gbc_Er7Radio.anchor = GridBagConstraints.NORTHWEST; gbc_Er7Radio.insets = new Insets(0, 0, 0, 5); gbc_Er7Radio.gridx = 0; gbc_Er7Radio.gridy = 0; encodingPanel.add(myEr7Radio, gbc_Er7Radio); encodingButtonGroup.add(myXmlRadio); GridBagConstraints gbc_XmlRadio = new GridBagConstraints(); gbc_XmlRadio.anchor = GridBagConstraints.NORTHWEST; gbc_XmlRadio.gridx = 1; gbc_XmlRadio.gridy = 0; encodingPanel.add(myXmlRadio, gbc_XmlRadio); JLabel lblCharset = new JLabel("Charset"); GridBagConstraints gbc_lblCharset = new GridBagConstraints(); gbc_lblCharset.insets = new Insets(0, 0, 5, 5); gbc_lblCharset.gridx = 0; gbc_lblCharset.gridy = 4; add(lblCharset, gbc_lblCharset); JPanel panel_2 = new JPanel(); GridBagConstraints gbc_panel_2 = new GridBagConstraints(); gbc_panel_2.fill = GridBagConstraints.HORIZONTAL; gbc_panel_2.insets = new Insets(0, 0, 5, 0); gbc_panel_2.gridx = 1; gbc_panel_2.gridy = 4; add(panel_2, gbc_panel_2); panel_2.setBorder(new EtchedBorder(EtchedBorder.LOWERED, null, null)); GridBagLayout gbl_panel_2 = new GridBagLayout(); gbl_panel_2.columnWidths = new int[] { 28, 198, 0, 0 }; gbl_panel_2.rowHeights = new int[] { 27, 0 }; gbl_panel_2.columnWeights = new double[] { 0.0, 0.0, 0.0, Double.MIN_VALUE }; gbl_panel_2.rowWeights = new double[] { 0.0, Double.MIN_VALUE }; panel_2.setLayout(gbl_panel_2); myCharsetSelectRadio = new JRadioButton(""); myCharsetSelectRadio.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { updateCharsetModel(); } }); charsetButtonGroup.add(myCharsetSelectRadio); GridBagConstraints gbc_CharsetSelectRadio = new GridBagConstraints(); gbc_CharsetSelectRadio.anchor = GridBagConstraints.WEST; gbc_CharsetSelectRadio.insets = new Insets(0, 0, 0, 5); gbc_CharsetSelectRadio.gridx = 0; gbc_CharsetSelectRadio.gridy = 0; panel_2.add(myCharsetSelectRadio, gbc_CharsetSelectRadio); myCharsetCombo = new JComboBox(); myCharsetCombo.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { updateCharsetModel(); } }); GridBagConstraints gbc_CharsetCombo = new GridBagConstraints(); gbc_CharsetCombo.anchor = GridBagConstraints.NORTHWEST; gbc_CharsetCombo.insets = new Insets(0, 0, 0, 5); gbc_CharsetCombo.gridx = 1; gbc_CharsetCombo.gridy = 0; panel_2.add(myCharsetCombo, gbc_CharsetCombo); myCharsetDetectRadio = new JRadioButton("Detect in Message (MSH-18)"); myCharsetDetectRadio.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { updateCharsetModel(); } }); charsetButtonGroup.add(myCharsetDetectRadio); GridBagConstraints gbc_CharsetDetectRadio = new GridBagConstraints(); gbc_CharsetDetectRadio.anchor = GridBagConstraints.NORTH; gbc_CharsetDetectRadio.gridwidth = 2; gbc_CharsetDetectRadio.gridx = 2; gbc_CharsetDetectRadio.gridy = 0; panel_2.add(myCharsetDetectRadio, gbc_CharsetDetectRadio); mylabel_5 = new JLabel("Debug"); GridBagConstraints gbc_label_5 = new GridBagConstraints(); gbc_label_5.insets = new Insets(0, 0, 5, 5); gbc_label_5.gridx = 0; gbc_label_5.gridy = 5; add(mylabel_5, gbc_label_5); mypanel_2 = new JPanel(); mypanel_2.setBorder(new EtchedBorder(EtchedBorder.LOWERED, null, null)); GridBagConstraints gbc_panel_75 = new GridBagConstraints(); gbc_panel_75.insets = new Insets(0, 0, 5, 0); gbc_panel_75.fill = GridBagConstraints.BOTH; gbc_panel_75.gridx = 1; gbc_panel_75.gridy = 5; add(mypanel_2, gbc_panel_75); GridBagLayout gbl_panel_74 = new GridBagLayout(); gbl_panel_74.columnWidths = new int[] { 0, 0 }; gbl_panel_74.rowHeights = new int[] { 0, 0 }; gbl_panel_74.columnWeights = new double[] { 0.0, Double.MIN_VALUE }; gbl_panel_74.rowWeights = new double[] { 0.0, Double.MIN_VALUE }; mypanel_2.setLayout(gbl_panel_74); myCaptureByteStreamCheckbox = new JCheckBox("Capture Bytes"); GridBagConstraints gbc_CaptureByteStreamCheckbox = new GridBagConstraints(); gbc_CaptureByteStreamCheckbox.gridx = 0; gbc_CaptureByteStreamCheckbox.gridy = 0; mypanel_2.add(myCaptureByteStreamCheckbox, gbc_CaptureByteStreamCheckbox); myCaptureByteStreamCheckbox.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { myConnection.setCaptureBytes(myCaptureByteStreamCheckbox.isSelected()); } }); myCaptureByteStreamCheckbox.setToolTipText("Check this box to capture the transport level communication"); myInterfaceTypeCardPanel = new JPanel(); myInterfaceTypeCardPanel.setBorder(null); GridBagConstraints gbc_InterfaceTypeCardPanel = new GridBagConstraints(); gbc_InterfaceTypeCardPanel.gridwidth = 2; gbc_InterfaceTypeCardPanel.fill = GridBagConstraints.BOTH; gbc_InterfaceTypeCardPanel.gridx = 0; gbc_InterfaceTypeCardPanel.gridy = 6; add(myInterfaceTypeCardPanel, gbc_InterfaceTypeCardPanel); myInterfaceTypeCardPanel.setLayout(new CardLayout(0, 0)); myMllpCard = new JPanel(); myMllpCard.setBorder(null); myInterfaceTypeCardPanel.add(myMllpCard, IFACE_TYPE_CARD_MLLP); GridBagLayout gbl_MllpCard = new GridBagLayout(); gbl_MllpCard.columnWidths = new int[] { 150, 0, 0 }; gbl_MllpCard.rowHeights = new int[] { 0, 0, 0, 0 }; gbl_MllpCard.columnWeights = new double[] { 0.0, 1.0, Double.MIN_VALUE }; gbl_MllpCard.rowWeights = new double[] { 0.0, 0.0, 0.0, Double.MIN_VALUE }; myMllpCard.setLayout(gbl_MllpCard); JLabel lblHost = new JLabel("Host"); GridBagConstraints gbc_lblHost = new GridBagConstraints(); gbc_lblHost.insets = new Insets(0, 0, 5, 5); gbc_lblHost.gridx = 0; gbc_lblHost.gridy = 0; myMllpCard.add(lblHost, gbc_lblHost); mypanel_1 = new JPanel(); mypanel_1.setBorder(new EtchedBorder(EtchedBorder.LOWERED, null, null)); GridBagConstraints gbc_panel_1 = new GridBagConstraints(); gbc_panel_1.insets = new Insets(0, 0, 5, 0); gbc_panel_1.fill = GridBagConstraints.BOTH; gbc_panel_1.gridx = 1; gbc_panel_1.gridy = 0; myMllpCard.add(mypanel_1, gbc_panel_1); GridBagLayout gbl_panel_1 = new GridBagLayout(); gbl_panel_1.columnWidths = new int[] { 134, 0 }; gbl_panel_1.rowHeights = new int[] { 28, 0 }; gbl_panel_1.columnWeights = new double[] { 1.0, Double.MIN_VALUE }; gbl_panel_1.rowWeights = new double[] { 0.0, Double.MIN_VALUE }; mypanel_1.setLayout(gbl_panel_1); myHostBox = new JTextField(); GridBagConstraints gbc_HostBox = new GridBagConstraints(); gbc_HostBox.fill = GridBagConstraints.HORIZONTAL; gbc_HostBox.anchor = GridBagConstraints.NORTH; gbc_HostBox.gridx = 0; gbc_HostBox.gridy = 0; mypanel_1.add(myHostBox, gbc_HostBox); myHostBox.getDocument().addDocumentListener(new SimpleDocumentListener() { @Override public void update(DocumentEvent theE) { myConnection.setHost(myHostBox.getText()); } }); myHostBox.setColumns(10); JLabel lblTransport = new JLabel("Transport"); GridBagConstraints gbc_lblTransport = new GridBagConstraints(); gbc_lblTransport.insets = new Insets(0, 0, 5, 5); gbc_lblTransport.gridx = 0; gbc_lblTransport.gridy = 1; myMllpCard.add(lblTransport, gbc_lblTransport); JPanel panel_3 = new JPanel(); GridBagConstraints gbc_hohAuthPanel = new GridBagConstraints(); gbc_hohAuthPanel.fill = GridBagConstraints.HORIZONTAL; gbc_hohAuthPanel.insets = new Insets(0, 0, 5, 0); gbc_hohAuthPanel.gridx = 1; gbc_hohAuthPanel.gridy = 1; myMllpCard.add(panel_3, gbc_hohAuthPanel); panel_3.setBorder(new EtchedBorder(EtchedBorder.LOWERED, null, null)); GridBagLayout gbl_hohAuthPanel = new GridBagLayout(); gbl_hohAuthPanel.columnWidths = new int[] { 0, 0, 0 }; gbl_hohAuthPanel.rowHeights = new int[] { 0, 0 }; gbl_hohAuthPanel.columnWeights = new double[] { 0.0, 0.0, Double.MIN_VALUE }; gbl_hohAuthPanel.rowWeights = new double[] { 0.0, Double.MIN_VALUE }; panel_3.setLayout(gbl_hohAuthPanel); myTlsCheckbox = new JCheckBox("Use TLS/SSL"); myTlsCheckbox.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { myHohTlsCheckbox.setSelected(myTlsCheckbox.isSelected()); myConnection.setTls(myTlsCheckbox.isSelected()); } }); GridBagConstraints gbc_TlsCheckbox = new GridBagConstraints(); gbc_TlsCheckbox.insets = new Insets(0, 0, 0, 5); gbc_TlsCheckbox.anchor = GridBagConstraints.WEST; gbc_TlsCheckbox.gridx = 0; gbc_TlsCheckbox.gridy = 0; panel_3.add(myTlsCheckbox, gbc_TlsCheckbox); myHoHCard = new JPanel(); myInterfaceTypeCardPanel.add(myHoHCard, IFACE_TYPE_CARD_HOH); GridBagLayout gbl_HoHCard = new GridBagLayout(); gbl_HoHCard.columnWidths = new int[] { 150, 0, 0 }; gbl_HoHCard.rowHeights = new int[] { 0, 0, 0, 0 }; gbl_HoHCard.columnWeights = new double[] { 0.0, 1.0, Double.MIN_VALUE }; gbl_HoHCard.rowWeights = new double[] { 0.0, 0.0, 0.0, Double.MIN_VALUE }; myHoHCard.setLayout(gbl_HoHCard); mylabel_6 = new JLabel("Authorization"); GridBagConstraints gbc_label_6 = new GridBagConstraints(); gbc_label_6.insets = new Insets(0, 0, 5, 5); gbc_label_6.gridx = 0; gbc_label_6.gridy = 0; myHoHCard.add(mylabel_6, gbc_label_6); hohAuthPanel = new JPanel(); hohAuthPanel.setBorder(new EtchedBorder(EtchedBorder.LOWERED, null, null)); GridBagConstraints gbc_hohAuthPanel2 = new GridBagConstraints(); gbc_hohAuthPanel2.insets = new Insets(0, 0, 5, 0); gbc_hohAuthPanel2.fill = GridBagConstraints.BOTH; gbc_hohAuthPanel2.gridx = 1; gbc_hohAuthPanel2.gridy = 0; myHoHCard.add(hohAuthPanel, gbc_hohAuthPanel2); GridBagLayout gbl_hohAuthPanel3 = new GridBagLayout(); gbl_hohAuthPanel3.columnWidths = new int[] { 0, 0, 0, 0, 0, 0, 0 }; gbl_hohAuthPanel3.rowHeights = new int[] { 0, 0 }; gbl_hohAuthPanel3.columnWeights = new double[] { 0.0, 0.0, 0.0, 0.0, 0.0, 1.0, Double.MIN_VALUE }; gbl_hohAuthPanel3.rowWeights = new double[] { 0.0, Double.MIN_VALUE }; hohAuthPanel.setLayout(gbl_hohAuthPanel3); myHohAuthEnabledCheckbox = new JCheckBox("Enabled"); myHohAuthEnabledCheckbox.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent theE) { myConnection.setHohAuthenticationEnabled(myHohAuthEnabledCheckbox.isSelected()); } }); GridBagConstraints gbc_HohAuthEnabledCheckbox = new GridBagConstraints(); gbc_HohAuthEnabledCheckbox.insets = new Insets(0, 0, 0, 5); gbc_HohAuthEnabledCheckbox.gridx = 0; gbc_HohAuthEnabledCheckbox.gridy = 0; hohAuthPanel.add(myHohAuthEnabledCheckbox, gbc_HohAuthEnabledCheckbox); mylabel_7 = new JLabel("Username:"); GridBagConstraints gbc_label_7 = new GridBagConstraints(); gbc_label_7.insets = new Insets(0, 0, 0, 5); gbc_label_7.anchor = GridBagConstraints.EAST; gbc_label_7.gridx = 1; gbc_label_7.gridy = 0; hohAuthPanel.add(mylabel_7, gbc_label_7); myHohAuthUsernameTextbox = new JTextField(); myHohAuthUsernameTextbox.getDocument().addDocumentListener(new SimpleDocumentListener() { @Override public void update(DocumentEvent theE) { myConnection.setHohAuthenticationUsername(myHohAuthUsernameTextbox.getText()); } }); myHohAuthUsernameTextbox.setMaximumSize(new Dimension(200, 2147483647)); myHohAuthUsernameTextbox.setMinimumSize(new Dimension(100, 28)); myHohAuthUsernameTextbox.setPreferredSize(new Dimension(100, 28)); GridBagConstraints gbc_HohUsernameTextbox2 = new GridBagConstraints(); gbc_HohUsernameTextbox2.insets = new Insets(0, 0, 0, 5); gbc_HohUsernameTextbox2.fill = GridBagConstraints.HORIZONTAL; gbc_HohUsernameTextbox2.gridx = 2; gbc_HohUsernameTextbox2.gridy = 0; hohAuthPanel.add(myHohAuthUsernameTextbox, gbc_HohUsernameTextbox2); myHohAuthUsernameTextbox.setColumns(10); mylabel_8 = new JLabel("Password:"); GridBagConstraints gbc_label_8 = new GridBagConstraints(); gbc_label_8.insets = new Insets(0, 0, 0, 5); gbc_label_8.anchor = GridBagConstraints.EAST; gbc_label_8.gridx = 3; gbc_label_8.gridy = 0; hohAuthPanel.add(mylabel_8, gbc_label_8); myHohAuthPasswordTextbox = new JTextField(); myHohAuthPasswordTextbox.getDocument().addDocumentListener(new SimpleDocumentListener() { @Override public void update(DocumentEvent theE) { myConnection.setHohAuthenticationPassword(myHohAuthPasswordTextbox.getText()); } }); myHohAuthPasswordTextbox.setPreferredSize(new Dimension(100, 28)); myHohAuthPasswordTextbox.setMaximumSize(new Dimension(200, 2147483647)); myHohAuthPasswordTextbox.setMinimumSize(new Dimension(100, 28)); GridBagConstraints gbc_HohSignatureKeystoreTextbox = new GridBagConstraints(); gbc_HohSignatureKeystoreTextbox.insets = new Insets(0, 0, 0, 5); gbc_HohSignatureKeystoreTextbox.fill = GridBagConstraints.HORIZONTAL; gbc_HohSignatureKeystoreTextbox.gridx = 4; gbc_HohSignatureKeystoreTextbox.gridy = 0; hohAuthPanel.add(myHohAuthPasswordTextbox, gbc_HohSignatureKeystoreTextbox); myHohAuthPasswordTextbox.setColumns(10); mylabel_2 = new JLabel("Security Profile"); mylabel_2.setVerticalTextPosition(SwingConstants.TOP); mylabel_2.setVerticalAlignment(SwingConstants.TOP); GridBagConstraints gbc_label_2 = new GridBagConstraints(); gbc_label_2.insets = new Insets(0, 0, 5, 5); gbc_label_2.gridx = 0; gbc_label_2.gridy = 1; myHoHCard.add(mylabel_2, gbc_label_2); // securityProfilePanel = new JPanel(); GridBagConstraints gbc_securityProfilePanel = new GridBagConstraints(); gbc_securityProfilePanel.insets = new Insets(0, 0, 5, 0); gbc_securityProfilePanel.fill = GridBagConstraints.BOTH; gbc_securityProfilePanel.gridx = 1; gbc_securityProfilePanel.gridy = 1; // myHoHCard.add(securityProfilePanel, gbc_securityProfilePanel); // securityProfilePanel.setLayout(new BorderLayout(0, 0)); tlsKeystorePanel = new JPanel(); tlsKeystorePanel.setBorder(new EtchedBorder(EtchedBorder.LOWERED, null, null)); // securityProfilePanel.add(tlsKeystorePanel, BorderLayout.CENTER); myHoHCard.add(tlsKeystorePanel, gbc_securityProfilePanel); GridBagLayout gbl_tlsKeystorePanel = new GridBagLayout(); gbl_tlsKeystorePanel.columnWidths = new int[] { 0, 58, 107, 77, 0, 0 }; gbl_tlsKeystorePanel.rowHeights = new int[] { 28, 16, 0, 0 }; gbl_tlsKeystorePanel.columnWeights = new double[] { 0.0, 0.0, 1.0, 1.0, 0.0, Double.MIN_VALUE }; gbl_tlsKeystorePanel.rowWeights = new double[] { 0.0, 0.0, 0.0, Double.MIN_VALUE }; tlsKeystorePanel.setLayout(gbl_tlsKeystorePanel); myHohTlsCheckbox = new JCheckBox("TLS Enabled"); GridBagConstraints gbc_HohTlsCheckbox = new GridBagConstraints(); gbc_HohTlsCheckbox.gridheight = 2; gbc_HohTlsCheckbox.insets = new Insets(0, 0, 5, 5); gbc_HohTlsCheckbox.gridx = 0; gbc_HohTlsCheckbox.gridy = 0; tlsKeystorePanel.add(myHohTlsCheckbox, gbc_HohTlsCheckbox); myHohTlsCheckbox.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { myConnection.setTls(myHohTlsCheckbox.isSelected()); myTlsCheckbox.setSelected(myHohTlsCheckbox.isSelected()); updatePortsUi(); } }); mylabel_3 = new JLabel("Keystore:"); GridBagConstraints gbc_label_3 = new GridBagConstraints(); gbc_label_3.anchor = GridBagConstraints.WEST; gbc_label_3.fill = GridBagConstraints.VERTICAL; gbc_label_3.insets = new Insets(0, 0, 5, 5); gbc_label_3.gridx = 1; gbc_label_3.gridy = 0; tlsKeystorePanel.add(mylabel_3, gbc_label_3); myHohSecurityKeystoreTextbox = new JTextField(); GridBagConstraints gbc_HohKeystoreTextbox = new GridBagConstraints(); gbc_HohKeystoreTextbox.gridwidth = 2; gbc_HohKeystoreTextbox.anchor = GridBagConstraints.NORTH; gbc_HohKeystoreTextbox.fill = GridBagConstraints.HORIZONTAL; gbc_HohKeystoreTextbox.insets = new Insets(0, 0, 5, 5); gbc_HohKeystoreTextbox.gridx = 2; gbc_HohKeystoreTextbox.gridy = 0; tlsKeystorePanel.add(myHohSecurityKeystoreTextbox, gbc_HohKeystoreTextbox); myHohSecurityKeystoreTextbox.setColumns(10); myHohSecurityKeystoreTextbox.getDocument().addDocumentListener(new SimpleDocumentListener() { @Override public void update(DocumentEvent theE) { String text = myHohSecurityKeystoreTextbox.getText(); myHohSecurityKeyPwTextBox.setEnabled(isNotBlank(text)); myConnection.setTlsKeystoreLocation(text); } }); myHohSecurityKeystoreChooseBtn = new JButton("Choose"); myHohSecurityKeystoreChooseBtn.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { Hl7ConnectionPanel.chooseKeystore(Hl7ConnectionPanel.this, myHohSecurityKeystoreTextbox); } }); myHohSecurityKeystoreChooseBtn.setIcon( new ImageIcon(Hl7ConnectionPanel.class.getResource("/ca/uhn/hl7v2/testpanel/images/open.png"))); GridBagConstraints gbc_HohSignatureKeystoreChooseButton = new GridBagConstraints(); gbc_HohSignatureKeystoreChooseButton.insets = new Insets(0, 0, 5, 0); gbc_HohSignatureKeystoreChooseButton.gridx = 4; gbc_HohSignatureKeystoreChooseButton.gridy = 0; tlsKeystorePanel.add(myHohSecurityKeystoreChooseBtn, gbc_HohSignatureKeystoreChooseButton); mylabel_4 = new JLabel("Store Pass:"); GridBagConstraints gbc_label_4 = new GridBagConstraints(); gbc_label_4.insets = new Insets(0, 0, 0, 5); gbc_label_4.anchor = GridBagConstraints.EAST; gbc_label_4.gridx = 1; gbc_label_4.gridy = 1; tlsKeystorePanel.add(mylabel_4, gbc_label_4); myHohSecurityKeyPwTextBox = new JTextField(); myHohSecurityKeyPwTextBox.getDocument().addDocumentListener(new SimpleDocumentListener() { @Override public void update(DocumentEvent theE) { myConnection.setTlsKeystorePassword(myHohSecurityKeyPwTextBox.getText()); } }); GridBagConstraints gbc_HohSecurityKeyPwTextBox = new GridBagConstraints(); gbc_HohSecurityKeyPwTextBox.insets = new Insets(0, 0, 0, 5); gbc_HohSecurityKeyPwTextBox.fill = GridBagConstraints.HORIZONTAL; gbc_HohSecurityKeyPwTextBox.gridx = 2; gbc_HohSecurityKeyPwTextBox.gridy = 1; tlsKeystorePanel.add(myHohSecurityKeyPwTextBox, gbc_HohSecurityKeyPwTextBox); myHohSecurityKeyPwTextBox.setColumns(10); myHohSecurityProfileKeystoreStatus = new JLabel("Value goes here"); myHohSecurityProfileKeystoreStatus.setHorizontalAlignment(SwingConstants.CENTER); GridBagConstraints gbc_HohSecurityProfileKeystoreStatus = new GridBagConstraints(); gbc_HohSecurityProfileKeystoreStatus.anchor = GridBagConstraints.NORTH; gbc_HohSecurityProfileKeystoreStatus.fill = GridBagConstraints.HORIZONTAL; gbc_HohSecurityProfileKeystoreStatus.gridwidth = 5; gbc_HohSecurityProfileKeystoreStatus.gridx = 0; gbc_HohSecurityProfileKeystoreStatus.gridy = 2; tlsKeystorePanel.add(myHohSecurityProfileKeystoreStatus, gbc_HohSecurityProfileKeystoreStatus); mylabel_9 = new JLabel("Signature Profile"); GridBagConstraints gbc_label_9 = new GridBagConstraints(); gbc_label_9.insets = new Insets(0, 0, 0, 5); gbc_label_9.gridx = 0; gbc_label_9.gridy = 2; myHoHCard.add(mylabel_9, gbc_label_9); mypanel_3 = new JPanel(); mypanel_3.setBorder(new EtchedBorder(EtchedBorder.LOWERED, null, null)); GridBagConstraints gbc_panel_3 = new GridBagConstraints(); gbc_panel_3.fill = GridBagConstraints.BOTH; gbc_panel_3.gridx = 1; gbc_panel_3.gridy = 2; myHoHCard.add(mypanel_3, gbc_panel_3); GridBagLayout gbl_panel_3 = new GridBagLayout(); gbl_panel_3.columnWidths = new int[] { 0, 0, 0, 0, 0, 0, 50, 0, 0 }; gbl_panel_3.rowHeights = new int[] { 0, 0, 0, 0 }; gbl_panel_3.columnWeights = new double[] { 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, Double.MIN_VALUE }; gbl_panel_3.rowWeights = new double[] { 0.0, 0.0, 0.0, Double.MIN_VALUE }; mypanel_3.setLayout(gbl_panel_3); myHohSignatureEnabled = new JCheckBox("Enabled"); myHohSignatureEnabled.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent theE) { myConnection.setHohSignatureEnabled(myHohSignatureEnabled.isSelected()); } }); GridBagConstraints gbc_HohSignatureEnabled = new GridBagConstraints(); gbc_HohSignatureEnabled.insets = new Insets(0, 0, 5, 5); gbc_HohSignatureEnabled.gridx = 0; gbc_HohSignatureEnabled.gridy = 0; mypanel_3.add(myHohSignatureEnabled, gbc_HohSignatureEnabled); mylabel_10 = new JLabel("Keystore:"); GridBagConstraints gbc_label_10 = new GridBagConstraints(); gbc_label_10.anchor = GridBagConstraints.EAST; gbc_label_10.insets = new Insets(0, 0, 5, 5); gbc_label_10.gridx = 1; gbc_label_10.gridy = 0; mypanel_3.add(mylabel_10, gbc_label_10); myHohSignatureKeystoreTextbox = new JTextField(); myHohSignatureKeystoreTextbox.getDocument().addDocumentListener(new SimpleDocumentListener() { @Override public void update(DocumentEvent theE) { myConnection.setHohSignatureKeystore(myHohSignatureKeystoreTextbox.getText()); } }); GridBagConstraints gbc_HohSignatureKeystoreTextbox2 = new GridBagConstraints(); gbc_HohSignatureKeystoreTextbox2.gridwidth = 5; gbc_HohSignatureKeystoreTextbox2.insets = new Insets(0, 0, 5, 5); gbc_HohSignatureKeystoreTextbox2.fill = GridBagConstraints.HORIZONTAL; gbc_HohSignatureKeystoreTextbox2.gridx = 2; gbc_HohSignatureKeystoreTextbox2.gridy = 0; mypanel_3.add(myHohSignatureKeystoreTextbox, gbc_HohSignatureKeystoreTextbox2); myHohSignatureKeystoreTextbox.setColumns(10); myHohSignatureKeystoreChooseButton = new JButton("Choose"); myHohSignatureKeystoreChooseButton.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { Hl7ConnectionPanel.chooseKeystore(Hl7ConnectionPanel.this, myHohSignatureKeystoreTextbox); } }); myHohSignatureKeystoreChooseButton.setIcon( new ImageIcon(Hl7ConnectionPanel.class.getResource("/ca/uhn/hl7v2/testpanel/images/open.png"))); GridBagConstraints gbc_HohSignatureKeystoreChooseButton2 = new GridBagConstraints(); gbc_HohSignatureKeystoreChooseButton2.insets = new Insets(0, 0, 5, 0); gbc_HohSignatureKeystoreChooseButton2.gridx = 7; gbc_HohSignatureKeystoreChooseButton2.gridy = 0; mypanel_3.add(myHohSignatureKeystoreChooseButton, gbc_HohSignatureKeystoreChooseButton2); mylabel_11 = new JLabel("Store Pass:"); GridBagConstraints gbc_label_11 = new GridBagConstraints(); gbc_label_11.anchor = GridBagConstraints.EAST; gbc_label_11.insets = new Insets(0, 0, 5, 5); gbc_label_11.gridx = 1; gbc_label_11.gridy = 1; mypanel_3.add(mylabel_11, gbc_label_11); myHohSignatureKeystorePasswordTextbox = new JTextField(); myHohSignatureKeystorePasswordTextbox.getDocument().addDocumentListener(new SimpleDocumentListener() { @Override public void update(DocumentEvent theE) { myConnection.setHohSignatureKeystorePassword(myHohSignatureKeystorePasswordTextbox.getText()); } }); myHohSignatureKeystorePasswordTextbox.setPreferredSize(new Dimension(100, 28)); myHohSignatureKeystorePasswordTextbox.setMinimumSize(new Dimension(100, 28)); myHohSignatureKeystorePasswordTextbox.setMaximumSize(new Dimension(200, 2147483647)); GridBagConstraints gbc_HohSignatureKeystorePasswordTextbox = new GridBagConstraints(); gbc_HohSignatureKeystorePasswordTextbox.insets = new Insets(0, 0, 5, 5); gbc_HohSignatureKeystorePasswordTextbox.fill = GridBagConstraints.HORIZONTAL; gbc_HohSignatureKeystorePasswordTextbox.gridx = 2; gbc_HohSignatureKeystorePasswordTextbox.gridy = 1; mypanel_3.add(myHohSignatureKeystorePasswordTextbox, gbc_HohSignatureKeystorePasswordTextbox); myHohSignatureKeystorePasswordTextbox.setColumns(10); mylabel_12 = new JLabel("Key:"); GridBagConstraints gbc_label_12 = new GridBagConstraints(); gbc_label_12.anchor = GridBagConstraints.EAST; gbc_label_12.insets = new Insets(0, 0, 5, 5); gbc_label_12.gridx = 3; gbc_label_12.gridy = 1; mypanel_3.add(mylabel_12, gbc_label_12); myHohSignatureKeyAliasCombo = new JComboBox(); myHohSignatureKeyAliasCombo.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent theE) { if (myUpdatingHohSignatureKeyAliasCombo) { return; } String selection = (String) myHohSignatureKeyAliasCombo.getSelectedItem(); if (selection == HOH_SIGNATURE_KEY_USE_ANY_AVAILABLE) { myConnection.setHohSignatureKey(null); } else { myConnection.setHohSignatureKey(selection.replaceAll(" .*", "")); } } }); GridBagConstraints gbc_HohSignatureKeyAliasCombo = new GridBagConstraints(); gbc_HohSignatureKeyAliasCombo.insets = new Insets(0, 0, 5, 5); gbc_HohSignatureKeyAliasCombo.fill = GridBagConstraints.HORIZONTAL; gbc_HohSignatureKeyAliasCombo.gridx = 4; gbc_HohSignatureKeyAliasCombo.gridy = 1; mypanel_3.add(myHohSignatureKeyAliasCombo, gbc_HohSignatureKeyAliasCombo); mylabel_13 = new JLabel("Key Pass:"); GridBagConstraints gbc_label_13 = new GridBagConstraints(); gbc_label_13.anchor = GridBagConstraints.EAST; gbc_label_13.insets = new Insets(0, 0, 5, 5); gbc_label_13.gridx = 5; gbc_label_13.gridy = 1; mypanel_3.add(mylabel_13, gbc_label_13); myHohSignatureKeyPass = new JTextField(); myHohSignatureKeyPass.getDocument().addDocumentListener(new SimpleDocumentListener() { @Override public void update(DocumentEvent theE) { myConnection.setHohSignatureKeyPassword(myHohSignatureKeyPass.getText()); } }); myHohSignatureKeyPass.setMinimumSize(new Dimension(50, 28)); myHohSignatureKeyPass.setMaximumSize(new Dimension(50, 2147483647)); myHohSignatureKeyPass.setPreferredSize(new Dimension(50, 28)); GridBagConstraints gbc_HohSignatureKeyPass = new GridBagConstraints(); gbc_HohSignatureKeyPass.gridwidth = 2; gbc_HohSignatureKeyPass.insets = new Insets(0, 0, 5, 0); gbc_HohSignatureKeyPass.fill = GridBagConstraints.HORIZONTAL; gbc_HohSignatureKeyPass.gridx = 6; gbc_HohSignatureKeyPass.gridy = 1; mypanel_3.add(myHohSignatureKeyPass, gbc_HohSignatureKeyPass); myHohSignatureKeyPass.setColumns(10); myHohSignatureStatusLabel = new JLabel("New label"); myHohSignatureStatusLabel.setHorizontalAlignment(SwingConstants.CENTER); GridBagConstraints gbc_HohSignatureStatusLabel = new GridBagConstraints(); gbc_HohSignatureStatusLabel.fill = GridBagConstraints.HORIZONTAL; gbc_HohSignatureStatusLabel.gridwidth = 8; gbc_HohSignatureStatusLabel.insets = new Insets(0, 0, 0, 5); gbc_HohSignatureStatusLabel.gridx = 0; gbc_HohSignatureStatusLabel.gridy = 2; mypanel_3.add(myHohSignatureStatusLabel, gbc_HohSignatureStatusLabel); init(); }
From source file:edu.harvard.i2b2.query.ui.MainPanel.java
/** * This method is called from within the constructor to initialize the form. *//*from w w w .java 2s . co m*/ private void initComponents() { jAnalysisLabel = new javax.swing.JLabel(); jTimingLabel = new javax.swing.JLabel(); jNameLabel = new javax.swing.JLabel(); jSetSizeLabel = new javax.swing.JLabel(); jNameTextField = new javax.swing.JTextField(); jSetSizeFiled = new javax.swing.JLabel(); jDeleteButton = new javax.swing.JButton(); jScrollPane1 = new GroupPanel("Group 1", this); jRunQueryButton = new javax.swing.JButton(); jCancelButton = new javax.swing.JButton(); jClearGroupsButton = new javax.swing.JButton(); jScrollPane2 = new GroupPanel("Group 2", this); jScrollPane3 = new GroupPanel("Group 3", this); jScrollPane4 = new javax.swing.JScrollPane(); jPanel1 = new javax.swing.JPanel(); // jVisitComboBox = new javax.swing.JComboBox(); jAndOrLabel1 = new javax.swing.JLabel(); jAndOrLabel2 = new javax.swing.JLabel(); jMorePanelsButton = new javax.swing.JButton(); jWorkflowToolBar = new javax.swing.JToolBar(); // jTimelineToggleButton = new javax.swing.JToggleButton(); jPatientCountToggleButton = new javax.swing.JToggleButton(); // jPatientSetToggleButton = new javax.swing.JToggleButton(); jToolbarPanel = new javax.swing.JPanel(); jQueryNamePanel = new javax.swing.JPanel(); // jOptionsScrollPane = new javax.swing.JScrollPane(); jOptionsPanel = new AnalysisPanel(); jTimingPanel = new TimingPanel(this.dataModel); jShowTimelineCheckBox = new javax.swing.JCheckBox(); jGetAllPatientsCheckBox = new javax.swing.JCheckBox(); // jGetPatientCountCheckBox = new javax.swing.JCheckBox(); // jGetPatientSetCheckBox = new javax.swing.JCheckBox(); setLayout(null); // jScrollPane4.setHorizontalScrollBarPolicy(javax.swing. // ScrollPaneConstants.HORIZONTAL_SCROLLBAR_ALWAYS); jPanel1.setLayout(null); jPanel1.add(jScrollPane1); jScrollPane1.setBounds(0, 0, 180, 200); jPanel1.add(jScrollPane2); jScrollPane2.setBounds(185, 0, 180, 200); jPanel1.add(jScrollPane3); jScrollPane3.setBounds(370, 0, 180, 200); // jAndOrLabel1.setHorizontalAlignment(javax.swing.SwingConstants.CENTER) // ; jAndOrLabel1.setText("and"); // jAndOrLabel1.setBorder(javax.swing.BorderFactory.createEtchedBorder()) // ; // jPanel1.add(jAndOrLabel1); // jAndOrLabel1.setBounds(190, 90, 30, 18); // jAndOrLabel2.setHorizontalAlignment(javax.swing.SwingConstants.CENTER) // ; // jAndOrLabel2.setText("and"); // jAndOrLabel2.setBorder(javax.swing.BorderFactory.createEtchedBorder()) // ; // jPanel1.add(jAndOrLabel2); // jAndOrLabel2.setBounds(410, 90, 30, 18); jQueryNamePanel.setLayout(null); jQueryNamePanel.setBorder(javax.swing.BorderFactory.createEtchedBorder()); jNameLabel.setText(" Query Name: "); jNameLabel.setToolTipText("You may drag this item to workplace to save the query definition"); jNameLabel.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0))); jNameLabel.setBounds(2, 2, 70, 23); add(jNameLabel); // jQueryNamePanel.add(jNameLabel); jNameLabel.setTransferHandler(new NameLabelTextHandler()); jNameLabel.addMouseListener(new DragMouseAdapter()); jNameLabel.addMouseMotionListener(new java.awt.event.MouseMotionAdapter() { public void mouseMoved(java.awt.event.MouseEvent evt) { jNameLabelMouseMoved(evt); } }); jNameLabel.addMouseListener(new java.awt.event.MouseAdapter() { public void mouseExited(java.awt.event.MouseEvent evt) { jNameLabelMouseExited(evt); } }); jNameTextField.setText(""); jNameTextField.setBounds(95, 10, 370, 20); jNameTextField.setEditable(false); jNameTextField.setDragEnabled(true); jNameTextField.setTransferHandler(new TransferHandler("Text")); // jQueryNamePanel.add(jNameTextField); // add(jNameTextField); // add(jQueryNamePanel); // jQueryNamePanel.setBounds(5, 5, 400, 50); jClearGroupsButton.setFont(new java.awt.Font("Tahoma", 1, 10)); jClearGroupsButton.setText("X"); jClearGroupsButton.setHorizontalAlignment(javax.swing.SwingConstants.LEFT); jClearGroupsButton.setHorizontalTextPosition(javax.swing.SwingConstants.LEFT); jClearGroupsButton.setMargin(new java.awt.Insets(2, 2, 2, 2)); jClearGroupsButton.setToolTipText("Reset all panels"); if (System.getProperty("os.name").toLowerCase().indexOf("mac") > -1) { jClearGroupsButton.setMargin(new java.awt.Insets(-10, -15, -10, -20)); } jClearGroupsButton.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jClearGroupsButtonActionPerformed(evt); } }); jClearGroupsButton.setBounds(600, 10, 30, 20); add(jClearGroupsButton); jAnalysisLabel.setText("Analysis Types"); // jAnalysisLabel.setBackground(Color.WHITE); // jAnalysisLabel.setOpaque(true); jAnalysisLabel.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0))); jAnalysisLabel.setBounds(2, 2, 120, 23); jAnalysisLabel.setHorizontalAlignment(javax.swing.SwingConstants.CENTER); jAnalysisLabel.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER); add(jAnalysisLabel); jPanel1.setPreferredSize(new Dimension(700, 150)); jScrollPane4.setViewportView(jPanel1); add(jScrollPane4); jScrollPane4.setBounds(20, 35, 635, 220); jScrollPane4.setHorizontalScrollBarPolicy(javax.swing.ScrollPaneConstants.HORIZONTAL_SCROLLBAR_ALWAYS); jScrollPane4.setVerticalScrollBarPolicy(javax.swing.ScrollPaneConstants.VERTICAL_SCROLLBAR_NEVER); // jScrollPane4.setBorder(javax.swing.BorderFactory // .createLineBorder(new java.awt.Color(0, 0, 0))); jCancelButton.setText("Cancel"); jCancelButton.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jCancelButtonActionPerformed(evt); } }); // add(jCancelButton); // jCancelButton.setBounds(20, 255, 90, 23); // jCancelButton.setFont(new Font("Tahoma", Font.PLAIN, 10)); jGetAllPatientsCheckBox.setText("Get Everyone"); jGetAllPatientsCheckBox.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0))); // jGetAllPatientsCheckBox // .setBorder(new javax.swing.border.SoftBevelBorder( // javax.swing.border.BevelBorder.RAISED)); jGetAllPatientsCheckBox.setBorderPainted(true); jGetAllPatientsCheckBox.setContentAreaFilled(false); jGetAllPatientsCheckBox.setHorizontalAlignment(javax.swing.SwingConstants.CENTER); jGetAllPatientsCheckBox.setHorizontalTextPosition(javax.swing.SwingConstants.RIGHT); jGetAllPatientsCheckBox.setMargin(new java.awt.Insets(0, 0, 0, 0)); jGetAllPatientsCheckBox.setToolTipText("Get all the patients in datamart"); add(jGetAllPatientsCheckBox); jGetAllPatientsCheckBox.setBounds(5, 255, 110, 15); jGetAllPatientsCheckBox.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jGetAllPatientsCheckBoxActionPerformed(evt); } }); jRunQueryButton.setText("Run Query Above"); jRunQueryButton.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jRunQueryButtonActionPerformed(evt); } }); add(jRunQueryButton); jRunQueryButton.setBounds(100, 255, 625, 23); jSetSizeLabel.setText(" Patient(s) returned:"); add(jSetSizeLabel); jSetSizeLabel.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0))); jSetSizeLabel.setBounds(20, 275, 70, 23); // jSetSizeFiled.setText(" subjects"); // jSetSizeFiled.setEditable(false); // jSetSizeFiled.setHorizontalAlignment(SwingConstants.LEFT); // add(jSetSizeFiled); // jSetSizeLabel.setBounds(20, 275, 70, 23); jToolbarPanel.setLayout(new java.awt.BorderLayout()); // jWorkflowToolBar.setRollover(true); // jWorkflowToolBar.setInheritsPopupMenu(true); // jTimelineToggleButton // .setIcon(new javax.swing.ImageIcon( // "C:\\Documents and Settings\\wp066\\My Documents\\icons\\wb16.gif")); // /jTimelineToggleButton.setText("Show TimeLine"); // jTimelineToggleButton.setFocusPainted(false); // jWorkflowToolBar.add(jTimelineToggleButton); jPatientCountToggleButton.setIcon( new javax.swing.ImageIcon("C:\\Documents and Settings\\wp066\\My Documents\\icons\\wb16.gif")); jPatientCountToggleButton.setText("Get Patient Count"); jPatientCountToggleButton.setFocusPainted(false); jWorkflowToolBar.add(jPatientCountToggleButton); // jPatientSetToggleButton // .setIcon(new javax.swing.ImageIcon( // "C:\\Documents and Settings\\wp066\\My Documents\\icons\\wb16.gif")); // jPatientSetToggleButton.setText("Get Patient Set"); // jPatientSetToggleButton.setFocusPainted(false); // jWorkflowToolBar.add(jPatientSetToggleButton); jWorkflowToolBar.setPreferredSize(new Dimension(380, 40)); jToolbarPanel.add(jWorkflowToolBar, java.awt.BorderLayout.PAGE_START); jToolbarPanel.add(jWorkflowToolBar, java.awt.BorderLayout.CENTER); // add(jToolbarPanel); jToolbarPanel.setBounds(20, 130, 240, 23); jMorePanelsButton.setText("<html><center>Add<br>" + "<left>Group"); jMorePanelsButton.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jMorePanelsButtonActionPerformed(evt); } }); // add(jMorePanelsButton); // jMorePanelsButton.setBounds(655, 35, 60, 220); jPanel1.add(jMorePanelsButton); jMorePanelsButton.setBounds(550, 0, 60, 200); // jOptionsPanel.setLayout(null); // jOptionsScrollPane.setBorder(javax.swing.BorderFactory // .createEtchedBorder()); // jOptionsPanel.setPreferredSize(new java.awt.Dimension(100, 100)); jShowTimelineCheckBox.setText("Timeline"); jShowTimelineCheckBox.setBorder(javax.swing.BorderFactory.createEmptyBorder(0, 0, 0, 0)); jShowTimelineCheckBox.setMargin(new java.awt.Insets(0, 0, 0, 0)); jShowTimelineCheckBox.setToolTipText("Get the patient set and display it in timeline view"); // jOptionsPanel.add(jShowTimelineCheckBox); jShowTimelineCheckBox.setBounds(5, 20, 110, 15); // jGetPatientCountCheckBox.setText("Patient Count"); // jGetPatientCountCheckBox.setBorder(javax.swing.BorderFactory // .createEmptyBorder(0, 0, 0, 0)); // jGetPatientCountCheckBox.setMargin(new java.awt.Insets(0, 0, 0, 0)); // jGetPatientCountCheckBox.setToolTipText("Get the patient count XML"); // jOptionsPanel.add(jGetPatientCountCheckBox); // jGetPatientCountCheckBox.setBounds(5, 50, 110, 15); // jGetPatientSetCheckBox.setText("Patient Set"); // jGetPatientSetCheckBox.setBorder(javax.swing.BorderFactory // .createEmptyBorder(0, 0, 0, 0)); // jGetPatientSetCheckBox.setMargin(new java.awt.Insets(0, 0, 0, 0)); // jOptionsPanel.add(jGetPatientSetCheckBox); // jGetPatientSetCheckBox.setBounds(10, 80, 80, 15); // jOptionsScrollPane.setViewportView(jOptionsPanel); add(jOptionsPanel); jOptionsPanel.setBounds(500, 30, 120, 120); jTimingLabel.setText("Query Timing"); // jAnalysisLabel.setBackground(Color.WHITE); // jAnalysisLabel.setOpaque(true); jTimingLabel.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0))); jTimingLabel.setBounds(2, 2, 120, 23); jTimingLabel.setHorizontalAlignment(javax.swing.SwingConstants.CENTER); jTimingLabel.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER); add(jTimingLabel); jTimingLabel.setBounds(500, 30, 120, 120); add(jTimingPanel); jTimingPanel.setBounds(500, 122, 120, 70); /* * jDeleteButton.setText("Delete"); jDeleteButton.addActionListener(new * java.awt.event.ActionListener() { public void * actionPerformed(java.awt.event.ActionEvent evt) { * jDeleteButtonActionPerformed(evt); } }); * * jVisitComboBox.setModel(new javax.swing.DefaultComboBoxModel(new * String[] { "Groups don't have to occur in the same visit", "Groups * must all occur in the same visit" })); add(jVisitComboBox); * jVisitComboBox.setBounds(20, 40, 240, 22); * * //add(jDeleteButton); //jDeleteButton.setBounds(20, 10, 65, 23); * * add(jScrollPane1); jScrollPane1.setBounds(20, 70, 170, 320); * * jRunQueryButton.setText("Run Query"); * jRunQueryButton.addActionListener(new java.awt.event.ActionListener() * { public void actionPerformed(java.awt.event.ActionEvent evt) { * jRunQueryButtonActionPerformed(evt); } }); * * add(jRunQueryButton); jRunQueryButton.setBounds(20, 10, 87, 23); * * jCancelButton.setText("Remove All"); * jCancelButton.addActionListener(new java.awt.event.ActionListener() { * public void actionPerformed(java.awt.event.ActionEvent evt) { * jRemoveAllButtonActionPerformed(evt); } }); * * add(jCancelButton); jCancelButton.setBounds(115, 10, 90, 23); * * //jScrollPane4.setHorizontalScrollBarPolicy(javax.swing. * ScrollPaneConstants.HORIZONTAL_SCROLLBAR_ALWAYS); * jPanel1.setLayout(null); * jScrollPane4.getHorizontalScrollBar().setUnitIncrement(20); * //jPanel1.setVisible(false); * * //jScrollPane1.setToolTipText("scrollpane 1"); * jPanel1.add(jScrollPane1); jScrollPane1.setBounds(0, 0, 170, 350); * * jPanel1.add(jScrollPane2); jScrollPane2.setBounds(210, 0, 170, 350); */ jAndOrLabel1.setBackground(new java.awt.Color(255, 255, 255)); jAndOrLabel1.setHorizontalAlignment(javax.swing.SwingConstants.CENTER); jAndOrLabel1.setText("and"); jAndOrLabel1.setToolTipText("Click to change the relationship"); jAndOrLabel1.setBorder(javax.swing.BorderFactory.createEtchedBorder()); jAndOrLabel1.addMouseListener(new java.awt.event.MouseAdapter() { @Override public void mouseClicked(java.awt.event.MouseEvent evt) { jAndOrLabel1MouseClicked(evt); } }); // jPanel1.add(jAndOrLabel1); jAndOrLabel2.setHorizontalAlignment(javax.swing.SwingConstants.CENTER); jAndOrLabel2.setText("and"); jAndOrLabel2.setToolTipText("Click to change the relationship"); jAndOrLabel2.setBorder(javax.swing.BorderFactory.createEtchedBorder()); jAndOrLabel2.addMouseListener(new java.awt.event.MouseAdapter() { @Override public void mouseClicked(java.awt.event.MouseEvent evt) { jAndOrLabel2MouseClicked(evt); } }); // jPanel1.add(jAndOrLabel2); // jTree1.addTreeWillExpandListener(this); // jTree1.addTreeExpansionListener(this); // jScrollPane1.setViewportView(new QueryConceptTreePanel("Group 1")); // jScrollPane1.setToolTipText("Double click on a folder to view the // items inside"); // jTree2.addTreeExpansionListener(this); // jScrollPane2.setViewportView(new QueryConceptTreePanel("Group 2")); // jTree3.addTreeExpansionListener(this); // treepanel = new QueryConceptTreePanel("", this); // jScrollPane3.setViewportView(new QueryConceptTreePanel("Group 3")); // jSlider1.setMajorTickSpacing(20); /* * jSlider1.setPaintTicks(true); jSlider1.setValue(0); * jSlider1.setMinorTickSpacing(10); jSlider1.setToolTipText("Slider on * left is more Sensitive Query, " + "on right is more Specific"); * add(jSlider1); jSlider1.setBounds(380, 40, 140, 18); * * //jLabel1.setFont(new java.awt.Font("Tahoma", 1, 11)); * jLabel1.setHorizontalAlignment(javax.swing.SwingConstants.TRAILING); * jLabel1.setText("Sensitivity <"); add(jLabel1); * jLabel1.setBounds(290, 40, 80, 20); * * //jLabel2.setFont(new java.awt.Font("Tahoma", 1, 11)); * jLabel2.setText("> Specificity"); add(jLabel2); * jLabel2.setBounds(525, 40, 70, 20); */ dataModel.addPanel(jScrollPane1, null, 0); dataModel.addPanel(jScrollPane2, jAndOrLabel1, 0); dataModel.addPanel(jScrollPane3, jAndOrLabel2, 555); }
From source file:com.francetelecom.rd.dashboard.pc.DashboardPC.java
private void initDashboardWithRules() { // get existing rules and display them try {// ww w .ja va 2 s . c om Rule[] ruleList = busConnector.getAllRules(); for (int i = 0; i < ruleList.length; i++) { if (!ruleList[i].isPrivate()) addRulePanelToDashboard(ruleList[i].getId()); } } catch (HomeBusException e) { logger.error("Could not retrieve bus rules : " + e.getMessage()); e.printStackTrace(); } // small add rule panel init JPanel panelAddRule = new JPanel(); panelAddRule.setBorder(new EtchedBorder(EtchedBorder.LOWERED, null, null)); panelAddRule.setLayout(null); JLabel addRuleLbl = new JLabel("Configure new rule"); addRuleLbl.setHorizontalAlignment(SwingConstants.CENTER); addRuleLbl.setForeground(new Color(169, 169, 169)); addRuleLbl.setFont(new Font("Arial", Font.BOLD, 13)); addRuleLbl.setBounds(10, 25, 229, 27); panelAddRule.add(addRuleLbl); JButton addRuleBtn = new JButton("+"); addRuleBtn.setForeground(new Color(128, 128, 128)); addRuleBtn.setBounds(100, 57, 41, 23); panelAddRule.add(addRuleBtn); rulesContent.add(panelAddRule); myRulePanelMap.put("0", panelAddRule); updateRuleListDisplay(); // add panel elements : photo, service friendly name, IF label, condition parameter JPanel panelRule1 = new JPanel(); panelRule1.setBorder(new EtchedBorder(EtchedBorder.LOWERED, null, null)); panelRule1.setLayout(null); JPanel rulePanelServicePhoto1 = new JPanel(); rulePanelServicePhoto1.setBorder(new EtchedBorder(EtchedBorder.LOWERED, null, null)); rulePanelServicePhoto1.setBounds(10, 16, 27, 27); panelRule1.add(rulePanelServicePhoto1); String serviceName1 = "Visio TV"; JLabel ruleLblServiceName1 = new JLabel(serviceName1); ruleLblServiceName1.setFont(new Font("Arial", Font.BOLD, 15)); ruleLblServiceName1.setForeground(new Color(100, 149, 237)); ruleLblServiceName1.setBounds(47, 11, 212, 18); panelRule1.add(ruleLblServiceName1); String serviceDeviceOwner1 = "Set-top Box"; JLabel ruleLblOnDevice1 = new JLabel("on " + serviceDeviceOwner1); ruleLblOnDevice1.setForeground(Color.GRAY); ruleLblOnDevice1.setFont(new Font("Arial", Font.PLAIN, 11)); ruleLblOnDevice1.setBounds(47, 29, 212, 14); panelRule1.add(ruleLblOnDevice1); JLabel ruleLblIf1 = new JLabel("IF"); ruleLblIf1.setForeground(Color.GRAY); ruleLblIf1.setFont(new Font("Arial", Font.BOLD, 30)); ruleLblIf1.setBounds(10, 49, 27, 35); panelRule1.add(ruleLblIf1); // condition String condition1 = "IncomingVoIP" + " = " + "true"; JLabel ruleLblConditionParam1 = new JLabel(condition1); ruleLblConditionParam1.setFont(new Font("Arial", Font.BOLD, 13)); ruleLblConditionParam1.setForeground(Color.GRAY); ruleLblConditionParam1.setBounds(47, 49, 192, 35); panelRule1.add(ruleLblConditionParam1); myRulePanelMap.put("1", panelRule1); rulesContent.add(panelRule1); // add panel elements : photo, service friendly name, IF label, condition parameter JPanel panelRule2 = new JPanel(); panelRule2.setBorder(new EtchedBorder(EtchedBorder.LOWERED, null, null)); panelRule2.setLayout(null); JPanel rulePanelServicePhoto2 = new JPanel(); rulePanelServicePhoto2.setBorder(new EtchedBorder(EtchedBorder.LOWERED, null, null)); rulePanelServicePhoto2.setBounds(10, 16, 27, 27); panelRule2.add(rulePanelServicePhoto2); String serviceName2 = "Wi-Fi Off"; JLabel ruleLblServiceName2 = new JLabel(serviceName2); ruleLblServiceName2.setFont(new Font("Arial", Font.BOLD, 15)); ruleLblServiceName2.setForeground(new Color(100, 149, 237)); ruleLblServiceName2.setBounds(47, 11, 212, 18); panelRule2.add(ruleLblServiceName2); String serviceDeviceOwner2 = "Livebox"; JLabel ruleLblOnDevice2 = new JLabel("on " + serviceDeviceOwner2); ruleLblOnDevice2.setForeground(Color.GRAY); ruleLblOnDevice2.setFont(new Font("Arial", Font.PLAIN, 11)); ruleLblOnDevice2.setBounds(47, 29, 212, 14); panelRule2.add(ruleLblOnDevice2); JLabel ruleLblIf2 = new JLabel("IF"); ruleLblIf2.setForeground(Color.GRAY); ruleLblIf2.setFont(new Font("Arial", Font.BOLD, 30)); ruleLblIf2.setBounds(10, 49, 27, 35); panelRule2.add(ruleLblIf2); // condition String condition2 = "Absence" + " = " + "true"; JLabel ruleLblConditionParam2 = new JLabel(condition2); ruleLblConditionParam2.setFont(new Font("Arial", Font.BOLD, 13)); ruleLblConditionParam2.setForeground(Color.GRAY); ruleLblConditionParam2.setBounds(47, 49, 192, 35); panelRule2.add(ruleLblConditionParam2); myRulePanelMap.put("2", panelRule2); rulesContent.add(panelRule2); updateRuleListDisplay(); busConnector.addRuleDefinitionsListener(this); }
From source file:net.java.sip.communicator.impl.gui.main.chat.ChatPanel.java
/** * Sets the chat session to associate to this chat panel. * @param chatSession the chat session to associate to this chat panel *///from w w w .j a v a 2s . com public void setChatSession(ChatSession chatSession) { if (this.chatSession != null) { // remove old listener this.chatSession.removeChatTransportChangeListener(this); } this.chatSession = chatSession; this.chatSession.addChatTransportChangeListener(this); if ((this.chatSession != null) && this.chatSession.isContactListSupported()) { topPanel.remove(conversationPanelContainer); TransparentPanel rightPanel = new TransparentPanel(new BorderLayout()); Dimension chatConferencesListsPanelSize = new Dimension(150, 25); Dimension chatContactsListsPanelSize = new Dimension(150, 175); Dimension rightPanelSize = new Dimension(150, 200); rightPanel.setMinimumSize(rightPanelSize); rightPanel.setPreferredSize(rightPanelSize); TransparentPanel contactsPanel = new TransparentPanel(new BorderLayout()); contactsPanel.setMinimumSize(chatContactsListsPanelSize); contactsPanel.setPreferredSize(chatContactsListsPanelSize); conferencePanel.setMinimumSize(chatConferencesListsPanelSize); conferencePanel.setPreferredSize(chatConferencesListsPanelSize); this.chatContactListPanel = new ChatRoomMemberListPanel(this); this.chatContactListPanel.setOpaque(false); topSplitPane = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT); topSplitPane.setBorder(null); // remove default borders topSplitPane.setOneTouchExpandable(true); topSplitPane.setOpaque(false); topSplitPane.setResizeWeight(1.0D); Color msgNameBackground = Color.decode(ChatHtmlUtils.MSG_NAME_BACKGROUND); // add border to the divider if (topSplitPane.getUI() instanceof BasicSplitPaneUI) { ((BasicSplitPaneUI) topSplitPane.getUI()).getDivider() .setBorder(BorderFactory.createLineBorder(msgNameBackground)); } ChatTransport chatTransport = chatSession.getCurrentChatTransport(); JPanel localUserLabelPanel = new JPanel(new BorderLayout()); JLabel localUserLabel = new JLabel(chatTransport.getProtocolProvider().getAccountID().getDisplayName()); localUserLabel.setFont(localUserLabel.getFont().deriveFont(Font.BOLD)); localUserLabel.setHorizontalAlignment(SwingConstants.CENTER); localUserLabel.setBorder(BorderFactory.createEmptyBorder(2, 0, 3, 0)); localUserLabel.setForeground(Color.decode(ChatHtmlUtils.MSG_IN_NAME_FOREGROUND)); localUserLabelPanel.add(localUserLabel, BorderLayout.CENTER); localUserLabelPanel.setBackground(msgNameBackground); JButton joinConference = new JButton( GuiActivator.getResources().getI18NString("service.gui.JOIN_VIDEO")); joinConference.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent arg0) { showChatConferenceDialog(); } }); contactsPanel.add(localUserLabelPanel, BorderLayout.NORTH); contactsPanel.add(chatContactListPanel, BorderLayout.CENTER); conferencePanel.add(joinConference, BorderLayout.CENTER); rightPanel.add(conferencePanel, BorderLayout.NORTH); rightPanel.add(contactsPanel, BorderLayout.CENTER); topSplitPane.setLeftComponent(conversationPanelContainer); topSplitPane.setRightComponent(rightPanel); topPanel.add(topSplitPane); } else { if (topSplitPane != null) { if (chatContactListPanel != null) { topSplitPane.remove(chatContactListPanel); chatContactListPanel = null; } this.messagePane.remove(topSplitPane); topSplitPane = null; } topPanel.add(conversationPanelContainer); } if (chatSession instanceof MetaContactChatSession) { // The subject panel is added here, because it's specific for the // multi user chat and is not contained in the single chat chat panel. if (subjectPanel != null) { this.remove(subjectPanel); subjectPanel = null; this.revalidate(); this.repaint(); } writeMessagePanel.initPluginComponents(); writeMessagePanel.setTransportSelectorBoxVisible(true); //Enables to change the protocol provider by simply pressing the // CTRL-P key combination ActionMap amap = this.getActionMap(); amap.put("ChangeProtocol", new ChangeTransportAction()); InputMap imap = this.getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW); imap.put(KeyStroke.getKeyStroke(KeyEvent.VK_P, KeyEvent.CTRL_DOWN_MASK), "ChangeProtocol"); } else if (chatSession instanceof ConferenceChatSession) { ConferenceChatSession confSession = (ConferenceChatSession) chatSession; writeMessagePanel.setTransportSelectorBoxVisible(false); confSession.addLocalUserRoleListener(this); confSession.addMemberRoleListener(this); ChatRoom room = ((ChatRoomWrapper) chatSession.getDescriptor()).getChatRoom(); room.addMemberPropertyChangeListener(this); setConferencesPanelVisible(room.getCachedConferenceDescriptionSize() > 0); subjectPanel = new ChatRoomSubjectPanel((ConferenceChatSession) chatSession); // The subject panel is added here, because it's specific for the // multi user chat and is not contained in the single chat chat panel. this.add(subjectPanel, BorderLayout.NORTH); this.revalidate(); this.repaint(); } if (chatContactListPanel != null) { // Initialize chat participants' panel. Iterator<ChatContact<?>> chatParticipants = chatSession.getParticipants(); while (chatParticipants.hasNext()) chatContactListPanel.addContact(chatParticipants.next()); } }
From source file:com.ga.forms.DailyLogAddUI.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.c o m */ @SuppressWarnings("unchecked") // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents private void initComponents() { group = new javax.swing.ButtonGroup(); jPanel1 = new javax.swing.JPanel(); mainTitleLbl = new javax.swing.JLabel(); jSeparator1 = new javax.swing.JSeparator(); exitButton = new javax.swing.JButton(); viewButton = new javax.swing.JButton(); dailyLogPanel = new javax.swing.JPanel(); dateLbl = new javax.swing.JLabel(); dateDisplayLbl = new javax.swing.JLabel(); dayLbl = new javax.swing.JLabel(); dayDisplayLbl = new javax.swing.JLabel(); checkInLbl = new javax.swing.JLabel(); checkoutLbl = new javax.swing.JLabel(); breakLbl = new javax.swing.JLabel(); checkInTimeCombo = new javax.swing.JComboBox(); checkOutTimeCombo = new javax.swing.JComboBox(); checkInOutButton = new javax.swing.JToggleButton(); breakOptionPanel = new javax.swing.JPanel(); yesRdButton = new javax.swing.JRadioButton(); noRdButton = new javax.swing.JRadioButton(); customRdButton = new javax.swing.JRadioButton(); customBreakTimeTextField = new javax.swing.JTextField(); setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE); setTitle("Daily Log Manager"); setBounds(new java.awt.Rectangle(0, 0, 395, 389)); setCursor(new java.awt.Cursor(java.awt.Cursor.DEFAULT_CURSOR)); setMinimumSize(new java.awt.Dimension(395, 389)); jPanel1.setMaximumSize(new java.awt.Dimension(395, 389)); jPanel1.setMinimumSize(new java.awt.Dimension(395, 389)); jPanel1.setPreferredSize(new java.awt.Dimension(464, 474)); mainTitleLbl.setFont(new java.awt.Font("Arial", 0, 36)); // NOI18N mainTitleLbl.setHorizontalAlignment(javax.swing.SwingConstants.CENTER); mainTitleLbl.setText("Daily Log Manager"); mainTitleLbl.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER); exitButton.setText("Exit"); exitButton.setMaximumSize(new java.awt.Dimension(72, 29)); exitButton.setMinimumSize(new java.awt.Dimension(72, 29)); exitButton.setPreferredSize(new java.awt.Dimension(72, 29)); exitButton.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { exitButtonActionPerformed(evt); } }); viewButton.setText("View"); viewButton.setMaximumSize(new java.awt.Dimension(72, 29)); viewButton.setMinimumSize(new java.awt.Dimension(72, 29)); viewButton.setPreferredSize(new java.awt.Dimension(72, 29)); viewButton.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { viewButtonActionPerformed(evt); } }); dailyLogPanel.setBorder(javax.swing.BorderFactory.createTitledBorder("Add Daily Log")); dailyLogPanel.setFont(new java.awt.Font("Arial", 0, 15)); // NOI18N dailyLogPanel.setName("Daily Log Entry"); // NOI18N dailyLogPanel.setPreferredSize(new java.awt.Dimension(240, 190)); dateLbl.setFont(new java.awt.Font("Arial", 0, 15)); // NOI18N dateLbl.setText("Date"); dateLbl.setPreferredSize(new java.awt.Dimension(56, 17)); dateDisplayLbl.setFont(new java.awt.Font("Arial", 0, 15)); // NOI18N dateDisplayLbl.setEnabled(false); dateDisplayLbl.setMaximumSize(new java.awt.Dimension(144, 17)); dateDisplayLbl.setMinimumSize(new java.awt.Dimension(144, 17)); dateDisplayLbl.setPreferredSize(new java.awt.Dimension(144, 17)); dateDisplayLbl.setRequestFocusEnabled(false); dayLbl.setFont(new java.awt.Font("Arial", 0, 15)); // NOI18N dayLbl.setText("Day"); dayLbl.setPreferredSize(new java.awt.Dimension(56, 17)); dayDisplayLbl.setFont(new java.awt.Font("Arial", 0, 15)); // NOI18N dayDisplayLbl.setEnabled(false); dayDisplayLbl.setMaximumSize(new java.awt.Dimension(144, 17)); dayDisplayLbl.setMinimumSize(new java.awt.Dimension(144, 17)); dayDisplayLbl.setPreferredSize(new java.awt.Dimension(144, 17)); dayDisplayLbl.setRequestFocusEnabled(false); checkInLbl.setFont(new java.awt.Font("Arial", 0, 15)); // NOI18N checkInLbl.setText("In"); checkInLbl.setPreferredSize(new java.awt.Dimension(56, 17)); checkoutLbl.setFont(new java.awt.Font("Arial", 0, 15)); // NOI18N checkoutLbl.setText("Out"); checkoutLbl.setPreferredSize(new java.awt.Dimension(56, 17)); breakLbl.setFont(new java.awt.Font("Arial", 0, 15)); // NOI18N breakLbl.setText("Break"); breakLbl.setVerticalAlignment(javax.swing.SwingConstants.TOP); breakLbl.setPreferredSize(new java.awt.Dimension(56, 17)); checkInTimeCombo.setModel( new javax.swing.DefaultComboBoxModel(new String[] { "Item 1", "Item 2", "Item 3", "Item 4" })); checkInTimeCombo.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { checkInTimeComboActionPerformed(evt); } }); checkOutTimeCombo.setModel( new javax.swing.DefaultComboBoxModel(new String[] { "Item 1", "Item 2", "Item 3", "Item 4" })); checkOutTimeCombo.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { checkOutTimeComboActionPerformed(evt); } }); checkInOutButton.setFont(new java.awt.Font("Arial", 0, 15)); // NOI18N checkInOutButton.setText("Check In"); checkInOutButton.setMaximumSize(new java.awt.Dimension(102, 29)); checkInOutButton.setMinimumSize(new java.awt.Dimension(102, 29)); checkInOutButton.setPreferredSize(new java.awt.Dimension(102, 29)); checkInOutButton.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { checkInOutButtonActionPerformed(evt); } }); breakOptionPanel.setBorder(javax.swing.BorderFactory.createTitledBorder("Options")); breakOptionPanel.setPreferredSize(new java.awt.Dimension(255, 98)); yesRdButton.setFont(new java.awt.Font("Arial", 0, 15)); // NOI18N yesRdButton.setText("Yes"); yesRdButton.addMouseListener(new java.awt.event.MouseAdapter() { public void mouseClicked(java.awt.event.MouseEvent evt) { yesRdButtonMouseClicked(evt); } }); noRdButton.setFont(new java.awt.Font("Arial", 0, 15)); // NOI18N noRdButton.setSelected(true); noRdButton.setText("No"); noRdButton.setPreferredSize(new java.awt.Dimension(51, 24)); noRdButton.addMouseListener(new java.awt.event.MouseAdapter() { public void mouseClicked(java.awt.event.MouseEvent evt) { noRdButtonMouseClicked(evt); } }); customRdButton.setFont(new java.awt.Font("Arial", 0, 15)); // NOI18N customRdButton.setText("Custom"); customRdButton.addItemListener(new java.awt.event.ItemListener() { public void itemStateChanged(java.awt.event.ItemEvent evt) { customRdButtonItemStateChanged(evt); } }); customRdButton.addChangeListener(new javax.swing.event.ChangeListener() { public void stateChanged(javax.swing.event.ChangeEvent evt) { customRdButtonStateChanged(evt); } }); customRdButton.addMouseListener(new java.awt.event.MouseAdapter() { public void mouseClicked(java.awt.event.MouseEvent evt) { customRdButtonMouseClicked(evt); } }); customBreakTimeTextField.setText("00:30"); customBreakTimeTextField.setEnabled(false); javax.swing.GroupLayout breakOptionPanelLayout = new javax.swing.GroupLayout(breakOptionPanel); breakOptionPanel.setLayout(breakOptionPanelLayout); breakOptionPanelLayout.setHorizontalGroup(breakOptionPanelLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(breakOptionPanelLayout.createSequentialGroup().addGap(5, 5, 5) .addGroup(breakOptionPanelLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(customBreakTimeTextField, javax.swing.GroupLayout.Alignment.TRAILING) .addGroup(breakOptionPanelLayout.createSequentialGroup().addComponent(yesRdButton) .addGap(5, 5, 5) .addComponent(noRdButton, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(5, 5, 5).addComponent(customRdButton) .addGap(0, 0, Short.MAX_VALUE))) .addContainerGap())); breakOptionPanelLayout.setVerticalGroup(breakOptionPanelLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(breakOptionPanelLayout.createSequentialGroup().addGap(5, 5, 5) .addGroup(breakOptionPanelLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(yesRdButton) .addComponent(noRdButton, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(customRdButton)) .addGap(5, 5, 5).addComponent(customBreakTimeTextField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))); yesRdButton.getAccessibleContext().setAccessibleName("breakRdButton"); noRdButton.getAccessibleContext().setAccessibleName("breakRdButton"); customRdButton.getAccessibleContext().setAccessibleName("breakRdButton"); customBreakTimeTextField.getAccessibleContext().setAccessibleName("customBreakTimeTextField"); javax.swing.GroupLayout dailyLogPanelLayout = new javax.swing.GroupLayout(dailyLogPanel); dailyLogPanel.setLayout(dailyLogPanelLayout); dailyLogPanelLayout.setHorizontalGroup(dailyLogPanelLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(dailyLogPanelLayout.createSequentialGroup().addContainerGap().addGroup(dailyLogPanelLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, dailyLogPanelLayout.createSequentialGroup().addGroup(dailyLogPanelLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING) .addGroup(javax.swing.GroupLayout.Alignment.LEADING, dailyLogPanelLayout .createSequentialGroup() .addComponent(dayLbl, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap( javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) .addComponent(dayDisplayLbl, javax.swing.GroupLayout.DEFAULT_SIZE, 304, Short.MAX_VALUE)) .addGroup(javax.swing.GroupLayout.Alignment.LEADING, dailyLogPanelLayout .createSequentialGroup() .addComponent(dateLbl, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap( javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) .addComponent( dateDisplayLbl, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))) .addGap(44, 44, 44)) .addGroup(dailyLogPanelLayout.createSequentialGroup().addGroup(dailyLogPanelLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(dailyLogPanelLayout.createSequentialGroup() .addComponent(checkInLbl, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(checkInTimeCombo, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) .addGroup(dailyLogPanelLayout.createSequentialGroup().addGroup(dailyLogPanelLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false) .addComponent(checkoutLbl, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(breakLbl, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addGroup(dailyLogPanelLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(checkOutTimeCombo, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(breakOptionPanel, javax.swing.GroupLayout.PREFERRED_SIZE, 220, javax.swing.GroupLayout.PREFERRED_SIZE)))) .addContainerGap(152, Short.MAX_VALUE)))) .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, dailyLogPanelLayout.createSequentialGroup() .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(checkInOutButton, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(21, 21, 21))); dailyLogPanelLayout.setVerticalGroup(dailyLogPanelLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(dailyLogPanelLayout.createSequentialGroup().addContainerGap() .addGroup(dailyLogPanelLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false) .addComponent(dateLbl, javax.swing.GroupLayout.DEFAULT_SIZE, 18, Short.MAX_VALUE) .addComponent(dateDisplayLbl, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) .addGroup(dailyLogPanelLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false) .addComponent(dayLbl, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(dayDisplayLbl, javax.swing.GroupLayout.PREFERRED_SIZE, 18, javax.swing.GroupLayout.PREFERRED_SIZE)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) .addGroup(dailyLogPanelLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false) .addComponent(checkInTimeCombo).addComponent(checkInLbl, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) .addGroup(dailyLogPanelLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false) .addComponent(checkOutTimeCombo).addComponent(checkoutLbl, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) .addGroup(dailyLogPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(dailyLogPanelLayout.createSequentialGroup() .addComponent(breakLbl, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addGap(47, 47, 47)) .addGroup(dailyLogPanelLayout.createSequentialGroup() .addComponent(breakOptionPanel, javax.swing.GroupLayout.PREFERRED_SIZE, 84, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED, 40, Short.MAX_VALUE) .addComponent(checkInOutButton, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addContainerGap())))); dayLbl.getAccessibleContext().setAccessibleName("dayLbl"); dayDisplayLbl.getAccessibleContext().setAccessibleName("dayDisplayLbl"); checkInTimeCombo.getAccessibleContext().setAccessibleName("checkInTimeCombo"); checkOutTimeCombo.getAccessibleContext().setAccessibleName("checkOutTimeCombo"); checkInOutButton.getAccessibleContext().setAccessibleName("checkInOutButton"); javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1); jPanel1.setLayout(jPanel1Layout); jPanel1Layout.setHorizontalGroup(jPanel1Layout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel1Layout.createSequentialGroup() .addContainerGap() .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING) .addComponent(dailyLogPanel, javax.swing.GroupLayout.DEFAULT_SIZE, 452, Short.MAX_VALUE) .addGroup(jPanel1Layout.createSequentialGroup().addGap(0, 287, Short.MAX_VALUE) .addComponent(viewButton, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(exitButton, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) .addComponent(mainTitleLbl, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) .addContainerGap()) .addComponent(jSeparator1, javax.swing.GroupLayout.Alignment.TRAILING)); jPanel1Layout.setVerticalGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel1Layout.createSequentialGroup().addContainerGap() .addComponent(mainTitleLbl, javax.swing.GroupLayout.PREFERRED_SIZE, 70, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) .addComponent(dailyLogPanel, javax.swing.GroupLayout.DEFAULT_SIZE, 327, Short.MAX_VALUE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) .addComponent(jSeparator1, javax.swing.GroupLayout.PREFERRED_SIZE, 6, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(exitButton, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(viewButton, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) .addContainerGap())); javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane()); getContentPane().setLayout(layout); layout.setHorizontalGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(layout.createSequentialGroup().addGap(0, 0, Short.MAX_VALUE) .addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(0, 0, Short.MAX_VALUE))); layout.setVerticalGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(layout.createSequentialGroup().addGap(0, 0, Short.MAX_VALUE) .addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(0, 0, Short.MAX_VALUE))); pack(); }
From source file:com.sec.ose.osi.ui.frm.main.identification.codematch.table.JTableInfoForCMFile.java
synchronized public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected, boolean hasFocus, int row, int column) { JComponent comp = (JComponent) super.getTableCellRendererComponent(table, value, isSelected, hasFocus, row, column);/*from w w w .j a va2 s .c om*/ if (value == null) { comp.setToolTipText(null); return comp; } comp.setToolTipText(String.valueOf(value)); if (row >= table.getRowCount()) { log.debug("row > table.getRowCount()"); return comp; } switch (column) { case TableModelForCMFile.COL_COMPONENT_NAME: case TableModelForCMFile.COL_LICENSE_NAME: setHorizontalAlignment(SwingConstants.LEFT); break; case TableModelForCMFile.COL_VERSION_NAME: case TableModelForCMFile.COL_USAGE: case TableModelForCMFile.COL_STATUS: case TableModelForCMFile.COL_PERCENTAGE: case TableModelForCMFile.COL_MATCHED_FILE: setHorizontalAlignment(SwingConstants.CENTER); break; } if (table.getValueAt(row, TableModelForCMFile.COL_STATUS) == null) return comp; String status = table.getValueAt(row, TableModelForCMFile.COL_STATUS).toString(); String licenseName = table.getValueAt(row, TableModelForCMFile.COL_LICENSE_NAME).toString(); if (status.equals(AbstractMatchInfo.IDENTIFIED)) { comp.setFont(new Font("Arial", Font.BOLD | Font.ITALIC, 12)); comp.setForeground(NORMAL_COLOR); } else if ((status.equals(AbstractMatchInfo.REJECTED)) || (status.equals(AbstractMatchInfo.DECLARED))) { comp.setForeground(new Color(150, 150, 150)); } else if (status.equals(AbstractMatchInfo.PENDING)) { if (identifiedStringSearchLicense != null && !identifiedStringSearchLicense.equals("")) { String currentRowLicense = "" + licenseName; if (identifiedStringSearchLicense.equals(currentRowLicense)) { comp.setForeground(NORMAL_COLOR); } else { comp.setForeground(GRAY_COLOR); } } else { comp.setForeground(NORMAL_COLOR); } } return comp; }
From source file:cn.labthink.ReadAccess060.java
private void jButton_OpenfileActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton_OpenfileActionPerformed //filter//from w w w . j ava 2s . c o m ExtensionFileFilter filter = new ExtensionFileFilter("mdb", false, true); filter.setDescription("Open DataBase File"); //? JFileChooser jfc = new JFileChooser(); FileSystemView fsv = FileSystemView.getFileSystemView(); //? jfc.setCurrentDirectory(fsv.getHomeDirectory()); jfc.setDialogTitle("Choose the mdb file"); jfc.setMultiSelectionEnabled(false); jfc.setDialogType(JFileChooser.OPEN_DIALOG); jfc.setFileSelectionMode(JFileChooser.FILES_ONLY); jfc.setFileFilter(filter); int result = jfc.showOpenDialog(this); // ""? if (result == JFileChooser.APPROVE_OPTION) { String filesrc = jfc.getSelectedFile().getAbsolutePath(); inputfile = jfc.getSelectedFile(); jLabel_dbpath.setText("DB File Path:" + filesrc); maxid = Integer.MIN_VALUE; minid = Integer.MAX_VALUE; } else { return; } // Infodata = new Vector(); Infocolumns = new Vector(); try { // String url = "jdbc:odbc:driver={Microsoft Access Driver (*.mdb, *.accdb)};DBQ=D://b.MDB"; if (inputfile == null) { return; } initDB(); sql = conn.createStatement(ResultSet.TYPE_SCROLL_SENSITIVE, ResultSet.CONCUR_READ_ONLY); rs = sql.executeQuery("SELECT * FROM test order by testid desc"); Infocolumns.add("TestID"); Infocolumns.add("TestType"); Infocolumns.add("DeviceID"); Infocolumns.add("CellID"); Infocolumns.add("Operator"); Infocolumns.add("StartTime"); Infocolumns.add("EndTime"); Infocolumns.add("Comments"); Infocolumns.add("SetTemp."); int columnCount = Infocolumns.size(); Vector row; while (rs.next()) { row = new Vector(columnCount); int temp = 0; int ivalue = rs.getInt("TESTID"); maxid = maxid < ivalue ? ivalue : maxid; minid = minid > ivalue ? ivalue : minid; row.add(ivalue); temp = rs.getInt("TESTTYPE"); if (temp == 1) { row.add("OTR"); } else if (temp == 2) { row.add("WVTR"); } else { row.add(temp); } row.add(rs.getInt("DEVICEID")); row.add(rs.getString("CELLID")); row.add(rs.getString("OPERATOR")); row.add(rs.getDate("STARTTIME")); row.add(rs.getDate("ENDTIME")); row.add(rs.getString("COMMENTS")); row.add(rs.getDouble("SETTEMP")); // row.add(rs.getString(11)); // row.add(rs.getInt(10)); Infodata.add(row); } DefaultTableModel tableModel = new DefaultTableModel(Infodata, Infocolumns); jTable1.setModel(tableModel); //? // jTable1.setAutoResizeMode(JTable.AUTO_RESIZE_OFF); jTable1.setSelectionBackground(Color.orange); //? TableRowSorter<TableModel> tableRowSorter = new TableRowSorter<TableModel>(tableModel); jTable1.setRowSorter(tableRowSorter); // jTable1.setSelectionMode(ListSelectionModel.SINGLE_SELECTION); //table DefaultTableCellRenderer tcr = new DefaultTableCellRenderer();// table tcr.setHorizontalAlignment(SwingConstants.CENTER);// ?? jTable1.setDefaultRenderer(Object.class, tcr); // ((DefaultTableCellRenderer) jTable1.getTableHeader().getDefaultRenderer()) .setHorizontalAlignment(SwingConstants.CENTER); // DefaultTableCellRenderer rh = new DefaultTableCellRenderer(); // rh.setHorizontalAlignment(SwingConstants.CENTER); // jTable1.getTableHeader().setDefaultRenderer(rh); jTable1.getColumnModel().getColumn(0).setPreferredWidth(20); jTable1.getColumnModel().getColumn(1).setPreferredWidth(28); jTable1.getColumnModel().getColumn(2).setPreferredWidth(20); jTable1.getColumnModel().getColumn(3).setPreferredWidth(40); jTable1.getColumnModel().getColumn(4).setPreferredWidth(40); jTable1.getColumnModel().getColumn(5).setPreferredWidth(100); jTable1.getColumnModel().getColumn(6).setPreferredWidth(100); jTable1.getColumnModel().getColumn(7).setPreferredWidth(100); } catch (SQLException ee) { System.out.println(ee); } catch (ClassNotFoundException ex) { Logger.getLogger(ReadAccess060.class.getName()).log(Level.SEVERE, null, ex); } finally { try { sql.close(); } catch (Exception e) { } try { rs.close(); } catch (Exception e) { } } // validate(); }
From source file:cn.labthink.ReadAccess330.java
private void jButton_OpenfileActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton_OpenfileActionPerformed //filter/*w w w . ja v a 2 s. c om*/ ExtensionFileFilter filter = new ExtensionFileFilter("mdb", false, true); filter.setDescription("Open DataBase File"); //? JFileChooser jfc = new JFileChooser(); FileSystemView fsv = FileSystemView.getFileSystemView(); //? jfc.setCurrentDirectory(fsv.getHomeDirectory()); jfc.setDialogTitle("Choose the mdb file"); jfc.setMultiSelectionEnabled(false); jfc.setDialogType(JFileChooser.OPEN_DIALOG); jfc.setFileSelectionMode(JFileChooser.FILES_ONLY); jfc.setFileFilter(filter); int result = jfc.showOpenDialog(this); // ""? if (result == JFileChooser.APPROVE_OPTION) { String filesrc = jfc.getSelectedFile().getAbsolutePath(); inputfile = jfc.getSelectedFile(); jLabel_dbpath.setText("DB File Path:" + filesrc); maxid = Integer.MIN_VALUE; minid = Integer.MAX_VALUE; } else { return; } // Infodata = new Vector(); Infocolumns = new Vector(); try { // String url = "jdbc:odbc:driver={Microsoft Access Driver (*.mdb, *.accdb)};DBQ=D://b.MDB"; if (inputfile == null) { return; } initDB(); sql = conn.createStatement(ResultSet.TYPE_SCROLL_SENSITIVE, ResultSet.CONCUR_READ_ONLY); rs = sql.executeQuery("SELECT * FROM test order by testid desc"); Infocolumns.add("TestID"); Infocolumns.add("TestType"); Infocolumns.add("DeviceID"); Infocolumns.add("CellID"); Infocolumns.add("Operator"); Infocolumns.add("StartTime"); Infocolumns.add("EndTime"); Infocolumns.add("Comments"); Infocolumns.add("SetTemp."); int columnCount = Infocolumns.size(); Vector row; while (rs.next()) { row = new Vector(columnCount); int temp = 0; int ivalue = rs.getInt("TESTID"); maxid = maxid < ivalue ? ivalue : maxid; minid = minid > ivalue ? ivalue : minid; row.add(ivalue); temp = rs.getInt("TESTTYPE"); if (temp == 1) { row.add("OTR"); } else if (temp == 2) { row.add("WVTR"); } else { row.add(temp); } row.add(rs.getInt("DEVICEID")); row.add(rs.getString("CELLID")); row.add(rs.getString("OPERATOR")); row.add(rs.getDate("STARTTIME")); row.add(rs.getDate("ENDTIME")); row.add(rs.getString("COMMENTS")); row.add(rs.getDouble("SETTEMP")); // row.add(rs.getString(11)); // row.add(rs.getInt(10)); Infodata.add(row); } DefaultTableModel tableModel = new DefaultTableModel(Infodata, Infocolumns); jTable1.setModel(tableModel); //? // jTable1.setAutoResizeMode(JTable.AUTO_RESIZE_OFF); jTable1.setSelectionBackground(Color.orange); //? TableRowSorter<TableModel> tableRowSorter = new TableRowSorter<TableModel>(tableModel); jTable1.setRowSorter(tableRowSorter); // jTable1.setSelectionMode(ListSelectionModel.SINGLE_SELECTION); //table DefaultTableCellRenderer tcr = new DefaultTableCellRenderer();// table tcr.setHorizontalAlignment(SwingConstants.CENTER);// ?? jTable1.setDefaultRenderer(Object.class, tcr); // ((DefaultTableCellRenderer) jTable1.getTableHeader().getDefaultRenderer()) .setHorizontalAlignment(SwingConstants.CENTER); // DefaultTableCellRenderer rh = new DefaultTableCellRenderer(); // rh.setHorizontalAlignment(SwingConstants.CENTER); // jTable1.getTableHeader().setDefaultRenderer(rh); jTable1.getColumnModel().getColumn(0).setPreferredWidth(20); jTable1.getColumnModel().getColumn(1).setPreferredWidth(28); jTable1.getColumnModel().getColumn(2).setPreferredWidth(20); jTable1.getColumnModel().getColumn(3).setPreferredWidth(40); jTable1.getColumnModel().getColumn(4).setPreferredWidth(40); jTable1.getColumnModel().getColumn(5).setPreferredWidth(100); jTable1.getColumnModel().getColumn(6).setPreferredWidth(100); jTable1.getColumnModel().getColumn(7).setPreferredWidth(100); } catch (SQLException ee) { System.out.println(ee); } catch (ClassNotFoundException ex) { Logger.getLogger(ReadAccess330.class.getName()).log(Level.SEVERE, null, ex); } finally { try { sql.close(); } catch (Exception e) { } try { rs.close(); } catch (Exception e) { } } // validate(); }