List of usage examples for javax.swing DefaultComboBoxModel DefaultComboBoxModel
public DefaultComboBoxModel(Vector<E> v)
From source file:net.sf.maltcms.chromaui.msviewer.ui.panel.MassSpectrumPanel.java
private void updateActiveMassSpectrum() { Object[] obj = new Object[sc.getSeriesCount()]; for (int i = 0; i < sc.getSeriesCount(); i++) { obj[i] = sc.getSeries(i).getKey(); }//from ww w .ja v a 2 s . com activeMassSpectrum.setModel(new DefaultComboBoxModel(obj)); }
From source file:com.tiempometa.muestradatos.JReadTags.java
private void initComponents() { // JFormDesigner - Component initialization - DO NOT MODIFY // //GEN-BEGIN:initComponents ResourceBundle bundle = ResourceBundle.getBundle("com.tiempometa.muestradatos.muestradatos"); dialogPane = new JPanel(); contentPanel = new JPanel(); label2 = new JLabel(); nextBibTextField = new JTextField(); statusLabel = new JLabel(); startReadingButton = new JButton(); bibLabel = new JLabel(); scrollPane1 = new JScrollPane(); tagReadTable = new JTable(); label3 = new JLabel(); tidTextField = new JTextField(); deleteSelectedButton = new JButton(); label4 = new JLabel(); epcTextField = new JTextField(); deleteReadButton = new JButton(); label1 = new JLabel(); dataToStoreComboBox = new JComboBox<>(); deleteAllButton = new JButton(); allowDuplicateBibsCheckBox = new JCheckBox(); buttonBar = new JPanel(); closeButton = new JButton(); CellConstraints cc = new CellConstraints(); //======== this ======== setTitle(bundle.getString("JReadTags.this.title")); setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE); setResizable(false);/* w w w.j a v a 2 s . c o m*/ setIconImage( new ImageIcon(getClass().getResource("/com/tiempometa/resources/tiempometa_icon_large_alpha.png")) .getImage()); Container contentPane = getContentPane(); contentPane.setLayout(new BorderLayout()); //======== dialogPane ======== { dialogPane.setBorder(Borders.DIALOG_BORDER); dialogPane.setLayout(new BorderLayout()); //======== contentPanel ======== { contentPanel.setLayout(new FormLayout( new ColumnSpec[] { new ColumnSpec(Sizes.dluX(15)), FormFactory.LABEL_COMPONENT_GAP_COLSPEC, new ColumnSpec(Sizes.dluX(52)), FormFactory.LABEL_COMPONENT_GAP_COLSPEC, new ColumnSpec(Sizes.dluX(138)), FormFactory.LABEL_COMPONENT_GAP_COLSPEC, new ColumnSpec(Sizes.dluX(71)), FormFactory.LABEL_COMPONENT_GAP_COLSPEC, new ColumnSpec(Sizes.dluX(155)) }, new RowSpec[] { new RowSpec(Sizes.dluY(17)), FormFactory.LINE_GAP_ROWSPEC, new RowSpec(Sizes.dluY(20)), FormFactory.LINE_GAP_ROWSPEC, FormFactory.DEFAULT_ROWSPEC, FormFactory.LINE_GAP_ROWSPEC, new RowSpec(Sizes.dluY(20)), FormFactory.LINE_GAP_ROWSPEC, new RowSpec(Sizes.dluY(25)), FormFactory.LINE_GAP_ROWSPEC, FormFactory.DEFAULT_ROWSPEC, FormFactory.LINE_GAP_ROWSPEC, FormFactory.DEFAULT_ROWSPEC, FormFactory.LINE_GAP_ROWSPEC, FormFactory.DEFAULT_ROWSPEC, FormFactory.LINE_GAP_ROWSPEC, FormFactory.DEFAULT_ROWSPEC, FormFactory.LINE_GAP_ROWSPEC, FormFactory.DEFAULT_ROWSPEC })); //---- label2 ---- label2.setText(bundle.getString("JReadTags.label2.text")); label2.setFont(new Font("Tahoma", Font.PLAIN, 36)); contentPanel.add(label2, cc.xywh(3, 5, 3, 1)); //---- nextBibTextField ---- nextBibTextField.setFont(new Font("Tahoma", Font.PLAIN, 36)); nextBibTextField.setHorizontalAlignment(SwingConstants.RIGHT); nextBibTextField.setText(bundle.getString("JReadTags.nextBibTextField.text")); contentPanel.add(nextBibTextField, cc.xy(7, 5)); //---- statusLabel ---- statusLabel.setText(bundle.getString("JReadTags.statusLabel.text")); statusLabel.setHorizontalAlignment(SwingConstants.CENTER); statusLabel.setBackground(Color.yellow); statusLabel.setOpaque(true); statusLabel.setFont(new Font("Tahoma", Font.BOLD, 20)); contentPanel.add(statusLabel, cc.xywh(9, 3, 1, 5)); //---- startReadingButton ---- startReadingButton.setText(bundle.getString("JReadTags.startReadingButton.text")); startReadingButton.setFont(new Font("Tahoma", Font.PLAIN, 14)); startReadingButton.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { startReadingButtonActionPerformed(e); } }); contentPanel.add(startReadingButton, cc.xywh(3, 7, 3, 1)); //---- bibLabel ---- bibLabel.setForeground(Color.red); bibLabel.setFont(new Font("Tahoma", Font.BOLD, 36)); bibLabel.setHorizontalAlignment(SwingConstants.CENTER); contentPanel.add(bibLabel, cc.xy(9, 9)); //======== scrollPane1 ======== { scrollPane1.setViewportView(tagReadTable); } contentPanel.add(scrollPane1, cc.xywh(3, 11, 7, 1)); //---- label3 ---- label3.setText(bundle.getString("JReadTags.label3.text")); label3.setHorizontalAlignment(SwingConstants.RIGHT); label3.setFont(new Font("Tahoma", Font.PLAIN, 14)); contentPanel.add(label3, cc.xy(3, 13)); //---- tidTextField ---- tidTextField.setFont(new Font("Tahoma", Font.PLAIN, 14)); contentPanel.add(tidTextField, cc.xy(5, 13)); //---- deleteSelectedButton ---- deleteSelectedButton.setText(bundle.getString("JReadTags.deleteSelectedButton.text")); deleteSelectedButton.setFont(new Font("Tahoma", Font.PLAIN, 14)); deleteSelectedButton.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { deleteSelectedButtonActionPerformed(e); } }); contentPanel.add(deleteSelectedButton, cc.xy(9, 13)); //---- label4 ---- label4.setText(bundle.getString("JReadTags.label4.text")); label4.setHorizontalAlignment(SwingConstants.RIGHT); label4.setFont(new Font("Tahoma", Font.PLAIN, 14)); contentPanel.add(label4, cc.xy(3, 15)); //---- epcTextField ---- epcTextField.setFont(new Font("Tahoma", Font.PLAIN, 14)); contentPanel.add(epcTextField, cc.xy(5, 15)); //---- deleteReadButton ---- deleteReadButton.setText(bundle.getString("JReadTags.deleteReadButton.text")); deleteReadButton.setFont(new Font("Tahoma", Font.PLAIN, 14)); deleteReadButton.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { deleteReadButtonActionPerformed(e); } }); contentPanel.add(deleteReadButton, cc.xy(9, 15)); //---- label1 ---- label1.setText(bundle.getString("JReadTags.label1.text")); label1.setHorizontalAlignment(SwingConstants.RIGHT); label1.setFont(new Font("Tahoma", Font.PLAIN, 14)); contentPanel.add(label1, cc.xy(3, 17)); //---- dataToStoreComboBox ---- dataToStoreComboBox.setModel(new DefaultComboBoxModel<>(new String[] { "EPC", "TID" })); dataToStoreComboBox.setFont(new Font("Tahoma", Font.PLAIN, 14)); contentPanel.add(dataToStoreComboBox, cc.xy(5, 17)); //---- deleteAllButton ---- deleteAllButton.setText(bundle.getString("JReadTags.deleteAllButton.text")); deleteAllButton.setFont(new Font("Tahoma", Font.PLAIN, 14)); deleteAllButton.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { deleteAllButtonActionPerformed(e); } }); contentPanel.add(deleteAllButton, cc.xy(9, 17)); //---- allowDuplicateBibsCheckBox ---- allowDuplicateBibsCheckBox.setText(bundle.getString("JReadTags.allowDuplicateBibsCheckBox.text")); contentPanel.add(allowDuplicateBibsCheckBox, cc.xy(5, 19)); } dialogPane.add(contentPanel, BorderLayout.CENTER); //======== buttonBar ======== { buttonBar.setBorder(Borders.BUTTON_BAR_GAP_BORDER); buttonBar.setLayout( new FormLayout(new ColumnSpec[] { FormFactory.GLUE_COLSPEC, FormFactory.BUTTON_COLSPEC }, RowSpec.decodeSpecs("pref"))); //---- closeButton ---- closeButton.setText("Cerrar"); closeButton.setFont(new Font("Tahoma", Font.PLAIN, 14)); closeButton.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { closeButtonActionPerformed(e); } }); buttonBar.add(closeButton, cc.xy(2, 1)); } dialogPane.add(buttonBar, BorderLayout.SOUTH); } contentPane.add(dialogPane, BorderLayout.CENTER); setSize(710, 675); setLocationRelativeTo(getOwner()); // //GEN-END:initComponents }
From source file:io.github.jeddict.jpa.modeler.source.generator.ui.GenerateCodeDialog.java
private void changeControllerLayer(TechContext controllerLayer) { viewerLayerCombo.setModel(new DefaultComboBoxModel( Generator.getViewer(controllerLayer, isMicroservice() || isGateway()).toArray())); viewerLayerCombo.setEnabled(controllerLayer.isValid()); setTechPanel(controllerLayer);//from w ww. j a v a 2 s .co m }
From source file:com.mirth.connect.connectors.doc.DocumentWriter.java
private void initComponents() { setBackground(UIConstants.BACKGROUND_COLOR); outputLabel = new JLabel("Output:"); ButtonGroup outputButtonGroup = new ButtonGroup(); outputFileRadioButton = new MirthRadioButton("File"); outputFileRadioButton.setBackground(getBackground()); outputFileRadioButton.setToolTipText("Write the contents to a file."); outputFileRadioButton.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent evt) { updateFileEnabled(true);//from w ww.ja v a2s.c om } }); outputButtonGroup.add(outputFileRadioButton); outputAttachmentRadioButton = new MirthRadioButton("Attachment"); outputAttachmentRadioButton.setBackground(getBackground()); outputAttachmentRadioButton.setToolTipText( "<html>Write the contents to an attachment. The destination's response message will contain the<br>attachment Id and can be used in subsequent connectors to include the attachment.</html>"); outputAttachmentRadioButton.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent evt) { updateFileEnabled(false); } }); outputButtonGroup.add(outputAttachmentRadioButton); outputBothRadioButton = new MirthRadioButton("Both"); outputBothRadioButton.setBackground(getBackground()); outputBothRadioButton.setToolTipText( "<html>Write the contents to a file and an attachment. The destination's response message will contain<br>the attachment Id and can be used in subsequent connectors to include the attachment.</html>"); outputBothRadioButton.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent evt) { updateFileEnabled(true); } }); outputButtonGroup.add(outputBothRadioButton); directoryLabel = new JLabel("Directory:"); directoryField = new MirthTextField(); directoryField.setToolTipText("The directory (folder) where the generated file should be written."); testConnectionButton = new JButton("Test Write"); testConnectionButton.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent evt) { testConnection(); } }); fileNameLabel = new JLabel("File Name:"); fileNameField = new MirthTextField(); fileNameField.setToolTipText("The file name to give to the generated file."); documentTypeLabel = new JLabel("Document Type:"); ButtonGroup documentTypeButtonGroup = new ButtonGroup(); documentTypePDFRadio = new MirthRadioButton("PDF"); documentTypePDFRadio.setBackground(getBackground()); documentTypePDFRadio.setToolTipText("The type of document to be created for each message."); documentTypePDFRadio.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent evt) { documentTypePDFRadioActionPerformed(); } }); documentTypeButtonGroup.add(documentTypePDFRadio); documentTypeRTFRadio = new MirthRadioButton("RTF"); documentTypeRTFRadio.setBackground(getBackground()); documentTypeRTFRadio.setToolTipText("The type of document to be created for each message."); documentTypeRTFRadio.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent evt) { documentTypeRTFRadioActionPerformed(); } }); documentTypeButtonGroup.add(documentTypeRTFRadio); encryptedLabel = new JLabel("Encrypted:"); ButtonGroup encryptedButtonGroup = new ButtonGroup(); encryptedYesRadio = new MirthRadioButton("Yes"); encryptedYesRadio.setBackground(getBackground()); encryptedYesRadio.setToolTipText( "If Document Type PDF is selected, generated documents can optionally be encrypted."); encryptedYesRadio.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent evt) { encryptedYesActionPerformed(); } }); encryptedButtonGroup.add(encryptedYesRadio); encryptedNoRadio = new MirthRadioButton("No"); encryptedNoRadio.setBackground(getBackground()); encryptedNoRadio.setToolTipText( "If Document Type PDF is selected, generated documents can optionally be encrypted."); encryptedNoRadio.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent evt) { encryptedNoActionPerformed(); } }); encryptedButtonGroup.add(encryptedNoRadio); passwordLabel = new JLabel("Password:"); passwordField = new MirthPasswordField(); passwordField.setToolTipText( "If Encrypted Yes is selected, enter the password to be used to later view the document here."); pageSizeLabel = new JLabel("Page Size:"); pageSizeXLabel = new JLabel(""); DocumentListener pageSizeDocumentListener = new DocumentListener() { @Override public void removeUpdate(DocumentEvent evt) { updatePageSizeComboBox(); } @Override public void insertUpdate(DocumentEvent evt) { updatePageSizeComboBox(); } @Override public void changedUpdate(DocumentEvent evt) { updatePageSizeComboBox(); } }; pageSizeWidthField = new MirthTextField(); pageSizeWidthField.getDocument().addDocumentListener(pageSizeDocumentListener); pageSizeWidthField.setToolTipText( "<html>The width of the page. The units for the width<br/>are determined by the drop-down menu to the right.<br/>When rendering PDFs, a minimum of 26mm is enforced.</html>"); pageSizeHeightField = new MirthTextField(); pageSizeHeightField.getDocument().addDocumentListener(pageSizeDocumentListener); pageSizeHeightField.setToolTipText( "<html>The height of the page. The units for the height<br/>are determined by the drop-down menu to the right.<br/>When rendering PDFs, a minimum of 26mm is enforced.</html>"); pageSizeUnitComboBox = new MirthComboBox<Unit>(); pageSizeUnitComboBox.setModel(new DefaultComboBoxModel<Unit>(Unit.values())); pageSizeUnitComboBox.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent evt) { updatePageSizeComboBox(); } }); pageSizeUnitComboBox.setToolTipText("The units to use for the page width and height."); pageSizeComboBox = new MirthComboBox<PageSize>(); pageSizeComboBox.setModel(new DefaultComboBoxModel<PageSize>( ArrayUtils.subarray(PageSize.values(), 0, PageSize.values().length - 1))); pageSizeComboBox.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent evt) { pageSizeComboBoxActionPerformed(); } }); pageSizeComboBox.setToolTipText("Select a standard page size to use, or enter a custom page size."); templateLabel = new JLabel("HTML Template:"); templateTextArea = new MirthRTextScrollPane(ContextType.DESTINATION_DISPATCHER, false, SyntaxConstants.SYNTAX_STYLE_HTML, false); templateTextArea.setBorder(BorderFactory.createEtchedBorder()); }
From source file:net.openbyte.gui.CreateProjectFrame.java
private void initComponents() { // JFormDesigner - Component initialization - DO NOT MODIFY //GEN-BEGIN:initComponents // Generated using JFormDesigner Evaluation license - Gary Lee button1 = new JButton(); textField1 = new JTextField(); label1 = new JLabel(); comboBox1 = new JComboBox<>(); label2 = new JLabel(); comboBox2 = new JComboBox<>(); label3 = new JLabel(); button2 = new JButton(); //======== this ======== setTitle("Project Creation"); setDefaultCloseOperation(WindowConstants.DO_NOTHING_ON_CLOSE); setResizable(false);//from w ww. j a v a 2 s.com Container contentPane = getContentPane(); contentPane.setLayout(null); //---- button1 ---- button1.setText("Create project"); button1.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { button1ActionPerformed(e); } }); contentPane.add(button1); button1.setBounds(new Rectangle(new Point(340, 170), button1.getPreferredSize())); contentPane.add(textField1); textField1.setBounds(10, 25, 245, textField1.getPreferredSize().height); //---- label1 ---- label1.setText("Project Name"); contentPane.add(label1); label1.setBounds(new Rectangle(new Point(10, 5), label1.getPreferredSize())); //---- comboBox1 ---- comboBox1.setModel(new DefaultComboBoxModel<>(new String[] { "Minecraft Forge", "MCP", "Bukkit" })); comboBox1.addItemListener(new ItemListener() { @Override public void itemStateChanged(ItemEvent e) { comboBox1ItemStateChanged(e); } }); contentPane.add(comboBox1); comboBox1.setBounds(10, 70, 245, comboBox1.getPreferredSize().height); //---- label2 ---- label2.setText("Modification API"); contentPane.add(label2); label2.setBounds(new Rectangle(new Point(10, 50), label2.getPreferredSize())); //---- comboBox2 ---- comboBox2.setModel(new DefaultComboBoxModel<>(new String[] { "1.8.9", "1.7.10" })); contentPane.add(comboBox2); comboBox2.setBounds(10, 120, 245, comboBox2.getPreferredSize().height); //---- label3 ---- label3.setText("Minecraft Version"); contentPane.add(label3); label3.setBounds(new Rectangle(new Point(10, 100), label3.getPreferredSize())); //---- button2 ---- button2.setText("Cancel"); button2.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { button2ActionPerformed(e); } }); contentPane.add(button2); button2.setBounds(new Rectangle(new Point(10, 170), button2.getPreferredSize())); { // compute preferred size Dimension preferredSize = new Dimension(); for (int i = 0; i < contentPane.getComponentCount(); i++) { Rectangle bounds = contentPane.getComponent(i).getBounds(); preferredSize.width = Math.max(bounds.x + bounds.width, preferredSize.width); preferredSize.height = Math.max(bounds.y + bounds.height, preferredSize.height); } Insets insets = contentPane.getInsets(); preferredSize.width += insets.right; preferredSize.height += insets.bottom; contentPane.setMinimumSize(preferredSize); contentPane.setPreferredSize(preferredSize); } setSize(480, 240); setLocationRelativeTo(getOwner()); // JFormDesigner - End of component initialization //GEN-END:initComponents }
From source file:com.rapidminer.gui.new_plotter.gui.dialog.AddParallelLineDialog.java
/** * Sets the current {@link PlotConfiguration} for this dialog. * /*from w ww .j ava 2s . c om*/ * @param plotConfig */ private void setPlotConfiguration(PlotConfiguration plotConfig) { if (plotConfig == null) { throw new IllegalArgumentException("plotConfig must not be null!"); } this.plotConfig = plotConfig; Vector<RangeAxisConfig> rangeConfigsVector = new Vector<RangeAxisConfig>(); String selectedItem = String.valueOf(rangeAxisSelectionCombobox.getSelectedItem()); for (RangeAxisConfig config : this.plotConfig.getRangeAxisConfigs()) { rangeConfigsVector.add(config); } rangeAxisSelectionCombobox.setModel(new DefaultComboBoxModel(rangeConfigsVector)); // reselect the previously selected RangeAxisConfig (if it is still there) if (selectedItem != null) { for (int i = 0; i < rangeAxisSelectionCombobox.getItemCount(); i++) { if (String.valueOf(rangeAxisSelectionCombobox.getItemAt(i)).equals(selectedItem)) { rangeAxisSelectionCombobox.setSelectedIndex(i); break; } } } // calculate preselected x/y values if (mousePosition != null) { Rectangle2D plotArea = engine.getChartPanel().getScreenDataArea(); if (engine.getChartPanel().getChart().getPlot() instanceof XYPlot) { XYPlot plot = (XYPlot) engine.getChartPanel().getChart().getPlot(); // calculate x value double chartX = plot.getDomainAxis().java2DToValue(mousePosition.getX(), plotArea, plot.getDomainAxisEdge()); xField.setText(String.valueOf(chartX)); // calculate y value for (int i = 0; i < plot.getRangeAxisCount(); i++) { ValueAxis config = plot.getRangeAxis(i); if (config != null && config.getLabel() != null) { if (config.getLabel() .equals(String.valueOf(rangeAxisSelectionCombobox.getSelectedItem()))) { double chartY = config.java2DToValue(mousePosition.getY(), plotArea, plot.getRangeAxisEdge()); yField.setText(String.valueOf(chartY)); } } } } } }
From source file:com.przemo.probabilities.gui.SimulatorPanel.java
private void setupGUI() { cmbSimulatorType.setModel(new DefaultComboBoxModel(Simulators.values())); lblBankrupt.setVisible(false); }
From source file:com.mirth.connect.client.ui.panels.connectors.SourceSettingsPanel.java
private void initComponents() { setBackground(UIConstants.BACKGROUND_COLOR); setBorder(BorderFactory.createTitledBorder( BorderFactory.createMatteBorder(1, 0, 0, 0, new Color(204, 204, 204)), "Source Settings", TitledBorder.DEFAULT_JUSTIFICATION, TitledBorder.DEFAULT_POSITION, new Font("Tahoma", 1, 11))); sourceQueueLabel = new JLabel("Source Queue:"); sourceQueueComboBox = new MirthComboBox(); sourceQueueComboBox.setModel(new DefaultComboBoxModel( new String[] { "OFF (Respond after processing)", "ON (Respond before processing)" })); sourceQueueComboBox.setToolTipText(// w w w . j av a 2 s . co m "<html>Selecting OFF will process the message before sending the response (can use response from destinations)<br>Selecting ON will queue messages and immediately send a response (cannot use response from destinations)</html>"); sourceQueueComboBox.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent evt) { sourceQueueComboBoxActionPerformed(evt); } }); queueWarningLabel = new JLabel("Queuing is not supported by the current message storage mode."); queueWarningLabel.setForeground(Color.RED); queueBufferSizeLabel = new JLabel("Queue Buffer Size:"); queueBufferSizeField = new JTextField(); queueBufferSizeField.setDocument(new MirthFieldConstraints(0, false, false, true)); queueBufferSizeField.setToolTipText( "<html>The buffer size for the source queue.<br/>Up to this many connector messages may<br/>be held in memory at once when queuing.</html>"); responseLabel = new JLabel("Response:"); responseComboBox = new MirthComboBox(); responseComboBox .setModel(new DefaultComboBoxModel(new String[] { "Auto-generate (After source transformer)", "None", "Auto-generate (Before processing)", "Auto-generate (After source transformer)", "Auto-generate (Destinations completed)", "Post-processor", "Destination 1" })); responseComboBox.setToolTipText( "<html>Select a destination's response, the postprocessor return value, or a response map variable.<br/>Select <b>\"Auto-generate\"</b> to send a response generated by the inbound data type using the raw message:<br/> - <b>Before processing:</b> Response generated before the channel processes the message (SENT status)<br/> - <b>After source transformer:</b> Response generated after the channel processes the message (source status)<br/> - <b>Destinations completed:</b> Response generated after the channel processes the message, with a status<br/> based on the destination statuses, using a precedence of ERROR, QUEUED, SENT, FILTERED<br/></html>"); processBatchLabel = new JLabel("Process Batch:"); ButtonGroup processBatchButtonGroup = new ButtonGroup(); processBatchYesRadio = new MirthRadioButton("Yes"); processBatchYesRadio.setBackground(getBackground()); processBatchYesRadio.setToolTipText( "<html>Select Yes to enable batch processing. Batch messages are only supported if<br>the source connector's inbound properties contains a <b>Batch</b> section.</html>"); processBatchYesRadio.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent evt) { processBatchYesRadioActionPerformed(evt); } }); processBatchButtonGroup.add(processBatchYesRadio); processBatchNoRadio = new MirthRadioButton("No"); processBatchNoRadio.setBackground(getBackground()); processBatchNoRadio.setToolTipText( "<html>Select Yes to enable batch processing. Batch messages are only supported if<br>the source connector's inbound properties contains a <b>Batch</b> section.</html>"); processBatchNoRadio.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent evt) { processBatchNoRadioActionPerformed(evt); } }); processBatchButtonGroup.add(processBatchNoRadio); batchResponseLabel = new JLabel("Batch Response:"); ButtonGroup batchResponseButtonGroup = new ButtonGroup(); batchResponseFirstRadio = new MirthRadioButton("First"); batchResponseFirstRadio.setBackground(getBackground()); batchResponseFirstRadio.setToolTipText( "<html>Each message in the batch contains its own response that is generated via the method selected above.<br> Select either the response from the first or last message in the batch to be sent back to the originating system.</html>"); batchResponseButtonGroup.add(batchResponseFirstRadio); batchResponseLastRadio = new MirthRadioButton("Last"); batchResponseLastRadio.setBackground(getBackground()); batchResponseLastRadio.setToolTipText( "<html>Each message in the batch contains its own response that is generated via the method selected above.<br> Select either the response from the first or last message in the batch to be sent back to the originating system.</html>"); batchResponseButtonGroup.add(batchResponseLastRadio); processingThreadsLabel = new JLabel("Max Processing Threads:"); processingThreadsField = new MirthTextField(); processingThreadsField.setDocument(new MirthFieldConstraints(0, false, false, true)); processingThreadsField.setToolTipText( "<html>The maximum number of messages that can process through<br/>the channel simultaneously. Note that when this value<br/>is greater than 1, message order is NOT guaranteed.</html>"); }
From source file:com.cch.aj.entryrecorder.frame.SettingsJFrame.java
private void UpdateTabAdditive(int id) { int selectedIndex = FillAdditiveComboBox(this.cbAdditive, id); if (selectedIndex >= 0) { Additive currentAdditive = ((ComboBoxItem<Additive>) this.cbAdditive.getSelectedItem()).getItem(); ///*w ww. j a v a 2 s. com*/ this.txtAdditiveCompany .setText(currentAdditive.getCompany() == "- Select -" ? "" : currentAdditive.getCompany()); this.txtAdditiveDesc .setText(currentAdditive.getDescription() != null ? currentAdditive.getDescription() : ""); this.txtAdditiveGrade.setText(currentAdditive.getGrade() != null ? currentAdditive.getGrade() : ""); } else { this.cbAdditive.setModel(new DefaultComboBoxModel(new ComboBoxItem[] {})); this.txtAdditiveCompany.setText(""); this.txtAdditiveDesc.setText(""); this.txtAdditiveGrade.setText(""); } if (this.cbAdditive.getSelectedItem() == null || ((ComboBoxItem<Additive>) this.cbAdditive.getSelectedItem()).getId() == 0) { this.pnlEditAdditive.setVisible(false); this.btnAdditiveDelete.setVisible(false); this.btnAdditiveSave.setVisible(false); this.btnAdditiveUndo.setVisible(false); } else { this.pnlEditAdditive.setVisible(true); this.btnAdditiveDelete.setVisible(true); this.btnAdditiveSave.setVisible(true); this.btnAdditiveUndo.setVisible(true); } }
From source file:com.lynk.hrm.ui.dialog.InfoEmployee.java
private void initComponents() { addWindowListener(new WindowAdapter() { @Override// w w w. ja va 2s . com public void windowClosing(WindowEvent e) { thisWindowClosing(e); } }); setSize(836, 674); setTitle(""); setIconImage( Toolkit.getDefaultToolkit().getImage(InfoEmployee.class.getResource("/resource/image/icon.png"))); setDefaultCloseOperation(JDialog.DO_NOTHING_ON_CLOSE); getContentPane().setLayout(new BorderLayout(0, 0)); { JToolBar toolBar = new JToolBar(); toolBar.setFloatable(false); getContentPane().add(toolBar, BorderLayout.NORTH); { JButton uiSave = new JButton("?"); uiSave.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { uiSaveActionPerformed(true); } }); uiSave.setFocusable(false); uiSave.setIcon(new ImageIcon(InfoEmployee.class.getResource("/resource/image/emp_save.png"))); uiSave.setFont(APP_FONT); toolBar.add(uiSave); } toolBar.addSeparator(); { JButton uiReadIdCard = new JButton("??"); uiReadIdCard.setFont(APP_FONT); uiReadIdCard.setIcon( new ImageIcon(InfoEmployee.class.getResource("/resource/image/manager_teacher.png"))); uiReadIdCard.setFocusable(false); uiReadIdCard.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { uiReadIdCardActionPerformed(e); } }); toolBar.add(uiReadIdCard); } toolBar.addSeparator(); { JButton uiInputFinger = new JButton(""); uiInputFinger.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { uiInputFingerActionPerformed(e); } }); uiInputFinger.setIcon(new ImageIcon(InfoEmployee.class.getResource("/resource/image/finger.png"))); uiInputFinger.setFont(APP_FONT); uiInputFinger.setFocusable(false); toolBar.add(uiInputFinger); } toolBar.addSeparator(); { JButton uiSetSuspend = new JButton("??"); uiSetSuspend.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { uiSetSuspendActionPerformed(e); } }); uiSetSuspend .setIcon(new ImageIcon(InfoEmployee.class.getResource("/resource/image/emp_retire.png"))); uiSetSuspend.setFont(APP_FONT); uiSetSuspend.setFocusable(false); toolBar.add(uiSetSuspend); } } { JPanel panel = new JPanel(); getContentPane().add(panel); panel.setLayout(new MigLayout("", "[]5[grow]25[]5[grow]25[]5[grow]5[102]", "[][][][]")); { JLabel label = new JLabel("?"); label.setHorizontalAlignment(SwingConstants.RIGHT); label.setFont(APP_FONT); panel.add(label, "cell 0 0"); } { uiId = new LynkTextField(); uiId.setEditable(false); uiId.setForeground(Color.BLUE); panel.add(uiId, "cell 1 0,growx"); } { JLabel label = new JLabel("??"); label.setHorizontalAlignment(SwingConstants.RIGHT); label.setFont(APP_FONT); panel.add(label, "cell 2 0"); } { uiName = new LynkTextField(); uiName.addFocusListener(new FocusAdapter() { @Override public void focusLost(FocusEvent e) { uiNameFocusLost(e); } }); panel.add(uiName, "cell 3 0,growx"); } { JLabel label = new JLabel("?"); label.setHorizontalAlignment(SwingConstants.RIGHT); label.setFont(APP_FONT); panel.add(label, "cell 4 0"); } { uiNamePy = new LynkTextField(); panel.add(uiNamePy, "cell 5 0,growx"); } { JLabel label = new JLabel("?"); label.setHorizontalAlignment(SwingConstants.RIGHT); label.setFont(APP_FONT); panel.add(label, "cell 0 1"); } { uiState = new JComboBox<String>(); uiState.setForeground(Color.BLUE); uiState.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { uiStateActionPerformed(e); } }); uiState.setModel(new DefaultComboBoxModel<String>(new String[] { "", Employee.STATE_PROBATION, Employee.STATE_CONTRACT, Employee.STATE_SUSPEND, Employee.STATE_LEAVE, Employee.STATE_RETIRE, Employee.STATE_DELETE })); uiState.setFont(APP_FONT); panel.add(uiState, "cell 1 1,growx"); } { uiInfoTab = new JideTabbedPane(JTabbedPane.TOP); uiInfoTab.addChangeListener(new ChangeListener() { public void stateChanged(ChangeEvent e) { uiInfoTabStateChanged(e); } }); uiInfoTab.setColorTheme(JideTabbedPane.COLOR_THEME_DEFAULT); uiInfoTab.setFont(APP_FONT); panel.add(uiInfoTab, "cell 0 3 7 1"); { JPanel uiInfoBasic = new JPanel(); uiInfoBasic.setLayout(new MigLayout("", "[473px,grow][307px,grow]", "[grow][289px][149px]")); uiInfoTab.addTab("?", uiInfoBasic); { JPanel uiIdCardPane = new JPanel(); uiIdCardPane.setBorder(new EtchedBorder(EtchedBorder.LOWERED, null, null)); uiIdCardPane.setLayout(new MigLayout("", "[]5[grow]10[]", "[][][][][40px:40px:40px,grow]")); uiInfoBasic.add(uiIdCardPane, "cell 0 0,grow"); { JLabel label = new JLabel("??"); uiIdCardPane.add(label, "cell 0 0"); label.setHorizontalAlignment(SwingConstants.RIGHT); label.setFont(APP_FONT); } { uiIdCard = new LynkTextField(); uiIdCardPane.add(uiIdCard, "cell 1 0,growx"); } { JPanel pane = new JPanel(); uiIdCardPane.add(pane, "cell 2 0 1 5,grow"); pane.setLayout(new MigLayout("insets 0", "[102px:102px:102px]", "[126px:126px:126px]")); { uiPhoto = new ImagePane(); pane.add(uiPhoto, "cell 0 0,grow"); } } // { // JPanel photoPane = new JPanel(); // photoPane.setLayout(new MigLayout("insets 0", "[grow]", "[grow][]")); // uiIdCardPane.add(photoPane, "cell 2 0 2 4,grow"); // { // uiPhoto = new ImagePane(); // photoPane.add(uiPhoto, "cell 0 0,grow"); // } // { // JButton uiReadIdCardDirect = new JButton("??"); // uiReadIdCardDirect.addActionListener(new ActionListener() { // public void actionPerformed(ActionEvent e) { // uiReadIdCardDirectActionPerformed(e); // } // }); // uiReadIdCardDirect.setFont(APP_FONT); // uiReadIdCardDirect.setFocusable(false); // photoPane.add(uiReadIdCardDirect, "cell 0 1,grow"); // } // } { JLabel label = new JLabel(""); uiIdCardPane.add(label, "cell 0 1"); label.setHorizontalAlignment(SwingConstants.RIGHT); label.setFont(APP_FONT); } { uiBirthday = new LynkTextField(); uiIdCardPane.add(uiBirthday, "cell 1 1,growx"); } { JLabel label = new JLabel(""); uiIdCardPane.add(label, "cell 0 2"); label.setHorizontalAlignment(SwingConstants.RIGHT); label.setFont(APP_FONT); } { uiAge = new LynkTextField(); uiIdCardPane.add(uiAge, "cell 1 2,growx"); } { JLabel label = new JLabel(""); uiIdCardPane.add(label, "cell 0 3,aligny top"); label.setHorizontalAlignment(SwingConstants.RIGHT); label.setFont(APP_FONT); } { uiGender = new LynkTextField(); uiIdCardPane.add(uiGender, "cell 1 3,growx,aligny top"); } { JLabel label = new JLabel("??"); label.setFont(APP_FONT); label.setHorizontalAlignment(SwingConstants.RIGHT); uiIdCardPane.add(label, "cell 0 4"); } { JScrollPane scrollPane = new JScrollPane(); uiIdCardPane.add(scrollPane, "cell 1 4,grow"); { uiCensusAddress = new JTextArea(); uiCensusAddress.setWrapStyleWord(true); uiCensusAddress.setLineWrap(true); scrollPane.setViewportView(uiCensusAddress); uiCensusAddress.setFont(APP_FONT); } } } { JPanel uiIdCardPane = new JPanel(); uiIdCardPane.setBorder(new EtchedBorder(EtchedBorder.LOWERED, null, null)); uiIdCardPane .setLayout(new MigLayout("", "[]5[grow]25[]5[grow]", "[][][40px:40px:40px,grow]")); uiInfoBasic.add(uiIdCardPane, "cell 0 1,grow"); { JLabel label = new JLabel(""); uiIdCardPane.add(label, "cell 0 0"); label.setHorizontalAlignment(SwingConstants.RIGHT); label.setFont(APP_FONT); } { uiMarital = new JComboBox<String>(); uiIdCardPane.add(uiMarital, "cell 1 0,growx"); uiMarital.setModel(new DefaultComboBoxModel<String>( new String[] { Employee.MARITAL_YES, Employee.MARITAL_NO })); uiMarital.setFont(APP_FONT); } { JLabel label = new JLabel("?"); uiIdCardPane.add(label, "cell 2 0"); label.setHorizontalAlignment(SwingConstants.RIGHT); label.setFont(APP_FONT); } { uiContact = new LynkTextField(); uiIdCardPane.add(uiContact, "cell 3 0,growx"); } { JLabel label = new JLabel("?"); uiIdCardPane.add(label, "cell 0 1"); label.setHorizontalAlignment(SwingConstants.RIGHT); label.setFont(APP_FONT); } { uiCensus = new JComboBox<String>(); uiIdCardPane.add(uiCensus, "cell 1 1,growx"); uiCensus.setModel(new DefaultComboBoxModel<String>( new String[] { Employee.CENSUS_A, Employee.CENSUS_B, Employee.CENSUS_C, Employee.CENSUS_D, Employee.CENSUS_E, Employee.CENSUS_F })); uiCensus.setFont(APP_FONT); } { JLabel label = new JLabel("??"); uiIdCardPane.add(label, "cell 2 1"); label.setHorizontalAlignment(SwingConstants.RIGHT); label.setFont(APP_FONT); } { uiResidencePermit = new JComboBox<String>(); uiIdCardPane.add(uiResidencePermit, "cell 3 1,growx"); uiResidencePermit .setModel(new DefaultComboBoxModel<String>(new String[] { "", "", "" })); uiResidencePermit.setFont(APP_FONT); } { JLabel label = new JLabel(""); uiIdCardPane.add(label, "cell 0 2"); label.setHorizontalAlignment(SwingConstants.RIGHT); label.setFont(APP_FONT); } { JScrollPane scrollPane = new JScrollPane(); uiIdCardPane.add(scrollPane, "cell 1 2 3 1,grow"); { uiAddress = new JTextArea(); uiAddress.setWrapStyleWord(true); uiAddress.setLineWrap(true); scrollPane.setViewportView(uiAddress); uiAddress.setFont(APP_FONT); } } } { JPanel uiCompanyPanel = new JPanel(); uiCompanyPanel.setBorder(new EtchedBorder(EtchedBorder.LOWERED, null, null)); uiCompanyPanel.setLayout(new MigLayout("", "[]5[grow][]25[]5[grow][]", "[][][][][][][][]")); uiInfoBasic.add(uiCompanyPanel, "cell 0 2,growx,aligny top"); { JLabel label = new JLabel(Employee.SUSPEND_NOTE); label.setHorizontalAlignment(SwingConstants.RIGHT); label.setFont(APP_FONT); uiCompanyPanel.add(label, "cell 0 0"); } { uiFactory = new JComboBox<String>(new DefaultComboBoxModel<String>( new String[] { Employee.FACROTY_TC, Employee.FACTORY_SX })); uiFactory.setFont(APP_FONT); uiCompanyPanel.add(uiFactory, "cell 1 0 2 1,growx"); } { JLabel label = new JLabel(""); uiCompanyPanel.add(label, "cell 3 0"); label.setHorizontalAlignment(SwingConstants.RIGHT); label.setFont(APP_FONT); } { uiDept = new LynkTextField(); uiDept.setEditable(false); uiCompanyPanel.add(uiDept, "cell 4 0,growx"); } { JButton uiChooseDept = new JButton(); uiChooseDept.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { uiChooseDeptActionPerformed(e); } }); uiChooseDept.setIcon(new ImageIcon( InfoEmployee.class.getResource("/resource/image/choose_more.png"))); uiChooseDept.setMargin(new Insets(1, 1, 1, 1)); uiCompanyPanel.add(uiChooseDept, "cell 5 0,growx"); } { JLabel label = new JLabel("?"); uiCompanyPanel.add(label, "cell 0 1"); label.setHorizontalAlignment(SwingConstants.RIGHT); label.setFont(APP_FONT); } { uiJob = new LynkTextField(); uiJob.setEditable(false); uiCompanyPanel.add(uiJob, "cell 1 1,growx"); } { JButton uiChooseJob = new JButton(); uiChooseJob.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { uiChooseJobActionPerformed(e); } }); uiChooseJob.setIcon(new ImageIcon( InfoEmployee.class.getResource("/resource/image/choose_more.png"))); uiChooseJob.setMargin(new Insets(1, 1, 1, 1)); uiCompanyPanel.add(uiChooseJob, "cell 2 1,growx"); } { JLabel label = new JLabel(Employee.SUSPEND_START); label.setHorizontalAlignment(SwingConstants.RIGHT); label.setFont(APP_FONT); uiCompanyPanel.add(label, "cell 3 1"); } { uiDdg = new JComboBox<String>( new DefaultComboBoxModel<>(new String[] { Employee.DDG_N, Employee.DDG_Y })); uiDdg.setFont(APP_FONT); uiCompanyPanel.add(uiDdg, "cell 4 1 2 1,growx"); } { JLabel label = new JLabel(""); uiCompanyPanel.add(label, "cell 0 2"); label.setHorizontalAlignment(SwingConstants.RIGHT); label.setFont(APP_FONT); } { uiEntryDate = new JDateChooser(); uiCompanyPanel.add(uiEntryDate, "cell 1 2 2 1,growx"); uiEntryDate.setDateFormatString("yyyy-MM-dd"); uiEntryDate.setFont(APP_FONT); uiEntryDate.getJCalendar().setTodayButtonVisible(true); uiEntryDate.addPropertyChangeListener(new PropertyChangeListener() { @Override public void propertyChange(PropertyChangeEvent evt) { if ("date".equals(evt.getPropertyName())) { setWorkAge(); } } }); } { JLabel label = new JLabel(""); uiCompanyPanel.add(label, "cell 3 2"); label.setHorizontalAlignment(SwingConstants.RIGHT); label.setFont(APP_FONT); } { uiWorkAge = new LynkTextField("0"); uiCompanyPanel.add(uiWorkAge, "cell 4 2 2 1,growx"); uiWorkAge.setEditable(false); } { JLabel label = new JLabel("?"); uiCompanyPanel.add(label, "cell 0 3"); label.setHorizontalAlignment(SwingConstants.RIGHT); label.setFont(APP_FONT); } { uiProbation = new JDateChooser(); uiCompanyPanel.add(uiProbation, "cell 1 3 2 1,growx"); uiProbation.setDateFormatString("yyyy-MM-dd"); uiProbation.setFont(APP_FONT); uiProbation.getJCalendar().setTodayButtonVisible(true); } { JLabel label = new JLabel("??"); uiCompanyPanel.add(label, "cell 3 3"); label.setHorizontalAlignment(SwingConstants.RIGHT); label.setFont(APP_FONT); } { uiExpiration = new JDateChooser(); uiCompanyPanel.add(uiExpiration, "cell 4 3 2 1,growx"); uiExpiration.setDateFormatString("yyyy-MM-dd"); uiExpiration.setFont(APP_FONT); uiExpiration.getJCalendar().setLeftButtonText(Employee.EXPIRATION_NO); uiExpiration.getJCalendar().setLeftButtonVisible(true); uiExpiration.getJCalendar().setRightButtonText(Employee.EXPIRATION_LONG); uiExpiration.getJCalendar().setRightButtonVisible(true); } { JLabel label = new JLabel(""); uiCompanyPanel.add(label, "cell 0 4"); label.setHorizontalAlignment(SwingConstants.RIGHT); label.setFont(APP_FONT); } { uiSchool = new LynkTextField(); uiCompanyPanel.add(uiSchool, "cell 1 4 2 1,growx"); } { JLabel label = new JLabel(""); uiCompanyPanel.add(label, "cell 3 4"); label.setHorizontalAlignment(SwingConstants.RIGHT); label.setFont(APP_FONT); } { uiDegree = new JComboBox<String>(); uiCompanyPanel.add(uiDegree, "cell 4 4 2 1,growx"); uiDegree.setMaximumRowCount(12); uiDegree.setModel(new DefaultComboBoxModel<String>(new String[] { "", Employee.DEGREE_A, Employee.DEGREE_B, Employee.DEGREE_C, Employee.DEGREE_D, Employee.DEGREE_E, Employee.DEGREE_F, Employee.DEGREE_G, Employee.DEGREE_H, Employee.DEGREE_I, Employee.DEGREE_J })); uiDegree.setFont(APP_FONT); } { JLabel label = new JLabel(""); uiCompanyPanel.add(label, "cell 0 5"); label.setHorizontalAlignment(SwingConstants.RIGHT); label.setFont(APP_FONT); } { uiMajor = new LynkTextField(); uiCompanyPanel.add(uiMajor, "cell 1 5 2 1,growx"); } { JLabel label = new JLabel(""); label.setHorizontalAlignment(SwingConstants.RIGHT); label.setFont(APP_FONT); uiCompanyPanel.add(label, "cell 3 5"); } { uiGuide = new LynkTextField(); uiCompanyPanel.add(uiGuide, "cell 4 5 2 1,growx"); } { JLabel label = new JLabel("?"); label.setHorizontalAlignment(SwingConstants.RIGHT); label.setFont(APP_FONT_BLOD); uiCompanyPanel.add(label, "cell 0 6"); } { uiPhoneShort = new LynkTextField(); uiPhoneShort.setFont(APP_FONT_BLOD); uiCompanyPanel.add(uiPhoneShort, "cell 1 6 2 1,growx"); } { JLabel label = new JLabel("?"); label.setHorizontalAlignment(SwingConstants.RIGHT); label.setFont(APP_FONT); uiCompanyPanel.add(label, "cell 3 6"); } { uiPerformance = new LynkTextField(); uiCompanyPanel.add(uiPerformance, "cell 4 6 2 1,growx"); } // { // JLabel label = new JLabel("??"); // label.setHorizontalAlignment(SwingConstants.RIGHT); // label.setFont(APP_FONT); // uiCompanyPanel.add(label, "cell 0 7"); // } // { // uiSuspendEnd = new LynkTextField(); // uiCompanyPanel.add(uiSuspendEnd, "cell 1 7 5 1,growx"); // } } { JPanel panel4 = new JPanel(); panel4.setBorder(new EtchedBorder(EtchedBorder.LOWERED, null, null)); panel4.setLayout(new MigLayout("", "[]5[grow]", "[][][][grow][grow]")); uiInfoBasic.add(panel4, "cell 1 0 1 3,grow"); { JLabel label = new JLabel("???"); panel4.add(label, "cell 0 0,grow"); label.setFont(APP_FONT); } { uiSocialCard = new LynkTextField(); panel4.add(uiSocialCard, "cell 1 0,grow"); } { JLabel label = new JLabel("?"); panel4.add(label, "cell 0 1,grow"); label.setFont(APP_FONT); } { uiHousingCard = new LynkTextField(); panel4.add(uiHousingCard, "cell 1 1,grow"); } { JLabel label = new JLabel("??"); panel4.add(label, "cell 0 2,grow"); label.setFont(APP_FONT); } { uiBankCard = new LynkTextField(); panel4.add(uiBankCard, "cell 1 2,grow"); } { JLabel label = new JLabel("?"); panel4.add(label, "cell 0 3,growx,aligny top"); label.setFont(APP_FONT); } { JScrollPane scrollPane = new JScrollPane(); panel4.add(scrollPane, "cell 1 3,grow"); uiWorkExperience = new JTextArea(); uiWorkExperience.setFont(APP_FONT); scrollPane.setViewportView(uiWorkExperience); } { JLabel label = new JLabel(""); panel4.add(label, "cell 0 4,growx,aligny top"); label.setFont(APP_FONT); } { JScrollPane scrollPane = new JScrollPane(); panel4.add(scrollPane, "cell 1 4,grow"); { uiNote = new JTextArea(); uiNote.setFont(APP_FONT); scrollPane.setViewportView(uiNote); } } } } { JPanel uiInfoLeave = new JPanel(); uiInfoLeave.setLayout(new MigLayout("", "[]5[150px]25[]5[150px]", "[][][][grow][]")); uiInfoTab.addTab("??", uiInfoLeave); { uiLabelLeaveDate = new JLabel("?"); uiLabelLeaveDate.setFont(APP_FONT); uiInfoLeave.add(uiLabelLeaveDate, "cell 0 0,grow"); } { uiLeaveDate = new JDateChooser(); uiLeaveDate.setDateFormatString("yyyy-MM-dd"); uiLeaveDate.setFont(APP_FONT); uiLeaveDate.getJCalendar().setTodayButtonVisible(true); uiLeaveDate.getJCalendar().setNullDateButtonVisible(true); uiInfoLeave.add(uiLeaveDate, "cell 1 0,growx,aligny top"); } { uiLabelSocialEnd = new JLabel("??"); uiLabelSocialEnd.setFont(APP_FONT); uiInfoLeave.add(uiLabelSocialEnd, "cell 0 1,grow"); } { uiLabelHousingEnd = new JLabel("?"); uiLabelHousingEnd.setFont(APP_FONT); uiInfoLeave.add(uiLabelHousingEnd, "cell 2 1,grow"); } { uiHousingEndDate = new JDateChooser(); uiHousingEndDate.setDateFormatString("yyyy-MM-dd"); uiHousingEndDate.setFont(APP_FONT); uiHousingEndDate.getJCalendar().setLeftButtonText(""); uiHousingEndDate.getJCalendar().setLeftButtonVisible(true); uiHousingEndDate.getJCalendar().setTodayButtonVisible(true); uiHousingEndDate.getJCalendar().setNullDateButtonVisible(true); uiInfoLeave.add(uiHousingEndDate, "cell 3 1,growx,aligny top"); } { uiLabelLeaveType = new JLabel("?"); uiLabelLeaveType.setFont(APP_FONT); uiInfoLeave.add(uiLabelLeaveType, "cell 0 2,grow"); } { uiSocialEndDate = new JDateChooser(); uiSocialEndDate.setDateFormatString("yyyy-MM-dd"); uiSocialEndDate.setFont(APP_FONT); uiSocialEndDate.getJCalendar().setLeftButtonText(""); uiSocialEndDate.getJCalendar().setLeftButtonVisible(true); uiSocialEndDate.getJCalendar().setTodayButtonVisible(true); uiSocialEndDate.getJCalendar().setNullDateButtonVisible(true); uiInfoLeave.add(uiSocialEndDate, "cell 1 1,growx,aligny top"); } { uiLeaveType = new JComboBox<String>(new DefaultComboBoxModel<String>( new String[] { "", Employee.LEAVE_TYPE_A, Employee.LEAVE_TYPE_B, Employee.LEAVE_TYPE_C, Employee.LEAVE_TYPE_D, Employee.LEAVE_TYPE_E, Employee.LEAVE_TYPE_F, Employee.LEAVE_TYPE_G, Employee.LEAVE_TYPE_H })); uiLeaveType.setMaximumRowCount(10); uiLeaveType.setFont(APP_FONT); uiInfoLeave.add(uiLeaveType, "cell 1 2 3 1,grow"); } { uiLabelLeaveReason = new JLabel("?"); uiLabelLeaveReason.setFont(APP_FONT); uiInfoLeave.add(uiLabelLeaveReason, "cell 0 3,growx,aligny top"); } { JScrollPane scrollPane_2 = new JScrollPane(); uiInfoLeave.add(scrollPane_2, "cell 1 3 3 1,grow"); { uiLeaveReason = new JTextArea(); scrollPane_2.setViewportView(uiLeaveReason); uiLeaveReason.setFont(APP_FONT); } } { JLabel label = new JLabel("??"); label.setHorizontalAlignment(SwingConstants.RIGHT); label.setFont(APP_FONT); uiInfoLeave.add(label, "cell 0 4"); } { uiTimeCardLeaveCertify = new LynkTextField(); uiTimeCardLeaveCertify.setEditable(false); uiInfoLeave.add(uiTimeCardLeaveCertify, "cell 1 4 2 1,growx"); } { JButton uiPrintLeaveCertify = new JButton("???"); uiPrintLeaveCertify.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { uiPrintLeaveCertifyActionPerformed(e); } }); uiPrintLeaveCertify.setToolTipText("???!"); uiPrintLeaveCertify.setFont(APP_FONT); uiPrintLeaveCertify.setFocusable(false); uiInfoLeave.add(uiPrintLeaveCertify, "cell 3 4,alignx right"); } } { JPanel uiInfoSuspendHistory = new JPanel(); uiInfoSuspendHistory.setLayout(new BorderLayout(0, 0)); uiInfoTab.addTab("???", uiInfoSuspendHistory); { JScrollPane scrollPane = new JScrollPane(); uiInfoSuspendHistory.add(scrollPane, BorderLayout.CENTER); { suspendModel = new EmployeeSuspendModel(); uiEmpSuspend = new LynkTable(suspendModel); uiEmpSuspend.addHighlighter(UtilsClient.createAlignHighlighter()); uiEmpSuspend.setAutoResizeMode(LynkTable.AUTO_RESIZE_ALL_COLUMNS); scrollPane.setRowHeaderView(new TableRowHead(uiEmpSuspend)); scrollPane.setViewportView(uiEmpSuspend); } } } { JPanel uiInfoEmpHistory = new JPanel(); uiInfoEmpHistory.setLayout(new BorderLayout(0, 0)); uiInfoTab.addTab("?", uiInfoEmpHistory); { JPanel pane = new JPanel(); pane.setLayout(new MigLayout("", "[][][][100px:100px:100px][]", "[]")); uiInfoEmpHistory.add(pane, BorderLayout.NORTH); { JLabel label = new JLabel(""); label.setFont(APP_FONT); pane.add(label, "cell 0 0"); } { uiHistoryType = new JComboBox<String>(new DefaultComboBoxModel<>( new String[] { "", PraisePunish.TYPE_A, PraisePunish.TYPE_B, PraisePunish.TYPE_C, PraisePunish.TYPE_D, PraisePunish.TYPE_E, PraisePunish.TYPE_F, PraisePunish.TYPE_G, PraisePunish.TYPE_H })); uiHistoryType.setFont(APP_FONT); pane.add(uiHistoryType, "cell 1 0"); } { JLabel label = new JLabel("?"); label.setFont(APP_FONT); pane.add(label, "cell 2 0"); } { uiHistoryOperator = new LynkTextField(); pane.add(uiHistoryOperator, "cell 3 0,growx"); } { JButton uiRefresh = new JButton(""); uiRefresh.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { uiRefreshActionPerformed(e); } }); uiRefresh.setIcon( new ImageIcon(InfoEmployee.class.getResource("/resource/image/refresh.png"))); uiRefresh.setFont(APP_FONT); uiRefresh.setFocusable(false); pane.add(uiRefresh, "cell 4 0"); } } { JScrollPane scrollPane = new JScrollPane(); uiInfoEmpHistory.add(scrollPane, BorderLayout.CENTER); { historyModel = new EmployeeHistoryModel(); uiEmployeeHistory = new LynkTable(historyModel); uiEmployeeHistory.setColumnSize(70, 540, 50, 130, 90); scrollPane.setViewportView(uiEmployeeHistory); scrollPane.setRowHeaderView(new TableRowHead(uiEmployeeHistory)); } } } { JPanel uiInfoJobAdjustment = new JPanel(); uiInfoJobAdjustment.setLayout(new BorderLayout(0, 0)); uiInfoTab.addTab("?", uiInfoJobAdjustment); { JToolBar toolBar = new JToolBar(); toolBar.setFloatable(false); uiInfoJobAdjustment.add(toolBar, BorderLayout.NORTH); { { JButton uiAddJobAdjust = new JButton("?"); uiAddJobAdjust.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { uiAddJobAdjustActionPerformed(e); } }); uiAddJobAdjust.setIcon( new ImageIcon(InfoEmployee.class.getResource("/resource/image/add.png"))); uiAddJobAdjust.setFont(APP_FONT); toolBar.add(uiAddJobAdjust); } } } { JScrollPane scrollPane = new JScrollPane(); uiInfoJobAdjustment.add(scrollPane, BorderLayout.CENTER); { jobAdjustmentModel = new JobAdjustmentModel(); uiJobAdjustment = new LynkTable(jobAdjustmentModel); uiJobAdjustment.setColumnSize(50, 100, 100, 100, 100, 100, 80, 100, 150); scrollPane.setRowHeaderView(new TableRowHead(uiJobAdjustment)); scrollPane.setViewportView(uiJobAdjustment); } } } { JPanel uiInfoPraisePunish = new JPanel(); uiInfoTab.addTab("", uiInfoPraisePunish); uiInfoPraisePunish.setLayout( new MigLayout("", "[]10[grow]30[]10[120]5[]5[120]20[]20[][grow]", "[][grow]")); { uiPraisePunishDateStart = new JDateChooser(); uiPraisePunishDateStart.setFont(APP_FONT); uiPraisePunishDateStart.setDateFormatString("yyyy-MM-dd"); uiInfoPraisePunish.add(uiPraisePunishDateStart, "cell 3 0,growx"); } { uiPraisePunishDateEnd = new JDateChooser(); uiPraisePunishDateEnd.setFont(APP_FONT); uiPraisePunishDateEnd.setDateFormatString("yyyy-MM-dd"); uiInfoPraisePunish.add(uiPraisePunishDateEnd, "cell 5 0,growx"); } JButton uiAddPraisePunish = new JButton(""); uiAddPraisePunish.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { uiAddPraisePunishActionPerformed(e); } }); { JButton uiFindPraisePunish = new JButton(""); uiFindPraisePunish.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { uiFindPraisePunishActionPerformed(e); } }); { JLabel label = new JLabel(""); label.setFont(APP_FONT); uiInfoPraisePunish.add(label, "cell 0 0,alignx trailing"); } { uiPraisePunishType = new JComboBox<String>( new DefaultComboBoxModel<String>(new String[] { "", PraisePunish.TYPE_A, PraisePunish.TYPE_B, PraisePunish.TYPE_C, PraisePunish.TYPE_D, PraisePunish.TYPE_E, PraisePunish.TYPE_F, PraisePunish.TYPE_G })); uiPraisePunishType.setEditable(true); uiPraisePunishType.setFont(APP_FONT); uiInfoPraisePunish.add(uiPraisePunishType, "cell 1 0,growx"); } { JLabel label = new JLabel(""); label.setFont(APP_FONT); uiInfoPraisePunish.add(label, "cell 2 0"); } { JLabel label = new JLabel(""); label.setFont(APP_FONT); uiInfoPraisePunish.add(label, "cell 4 0"); } uiFindPraisePunish.setFocusable(false); uiFindPraisePunish.setIcon( new ImageIcon(InfoEmployee.class.getResource("/resource/image/refresh.png"))); uiFindPraisePunish.setFont(APP_FONT); uiInfoPraisePunish.add(uiFindPraisePunish, "cell 6 0"); } uiAddPraisePunish .setIcon(new ImageIcon(InfoEmployee.class.getResource("/resource/image/add.png"))); uiAddPraisePunish.setFont(APP_FONT); uiAddPraisePunish.setFocusable(false); uiInfoPraisePunish.add(uiAddPraisePunish, "cell 7 0"); JScrollPane scrollPane = new JScrollPane(); uiInfoPraisePunish.add(scrollPane, "cell 0 1 9 1,grow"); { praisePunishModel = new PraisePunishModel( new String[] { PraisePunish.COLUMN_TYPE, PraisePunish.COLUMN_ACTION, PraisePunish.COLUMN_ACTION_DATE, PraisePunish.COLUMN_DEAL, PraisePunish.COLUMN_DEAL_DATE, PraisePunish.COLUMN_NOTE }); uiPraisePunish = new LynkTable(praisePunishModel); uiPraisePunish.setColumnVisible( new String[] { PraisePunish.COLUMN_TYPE, PraisePunish.COLUMN_ACTION, PraisePunish.COLUMN_ACTION_DATE, PraisePunish.COLUMN_DEAL, PraisePunish.COLUMN_DEAL_DATE, PraisePunish.COLUMN_NOTE }); uiPraisePunish.setDefaultRenderer(Object.class, new PraisePunishColorRenderer()); uiPraisePunish.setMouseDoubleClick(new MouseDoubleClick() { @Override public void doubleClick(int index) { if (index != -1) { index = uiPraisePunish.convertRowIndexToModel(index); PraisePunish pp = praisePunishModel.getPp(index); pp = InfoPraisePunish.showdialog(InfoEmployee.this, pp, null); if (pp != null) { praisePunishModel.updatePp(pp); } } } }); scrollPane.setViewportView(uiPraisePunish); scrollPane.setRowHeaderView(new TableRowHead(uiPraisePunish)); } } { JPanel uiPanelVacation = new JPanel(); uiPanelVacation.setLayout(new BorderLayout()); uiInfoTab.addTab("?", uiPanelVacation); { JToolBar uiVacationToolBar = new JToolBar(); uiVacationToolBar.setFloatable(false); uiPanelVacation.add(uiVacationToolBar, BorderLayout.NORTH); { JButton uiVacationRefresh = new JButton(""); uiVacationRefresh.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { uiVacationRefreshActionPerformed(e); } }); uiVacationRefresh.setIcon( new ImageIcon(InfoEmployee.class.getResource("/resource/image/refresh.png"))); uiVacationRefresh.setFocusable(false); uiVacationRefresh.setFont(APP_FONT); uiVacationToolBar.add(uiVacationRefresh); } uiVacationToolBar.addSeparator(); { uiVacationHistoryAdd = new JButton(""); uiVacationHistoryAdd.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { uiVacationAddActionPerformed(e); } }); uiVacationHistoryAdd.setIcon( new ImageIcon(InfoEmployee.class.getResource("/resource/image/add.png"))); uiVacationHistoryAdd.setFocusable(false); uiVacationHistoryAdd.setFont(APP_FONT); uiVacationToolBar.add(uiVacationHistoryAdd); } uiVacationToolBar.addSeparator(); { JButton uiEndLastLeft = new JButton(""); uiEndLastLeft.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { uiEndLastLeftActionPerformed(e); } }); uiEndLastLeft.setIcon( new ImageIcon(InfoEmployee.class.getResource("/resource/image/add.png"))); uiEndLastLeft.setFocusable(false); uiEndLastLeft.setFont(APP_FONT); uiVacationToolBar.add(uiEndLastLeft); } } { JPanel uiPanelVacationInfo = new JPanel(); uiPanelVacation.add(uiPanelVacationInfo, BorderLayout.CENTER); uiPanelVacationInfo.setLayout(new MigLayout("", "[grow]", "[][grow]")); JPanel paneAv = new JPanel(); uiPanelVacationInfo.add(paneAv, "cell 0 0,grow"); paneAv.setLayout(new MigLayout("", "[][grow]50[][grow]", "[][][]")); { uiVacationStartEnd = new JLabel("Time"); uiVacationStartEnd.setHorizontalAlignment(SwingConstants.CENTER); paneAv.add(uiVacationStartEnd, "cell 0 0 4 1,growx"); uiVacationStartEnd.setForeground(Color.BLUE); uiVacationStartEnd.setFont(APP_FONT.deriveFont(16f)); } { JLabel labe = new JLabel(":"); paneAv.add(labe, "cell 0 1"); labe.setFont(APP_FONT.deriveFont(16f)); } { uiLastTotal = new JLabel(""); paneAv.add(uiLastTotal, "cell 1 1,alignx left"); uiLastTotal.setForeground(Color.BLUE); uiLastTotal.setFont(APP_FONT.deriveFont(16f)); } { JLabel labe = new JLabel(":"); paneAv.add(labe, "cell 2 1"); labe.setFont(APP_FONT.deriveFont(16f)); } { uiLastLeft = new JLabel(""); paneAv.add(uiLastLeft, "cell 3 1,alignx left"); uiLastLeft.setForeground(Color.BLUE); uiLastLeft.setFont(APP_FONT.deriveFont(16f)); } { JLabel labe = new JLabel(":"); paneAv.add(labe, "cell 0 2"); labe.setFont(APP_FONT.deriveFont(16f)); } { uiCurrentTotal = new JLabel(""); paneAv.add(uiCurrentTotal, "cell 1 2,alignx left"); uiCurrentTotal.setForeground(Color.BLUE); uiCurrentTotal.setFont(APP_FONT.deriveFont(16f)); } { JLabel labe = new JLabel("?:"); paneAv.add(labe, "cell 2 2"); labe.setFont(APP_FONT.deriveFont(16f)); } { uiLeftHours = new JLabel(""); paneAv.add(uiLeftHours, "cell 3 2,alignx left"); uiLeftHours.setForeground(Color.BLUE); uiLeftHours.setFont(APP_FONT.deriveFont(16f)); } JScrollPane scrollPane = new JScrollPane(); uiPanelVacationInfo.add(scrollPane, "cell 0 1,grow"); { attendanceVacationModel = new AttendanceVacationHistoryModel(); uiAttendanceVacationHistory = new LynkTable(attendanceVacationModel); uiAttendanceVacationHistory.setAutoResizeMode(LynkTable.AUTO_RESIZE_ALL_COLUMNS); scrollPane.setViewportView(uiAttendanceVacationHistory); scrollPane.setRowHeaderView(new TableRowHead(uiAttendanceVacationHistory)); } } } } } }