List of usage examples for javax.swing ButtonGroup add
public void add(AbstractButton b)
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(//from w w w . j a v a 2s . c om "<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:be.ugent.maf.cellmissy.gui.controller.analysis.singlecell.AngleDirectController.java
/** * Initialize the main view./*from w w w. j a v a2 s . c o m*/ */ private void initAngleDirectPanel() { // initialize the main view angleDirectPanel = new AngleDirectPanel(); // initialize the dataTable dataTable = new JTable(); JScrollPane scrollPane = new JScrollPane(dataTable); //the table will take all the viewport height available dataTable.setFillsViewportHeight(true); scrollPane.getViewport().setBackground(Color.white); dataTable.getTableHeader().setReorderingAllowed(false); //row selection must be false && column selection true to be able to select through columns dataTable.setColumnSelectionAllowed(true); dataTable.setRowSelectionAllowed(false); angleDirectPanel.getDataTablePanel().add(scrollPane); //create a ButtonGroup for the radioButtons used for analysis ButtonGroup radioButtonGroup = new ButtonGroup(); //adding buttons to a ButtonGroup automatically deselect one when another one gets selected radioButtonGroup.add(angleDirectPanel.getInstTurnAngleRadioButton()); radioButtonGroup.add(angleDirectPanel.getTrackTurnAngleRadioButton()); // radioButtonGroup.add(angleDirectPanel.getDynamicDirectRatioRadioButton()); // radioButtonGroup.add(angleDirectPanel.getEndPointDirectRatioRadioButton()); /** * Add action listeners */ // show instantaneous turning angles angleDirectPanel.getInstTurnAngleRadioButton().addActionListener((ActionEvent e) -> { PlateCondition currentCondition = singleCellPreProcessingController.getCurrentCondition(); //check that a condition is selected if (currentCondition != null) { showInstAngleInTable(currentCondition); plotHistTA(currentCondition); plotPolarTA(currentCondition); plotRoseTA(currentCondition); plotCompassTA(currentCondition); } }); // show and plot averaged-track turning angles angleDirectPanel.getTrackTurnAngleRadioButton().addActionListener((ActionEvent e) -> { PlateCondition currentCondition = singleCellPreProcessingController.getCurrentCondition(); //check that a condition is selected if (currentCondition != null) { showTrackAngleInTable(currentCondition); plotHistTrackTA(currentCondition); plotPolarTrackTA(currentCondition); plotRoseTrackTA(currentCondition); plotCompassTrackTA(currentCondition); } }); /** * */ angleDirectPanel.getSaveChartToPdfButton().addActionListener((ActionEvent e) -> { ChartPanel chartPanel = rosePlotChartPanels.get(2); JFreeChart chart = chartPanel.getChart(); if (chart != null) { try { // create the PDF report file createPdf(chart); } catch (IOException ex) { LOG.error(ex.getMessage(), ex); } } }); // // show dynamic directionality ratios // angleDirectPanel.getDynamicDirectRatioRadioButton().addActionListener((ActionEvent e) -> { // PlateCondition currentCondition = singleCellPreProcessingController.getCurrentCondition(); // //check that a condition is selected // if (currentCondition != null) { // // } // }); // // // show end-point directionality ratios // angleDirectPanel.getEndPointDirectRatioRadioButton().addActionListener((ActionEvent e) -> { // PlateCondition currentCondition = singleCellPreProcessingController.getCurrentCondition(); // //check that a condition is selected // if (currentCondition != null) { // // } // }); //select as default first button angleDirectPanel.getInstTurnAngleRadioButton().setSelected(true); // add view to parent panel singleCellPreProcessingController.getSingleCellAnalysisPanel().getAngleDirectParentPanel() .add(angleDirectPanel, gridBagConstraints); angleDirectPanel.getTurningAngleParentPanel().add(turningAnglePanel, gridBagConstraints); }
From source file:com.att.aro.ui.view.menu.tools.RegexWizard.java
private JPanel getMatcherPanel() { if (matcherPanel == null) { matcherPanel = new JPanel(); matcherPanel.setLayout(new GridBagLayout()); Color bgColor = matcherPanel.getBackground(); matcherPanel.setBorder(new RoundedBorderPanel(bgColor)); GridBagConstraints constraint = new GridBagConstraints(); constraint.gridx = 0;// ww w . ja v a2 s .c o m constraint.gridy = 0; constraint.insets = new Insets(0, 0, 0, 0); constraint.anchor = GridBagConstraints.FIRST_LINE_START; constraint.weightx = 0.5; ignore = new JRadioButton(ResourceBundleHelper.getMessageString("videoTab.ignore")); match = new JRadioButton(ResourceBundleHelper.getMessageString("videoTab.match")); ButtonGroup groupBtn = new ButtonGroup(); groupBtn.add(ignore); groupBtn.add(match); keep = new JCheckBox(ResourceBundleHelper.getMessageString("videoTab.keep")); alpha = new JCheckBox(ResourceBundleHelper.getMessageString("videoTab.alpha")); characters = new JCheckBox(ResourceBundleHelper.getMessageString("videoTab.characters")); charField = new JTextField(20); numeric = new JCheckBox(ResourceBundleHelper.getMessageString("videoTab.numeric")); lengthMin = new JCheckBox(ResourceBundleHelper.getMessageString("videoTab.min.length")); lengthMax = new JCheckBox(ResourceBundleHelper.getMessageString("videoTab.max.length")); lengthMinField = new JTextField(10); lengthMaxField = new JTextField(10); matcherPanel.add(ignore, constraint); constraint.gridy = 1; constraint.anchor = GridBagConstraints.WEST; matcherPanel.add(match, constraint); constraint.anchor = GridBagConstraints.EAST; enterBtn = new JButton(ResourceBundleHelper.getMessageString("videoTab.enter")); enterBtn.setName(ResourceBundleHelper.getMessageString("videoTab.enter")); enterBtn.addActionListener(this); matcherPanel.add(enterBtn, constraint); constraint.anchor = GridBagConstraints.WEST; constraint.gridy = 2; matcherPanel.add(keep, constraint); constraint.gridy = 3; matcherPanel.add(alpha, constraint); constraint.gridy = 4; JPanel panelChar = new JPanel(new FlowLayout()); panelChar.add(characters); panelChar.add(charField); matcherPanel.add(panelChar, constraint); constraint.gridy = 5; matcherPanel.add(numeric, constraint); constraint.gridy = 6; JPanel panelNumericLength = new JPanel(); panelNumericLength.setLayout(new BoxLayout(panelNumericLength, BoxLayout.Y_AXIS)); JPanel panelMinLength = new JPanel(new FlowLayout()); panelMinLength.add(lengthMin); panelMinLength.add(lengthMinField); panelNumericLength.add(panelMinLength); JPanel panelMaxLength = new JPanel(new FlowLayout()); panelMaxLength.add(lengthMax); panelMaxLength.add(lengthMaxField); panelNumericLength.add(panelMaxLength); matcherPanel.add(panelNumericLength, constraint); constraint.weighty = 1; matcherPanel.add(new JPanel(), constraint); } return matcherPanel; }
From source file:org.broad.igv.peaks.PeakTrackMenu.java
public void addColorByItems() { addSeparator();//from w ww . java 2 s . c o m add(new JLabel("Color by")); ButtonGroup group = new ButtonGroup(); colorByScoreMI = new JRadioButtonMenuItem("Score"); colorByScoreMI.setSelected(PeakTrack.getColorOption() == PeakTrack.ColorOption.SCORE); colorByScoreMI.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent evt) { PeakTrack.setShadeOption(PeakTrack.ColorOption.SCORE); IGV.getInstance().repaint(); } }); colorByFoldMI = new JRadioButtonMenuItem("Fold change"); colorByFoldMI.setSelected(PeakTrack.getColorOption() == PeakTrack.ColorOption.FOLD_CHANGE); colorByFoldMI.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent evt) { PeakTrack.setShadeOption(PeakTrack.ColorOption.FOLD_CHANGE); IGV.getInstance().repaint(); } }); add(colorByScoreMI); add(colorByFoldMI); group.add(colorByScoreMI); group.add(colorByFoldMI); }
From source file:TextureByReference.java
public JPanel buildGui() { flipB = new JCheckBox("flip image", true); flipB.addItemListener(this); javax.swing.Box flipBox = new javax.swing.Box(BoxLayout.Y_AXIS); flipBox.add(flipB);/*from w ww . j ava 2 s. c o m*/ Component strut1 = flipBox.createVerticalStrut(flipB.getPreferredSize().height); Component strut2 = flipBox.createVerticalStrut(flipB.getPreferredSize().height); Component strut3 = flipBox.createVerticalStrut(flipB.getPreferredSize().height); Component strut4 = flipBox.createVerticalStrut(flipB.getPreferredSize().height); Component strut5 = flipBox.createVerticalStrut(flipB.getPreferredSize().height); flipBox.add(strut1); flipBox.add(strut2); flipBox.add(strut3); flipBox.add(strut4); flipBox.add(strut5); yUp = new JRadioButton("y up"); yUp.addActionListener(this); yUp.setSelected(true); yDown = new JRadioButton("y down"); yDown.addActionListener(this); ButtonGroup yGroup = new ButtonGroup(); yGroup.add(yUp); yGroup.add(yDown); JLabel yLabel = new JLabel("Image Orientation:"); javax.swing.Box yBox = new javax.swing.Box(BoxLayout.Y_AXIS); yBox.add(yLabel); yBox.add(yUp); yBox.add(yDown); strut1 = yBox.createVerticalStrut(yUp.getPreferredSize().height); strut2 = yBox.createVerticalStrut(yUp.getPreferredSize().height); strut3 = yBox.createVerticalStrut(yUp.getPreferredSize().height); yBox.add(strut1); yBox.add(strut2); yBox.add(strut3); texByRef = new JRadioButton("by reference"); texByRef.addActionListener(this); texByRef.setSelected(true); texByCopy = new JRadioButton("by copy"); texByCopy.addActionListener(this); ButtonGroup texGroup = new ButtonGroup(); texGroup.add(texByRef); texGroup.add(texByCopy); JLabel texLabel = new JLabel("Texture:*"); javax.swing.Box texBox = new javax.swing.Box(BoxLayout.Y_AXIS); texBox.add(texLabel); texBox.add(texByRef); texBox.add(texByCopy); strut1 = texBox.createVerticalStrut(texByRef.getPreferredSize().height); strut2 = texBox.createVerticalStrut(texByRef.getPreferredSize().height); strut3 = texBox.createVerticalStrut(texByRef.getPreferredSize().height); texBox.add(strut1); texBox.add(strut2); texBox.add(strut3); geomByRef = new JRadioButton("by reference"); geomByRef.addActionListener(this); geomByRef.setSelected(true); geomByCopy = new JRadioButton("by copy"); geomByCopy.addActionListener(this); ButtonGroup geomGroup = new ButtonGroup(); geomGroup.add(geomByRef); geomGroup.add(geomByCopy); JLabel geomLabel = new JLabel("Geometry:"); javax.swing.Box geomBox = new javax.swing.Box(BoxLayout.Y_AXIS); geomBox.add(geomLabel); geomBox.add(geomByRef); geomBox.add(geomByCopy); strut1 = geomBox.createVerticalStrut(geomByRef.getPreferredSize().height); strut2 = geomBox.createVerticalStrut(geomByRef.getPreferredSize().height); strut3 = geomBox.createVerticalStrut(geomByRef.getPreferredSize().height); geomBox.add(strut1); geomBox.add(strut2); geomBox.add(strut3); img4ByteABGR = new JRadioButton("TYPE_4BYTE_ABGR"); img4ByteABGR.addActionListener(this); img4ByteABGR.setSelected(true); img3ByteBGR = new JRadioButton("TYPE_3BYTE_BGR"); img3ByteBGR.addActionListener(this); imgIntARGB = new JRadioButton("TYPE_INT_ARGB"); imgIntARGB.addActionListener(this); imgCustomRGBA = new JRadioButton("TYPE_CUSTOM RGBA"); imgCustomRGBA.addActionListener(this); imgCustomRGB = new JRadioButton("TYPE_CUSTOM RGB"); imgCustomRGB.addActionListener(this); ButtonGroup imgGroup = new ButtonGroup(); imgGroup.add(img4ByteABGR); imgGroup.add(img3ByteBGR); imgGroup.add(imgIntARGB); imgGroup.add(imgCustomRGBA); imgGroup.add(imgCustomRGB); JLabel imgLabel = new JLabel("Image Type:*"); javax.swing.Box imgBox = new javax.swing.Box(BoxLayout.Y_AXIS); imgBox.add(imgLabel); imgBox.add(img4ByteABGR); imgBox.add(img3ByteBGR); imgBox.add(imgIntARGB); imgBox.add(imgCustomRGBA); imgBox.add(imgCustomRGB); javax.swing.Box topBox = new javax.swing.Box(BoxLayout.X_AXIS); topBox.add(flipBox); topBox.add(texBox); topBox.add(geomBox); topBox.add(yBox); Component strut = topBox.createRigidArea(new Dimension(10, 10)); topBox.add(strut); topBox.add(imgBox); frameDelay = new JSlider(0, 50, 0); frameDelay.addChangeListener(this); frameDelay.setSnapToTicks(true); frameDelay.setPaintTicks(true); frameDelay.setPaintLabels(true); frameDelay.setMajorTickSpacing(10); frameDelay.setMinorTickSpacing(1); frameDelay.setValue(20); JLabel delayL = new JLabel("frame delay"); javax.swing.Box delayBox = new javax.swing.Box(BoxLayout.X_AXIS); delayBox.add(delayL); delayBox.add(frameDelay); animationB = new JButton(" stop animation "); animationB.addActionListener(this); JLabel texInfo1 = new JLabel("*To use ImageComponent by reference feature, use TYPE_4BYTE_ABGR on Solaris"); JLabel texInfo2 = new JLabel("and TYPE_3BYTE_BGR on Windows"); JPanel buttonP = new JPanel(); GridBagLayout gridbag = new GridBagLayout(); GridBagConstraints c = new GridBagConstraints(); buttonP.setLayout(gridbag); c.anchor = GridBagConstraints.CENTER; c.gridwidth = GridBagConstraints.REMAINDER; gridbag.setConstraints(topBox, c); buttonP.add(topBox); gridbag.setConstraints(delayBox, c); buttonP.add(delayBox); gridbag.setConstraints(animationB, c); buttonP.add(animationB); gridbag.setConstraints(texInfo1, c); buttonP.add(texInfo1); gridbag.setConstraints(texInfo2, c); buttonP.add(texInfo2); return buttonP; }
From source file:FileChooserDemo.java
public FileChooserDemo() { UIManager.LookAndFeelInfo[] installedLafs = UIManager.getInstalledLookAndFeels(); for (UIManager.LookAndFeelInfo lafInfo : installedLafs) { try {/*from ww w . j a v a2 s . co m*/ Class lnfClass = Class.forName(lafInfo.getClassName()); LookAndFeel laf = (LookAndFeel) (lnfClass.newInstance()); if (laf.isSupportedLookAndFeel()) { String name = lafInfo.getName(); supportedLaFs.add(new SupportedLaF(name, laf)); } } catch (Exception e) { // If ANYTHING weird happens, don't add it continue; } } setLayout(new BoxLayout(this, BoxLayout.Y_AXIS)); chooser = new JFileChooser(); previewer = new FilePreviewer(chooser); // Create Custom FileView fileView = new ExampleFileView(); // fileView.putIcon("jpg", new ImageIcon(getClass().getResource("/resources/images/jpgIcon.jpg"))); // fileView.putIcon("gif", new ImageIcon(getClass().getResource("/resources/images/gifIcon.gif"))); // create a radio listener to listen to option changes OptionListener optionListener = new OptionListener(); // Create options openRadioButton = new JRadioButton("Open"); openRadioButton.setSelected(true); openRadioButton.addActionListener(optionListener); saveRadioButton = new JRadioButton("Save"); saveRadioButton.addActionListener(optionListener); customButton = new JRadioButton("Custom"); customButton.addActionListener(optionListener); customField = new JTextField(8) { public Dimension getMaximumSize() { return new Dimension(getPreferredSize().width, getPreferredSize().height); } }; customField.setText("Doit"); customField.setAlignmentY(JComponent.TOP_ALIGNMENT); customField.setEnabled(false); customField.addActionListener(optionListener); ButtonGroup group1 = new ButtonGroup(); group1.add(openRadioButton); group1.add(saveRadioButton); group1.add(customButton); // filter buttons showAllFilesFilterCheckBox = new JCheckBox("Show \"All Files\" Filter"); showAllFilesFilterCheckBox.addActionListener(optionListener); showAllFilesFilterCheckBox.setSelected(true); showImageFilesFilterCheckBox = new JCheckBox("Show JPG and GIF Filters"); showImageFilesFilterCheckBox.addActionListener(optionListener); showImageFilesFilterCheckBox.setSelected(false); accessoryCheckBox = new JCheckBox("Show Preview"); accessoryCheckBox.addActionListener(optionListener); accessoryCheckBox.setSelected(false); // more options setHiddenCheckBox = new JCheckBox("Show Hidden Files"); setHiddenCheckBox.addActionListener(optionListener); showFullDescriptionCheckBox = new JCheckBox("With File Extensions"); showFullDescriptionCheckBox.addActionListener(optionListener); showFullDescriptionCheckBox.setSelected(true); showFullDescriptionCheckBox.setEnabled(false); useFileViewCheckBox = new JCheckBox("Use FileView"); useFileViewCheckBox.addActionListener(optionListener); useFileViewCheckBox.setSelected(false); useEmbedInWizardCheckBox = new JCheckBox("Embed in Wizard"); useEmbedInWizardCheckBox.addActionListener(optionListener); useEmbedInWizardCheckBox.setSelected(false); useControlsCheckBox = new JCheckBox("Show Control Buttons"); useControlsCheckBox.addActionListener(optionListener); useControlsCheckBox.setSelected(true); enableDragCheckBox = new JCheckBox("Enable Dragging"); enableDragCheckBox.addActionListener(optionListener); // File or Directory chooser options ButtonGroup group3 = new ButtonGroup(); justFilesRadioButton = new JRadioButton("Just Select Files"); justFilesRadioButton.setSelected(true); group3.add(justFilesRadioButton); justFilesRadioButton.addActionListener(optionListener); justDirectoriesRadioButton = new JRadioButton("Just Select Directories"); group3.add(justDirectoriesRadioButton); justDirectoriesRadioButton.addActionListener(optionListener); bothFilesAndDirectoriesRadioButton = new JRadioButton("Select Files or Directories"); group3.add(bothFilesAndDirectoriesRadioButton); bothFilesAndDirectoriesRadioButton.addActionListener(optionListener); singleSelectionRadioButton = new JRadioButton("Single Selection", true); singleSelectionRadioButton.addActionListener(optionListener); multiSelectionRadioButton = new JRadioButton("Multi Selection"); multiSelectionRadioButton.addActionListener(optionListener); ButtonGroup group4 = new ButtonGroup(); group4.add(singleSelectionRadioButton); group4.add(multiSelectionRadioButton); // Create show button showButton = new JButton("Show FileChooser"); showButton.addActionListener(this); showButton.setMnemonic('s'); // Create laf combo box lafComboBox = new JComboBox(supportedLaFs); lafComboBox.setEditable(false); lafComboBox.addActionListener(optionListener); // ******************************************************** // ******************** Dialog Type *********************** // ******************************************************** JPanel control1 = new InsetPanel(insets); control1.setBorder(BorderFactory.createTitledBorder("Dialog Type")); control1.setLayout(new BoxLayout(control1, BoxLayout.Y_AXIS)); control1.add(Box.createRigidArea(vpad20)); control1.add(openRadioButton); control1.add(Box.createRigidArea(vpad7)); control1.add(saveRadioButton); control1.add(Box.createRigidArea(vpad7)); control1.add(customButton); control1.add(Box.createRigidArea(vpad4)); JPanel fieldWrapper = new JPanel(); fieldWrapper.setLayout(new BoxLayout(fieldWrapper, BoxLayout.X_AXIS)); fieldWrapper.setAlignmentX(Component.LEFT_ALIGNMENT); fieldWrapper.add(Box.createRigidArea(hpad10)); fieldWrapper.add(Box.createRigidArea(hpad10)); fieldWrapper.add(customField); control1.add(fieldWrapper); control1.add(Box.createRigidArea(vpad20)); control1.add(Box.createGlue()); // ******************************************************** // ***************** Filter Controls ********************** // ******************************************************** JPanel control2 = new InsetPanel(insets); control2.setBorder(BorderFactory.createTitledBorder("Filter Controls")); control2.setLayout(new BoxLayout(control2, BoxLayout.Y_AXIS)); control2.add(Box.createRigidArea(vpad20)); control2.add(showAllFilesFilterCheckBox); control2.add(Box.createRigidArea(vpad7)); control2.add(showImageFilesFilterCheckBox); control2.add(Box.createRigidArea(vpad4)); JPanel checkWrapper = new JPanel(); checkWrapper.setLayout(new BoxLayout(checkWrapper, BoxLayout.X_AXIS)); checkWrapper.setAlignmentX(Component.LEFT_ALIGNMENT); checkWrapper.add(Box.createRigidArea(hpad10)); checkWrapper.add(Box.createRigidArea(hpad10)); checkWrapper.add(showFullDescriptionCheckBox); control2.add(checkWrapper); control2.add(Box.createRigidArea(vpad20)); control2.add(Box.createGlue()); // ******************************************************** // ****************** Display Options ********************* // ******************************************************** JPanel control3 = new InsetPanel(insets); control3.setBorder(BorderFactory.createTitledBorder("Display Options")); control3.setLayout(new BoxLayout(control3, BoxLayout.Y_AXIS)); control3.add(Box.createRigidArea(vpad20)); control3.add(setHiddenCheckBox); control3.add(Box.createRigidArea(vpad7)); control3.add(useFileViewCheckBox); control3.add(Box.createRigidArea(vpad7)); control3.add(accessoryCheckBox); control3.add(Box.createRigidArea(vpad7)); control3.add(useEmbedInWizardCheckBox); control3.add(Box.createRigidArea(vpad7)); control3.add(useControlsCheckBox); control3.add(Box.createRigidArea(vpad7)); control3.add(enableDragCheckBox); control3.add(Box.createRigidArea(vpad20)); control3.add(Box.createGlue()); // ******************************************************** // ************* File & Directory Options ***************** // ******************************************************** JPanel control4 = new InsetPanel(insets); control4.setBorder(BorderFactory.createTitledBorder("File and Directory Options")); control4.setLayout(new BoxLayout(control4, BoxLayout.Y_AXIS)); control4.add(Box.createRigidArea(vpad20)); control4.add(justFilesRadioButton); control4.add(Box.createRigidArea(vpad7)); control4.add(justDirectoriesRadioButton); control4.add(Box.createRigidArea(vpad7)); control4.add(bothFilesAndDirectoriesRadioButton); control4.add(Box.createRigidArea(vpad20)); control4.add(singleSelectionRadioButton); control4.add(Box.createRigidArea(vpad7)); control4.add(multiSelectionRadioButton); control4.add(Box.createRigidArea(vpad20)); control4.add(Box.createGlue()); // ******************************************************** // **************** Look & Feel Switch ******************** // ******************************************************** JPanel panel = new JPanel(); panel.add(new JLabel("Look and Feel: ")); panel.add(lafComboBox); panel.add(showButton); // ******************************************************** // ****************** Wrap 'em all up ********************* // ******************************************************** JPanel wrapper = new JPanel(); wrapper.setLayout(new BoxLayout(wrapper, BoxLayout.X_AXIS)); add(Box.createRigidArea(vpad20)); wrapper.add(Box.createRigidArea(hpad10)); wrapper.add(Box.createRigidArea(hpad10)); wrapper.add(control1); wrapper.add(Box.createRigidArea(hpad10)); wrapper.add(control2); wrapper.add(Box.createRigidArea(hpad10)); wrapper.add(control3); wrapper.add(Box.createRigidArea(hpad10)); wrapper.add(control4); wrapper.add(Box.createRigidArea(hpad10)); wrapper.add(Box.createRigidArea(hpad10)); add(wrapper); add(Box.createRigidArea(vpad20)); add(panel); add(Box.createRigidArea(vpad20)); }
From source file:burlov.ultracipher.swing.SwingGuiApplication.java
private JMenuBar createMenuBar() { JMenuBar bar = new JMenuBar(); JMenu menu = null;//from w ww. j a v a 2 s . co m /* * 'File' Menue */ menu = new JMenu("File"); menu.setMnemonic(KeyEvent.VK_F); bar.add(menu); JMenuItem item = new JMenuItem("Save database"); item.setAccelerator(KeyStroke.getKeyStroke("control S")); item.setMnemonic(KeyEvent.VK_S); item.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { saveDatabase(); } }); menu.add(item); item = new JMenuItem("Download database"); item.setMnemonic(KeyEvent.VK_L); item.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { downloadAndMergeData(); } }); menu.add(item); item = new JMenuItem("Edit sync account"); item.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { editSyncAccount(); } }); menu.add(item); menu.add(new JSeparator()); JMenu submenu = new JMenu("Import"); menu.add(submenu); item = new JMenuItem("From CSV"); item.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { importCSV(); } }); submenu.add(item); submenu = new JMenu("Export"); menu.add(submenu); item = new JMenuItem("As CSV"); item.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { exportCSV(); } }); submenu.add(item); item = new JMenuItem("Change passphrase"); menu.add(item); item.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { changePassword(); } }); /* * 'Edit' Menue */ menu = new JMenu("Edit"); menu.setMnemonic(KeyEvent.VK_E); bar.add(menu); item = menu.add(mainPanel.getNewEntryAction()); item.setMnemonic(KeyEvent.VK_N); item = menu.add(mainPanel.getDeleteEntryAction()); item.setMnemonic(KeyEvent.VK_D); menu.add(new JSeparator()); menu = new JMenu("Tools"); // item = new JMenuItem("Passwort generator"); // menu.add(item); // item.addActionListener(new ActionListener() { // // @Override // public void actionPerformed(ActionEvent e) { // passGenerator.setVisible(false); // passGenerator.setLocationRelativeTo(getMainFrame()); // passGenerator.setVisible(true); // } // }); item = new JMenuItem("Screen keyboard"); menu.add(item); item.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { screenKeyboard.setLocationRelativeTo(getMainFrame()); screenKeyboard.setVisible(true); } }); item = new JMenuItem("File digester"); menu.add(item); item.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { digester.setLocationRelativeTo(getMainFrame()); digester.setVisible(true); } }); bar.add(menu); /* * 'Help' Menue */ menu = new JMenu("Help"); menu.setMnemonic(KeyEvent.VK_H); bar.add(menu); item = new JMenuItem("Performance test"); menu.add(item); item.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { measurePerformance(); } }); item = new JMenuItem("System info"); menu.add(item); item.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { showSystemInfo(); } }); item = new JMenuItem("About"); menu.add(item); item.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { String text = "<html>Ultracipher 6.1<br>(C) Copyright 2015 Paul Burlov<br><br>" + "Encryption strength: 768Bit (6 x 128Bit keys)<br>Cipher cascade: AES/Twofish/Serpent/CAST6/SEED/Camellia" + "<br>Encryption mode: Two pass CBC" + "<br>Key derivation algorithm: SCrypt with N=2^14,P=8,R=1<br><br> " + "This product includes software developed by the<br>" + "<ul><li>Apache Software Foundation " + "<a href='http://www.apache.org'>http://www.apache.org</a>" + "<li>Legion of the Bouncy Castle <a href='http://bouncycastle.org/'>http://bouncycastle.org</a>" + "<li>Project SwingX" + "<li>Bytecode Pty Ltd." + "</ul></html>"; JOptionPane.showMessageDialog(getMainFrame(), text, "", JOptionPane.INFORMATION_MESSAGE, getAppIcon()); } }); bar.add(Box.createHorizontalGlue()); menu = new JMenu("Keyboard"); ButtonGroup group = new ButtonGroup(); JRadioButtonMenuItem radioitem = new JRadioButtonMenuItem("System"); radioitem.setSelected(true); group.add(radioitem); radioitem.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { translator.resetMapping(); } }); menu.add(radioitem); radioitem = new JRadioButtonMenuItem("Futhark runes"); group.add(radioitem); radioitem.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { translator.initForFuthark(); } }); menu.add(radioitem); radioitem = new JRadioButtonMenuItem("Anglo-Saxon runes"); group.add(radioitem); radioitem.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { translator.initForAngloSaxon(); } }); menu.add(radioitem); bar.add(menu); // bar.add(Box.createHorizontalGlue()); // bar.add(new PassGeneratorPanel()); return bar; }
From source file:org.pf.midea.MainUI.java
private void initComponents() { // JFormDesigner - Component initialization - DO NOT MODIFY //GEN-BEGIN:initComponents menuMain = new JMenuBar(); menuFile = new JMenu(); menuItemQuit = new JMenuItem(); menuTools = new JMenu(); menuConstellations = new JMenu(); menuItemASK = new JMenuItem(); menuItemFSK = new JMenuItem(); menuItemBPSK = new JMenuItem(); menuItemQPSK = new JMenuItem(); menuItem8PSK = new JMenuItem(); menuItem16PSK = new JMenuItem(); menuItem32PSK = new JMenuItem(); menuItem16QAM = new JMenuItem(); menuItem32QAM = new JMenuItem(); menuItem64QAM = new JMenuItem(); menuItem256QAM = new JMenuItem(); menuHelp = new JMenu(); menuItemAbout = new JMenuItem(); labelSource = new JLabel(); SourceCell[] sourceCells = { new SourceCell(PlanStates.SourceType.ST_TEST), new SourceCell(PlanStates.SourceType.ST_RANDOM) }; chooserSource = new JComboBox(sourceCells); chooserSource.setRenderer(new SourceCellRenderer()); buttonAddToPlan = new JButton(); panelPlan = new JPanel(); scrollPane1 = new JScrollPane(); listPlan = new JList(); labelCode = new JLabel(); CodeCell[] codeCells = { new CodeCell(PlanStates.CodeType.CT_NONE), new CodeCell(PlanStates.CodeType.CT_HAMMING74), new CodeCell(PlanStates.CodeType.CT_CYCLIC), new CodeCell(PlanStates.CodeType.CT_BCH155) }; chooserCode = new JComboBox(codeCells); chooserCode.setRenderer(new CodeCellRenderer()); labelModulation = new JLabel(); ModulationCell[] modulationCells = { new ModulationCell(PlanStates.ModulationType.MT_ASK), new ModulationCell(PlanStates.ModulationType.MT_FSK), new ModulationCell(PlanStates.ModulationType.MT_BPSK), new ModulationCell(PlanStates.ModulationType.MT_QPSK), new ModulationCell(PlanStates.ModulationType.MT_8PSK), new ModulationCell(PlanStates.ModulationType.MT_16PSK), new ModulationCell(PlanStates.ModulationType.MT_32PSK), new ModulationCell(PlanStates.ModulationType.MT_16QAM), new ModulationCell(PlanStates.ModulationType.MT_32QAM), new ModulationCell(PlanStates.ModulationType.MT_64QAM), new ModulationCell(PlanStates.ModulationType.MT_256QAM) }; chooserModulation = new JComboBox(modulationCells); chooserModulation.setRenderer(new ModulationCellRenderer()); labelChannel = new JLabel(); ChannelCell[] channelCells = { new ChannelCell(PlanStates.ChannelType.CHT_AWGN), new ChannelCell(PlanStates.ChannelType.CHT_RAYLEIGH) }; chooserChannel = new JComboBox(channelCells); chooserChannel.setRenderer(new ChannelCellRenderer()); buttonClearPlan = new JButton(); labelErrors = new JLabel(); ErrorsCell[] errorCells = { new ErrorsCell(PlanStates.ErrorsType.ET_SER), new ErrorsCell(PlanStates.ErrorsType.ET_BER) }; chooserErrors = new JComboBox(errorCells); chooserErrors.setRenderer(new ErrorsCellRenderer()); labelLineWidth = new JLabel(); spinnerLineWidth = new JSpinner(); buttonRemoveFromPlan = new JButton(); labelLineColor = new JLabel(); ColorCell[] colorCells = { new ColorCell(null), new ColorCell(Color.black), new ColorCell(Color.red), new ColorCell(Color.green), new ColorCell(Color.blue) }; chooserLineColor = new JComboBox(colorCells); chooserLineColor.setRenderer(new ColorCellRenderer()); labelHSquare = new JLabel(); spinnerHSquareLow = new JSpinner(); labelEllipsis = new JLabel(); spinnerHSquareHigh = new JSpinner(); panelInner1 = new JPanel(); labelHSquareStep = new JLabel(); spinnerHSquareStep = new JSpinner(); labelMeasurementUnit = new JLabel(); radioButtonMeasurementUnitTimes = new JRadioButton(); radioButtonMeasurementUnitdB = new JRadioButton(); buttonRunSimulation = new JButton(); labelIterations = new JLabel(); spinnerIterations = new JSpinner(); checkBoxShowLineNumbers = new JCheckBox(); tabbedPaneResults = new JTabbedPane(); panelChart = new JPanel(); panelNumeric = new JPanel(); scrollPane2 = new JScrollPane(); textAreaNumeric = new JTextArea(); progressBar = new JProgressBar(); //======== this ======== setLayout(new FormLayout("3*(default, $lcgap), 36dlu, $lcgap, 122dlu:grow", "[21px,default], 9*($lgap, default), $lgap, default:grow, $lgap, default")); //======== menuMain ======== {/*from ww w . j av a 2s .com*/ //======== menuFile ======== { menuFile.setText("\u0424\u0430\u0439\u043b"); //---- menuItemQuit ---- menuItemQuit.setText("\u0412\u0438\u0439\u0442\u0438"); menuItemQuit.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_Q, KeyEvent.CTRL_MASK)); menuItemQuit.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { menuItemQuitActionPerformed(e); } }); menuFile.add(menuItemQuit); } menuMain.add(menuFile); //======== menuTools ======== { menuTools.setText("\u0406\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u0438"); //======== menuConstellations ======== { menuConstellations.setText( "\u0421\u0438\u0433\u043d\u0430\u043b\u044c\u043d\u0456 \u0441\u0443\u0437\u0456\u0440\u2019\u044f"); //---- menuItemASK ---- menuItemASK.setText("\u0410\u041c\u043d\u2026"); menuItemASK.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { menuItemASKActionPerformed(e); } }); menuConstellations.add(menuItemASK); //---- menuItemFSK ---- menuItemFSK.setText("\u0427\u041c\u043d\u2026"); menuItemFSK.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { menuItemFSKActionPerformed(e); } }); menuConstellations.add(menuItemFSK); //---- menuItemBPSK ---- menuItemBPSK.setText("\u0424\u041c\u043d\u2026"); menuItemBPSK.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { menuItemBPSKActionPerformed(e); } }); menuConstellations.add(menuItemBPSK); //---- menuItemQPSK ---- menuItemQPSK.setText("\u0424\u041c-4\u2026"); menuItemQPSK.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { menuItemQPSKActionPerformed(e); } }); menuConstellations.add(menuItemQPSK); //---- menuItem8PSK ---- menuItem8PSK.setText("\u0424\u041c-8\u2026"); menuItem8PSK.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { menuItem8PSKActionPerformed(e); } }); menuConstellations.add(menuItem8PSK); //---- menuItem16PSK ---- menuItem16PSK.setText("\u0424\u041c-16\u2026"); menuItem16PSK.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { menuItem16PSKActionPerformed(e); } }); menuConstellations.add(menuItem16PSK); //---- menuItem32PSK ---- menuItem32PSK.setText("\u0424\u041c-32\u2026"); menuItem32PSK.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { menuItem32PSKActionPerformed(e); } }); menuConstellations.add(menuItem32PSK); //---- menuItem16QAM ---- menuItem16QAM.setText("\u041a\u0410\u041c-16\u2026"); menuItem16QAM.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { menuItem16QAMActionPerformed(e); } }); menuConstellations.add(menuItem16QAM); //---- menuItem32QAM ---- menuItem32QAM.setText("\u041a\u0410\u041c-32\u2026"); menuItem32QAM.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { menuItem32QAMActionPerformed(e); } }); menuConstellations.add(menuItem32QAM); //---- menuItem64QAM ---- menuItem64QAM.setText("\u041a\u0410\u041c-64\u2026"); menuItem64QAM.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { menuItem64QAMActionPerformed(e); } }); menuConstellations.add(menuItem64QAM); //---- menuItem256QAM ---- menuItem256QAM.setText("\u041a\u0410\u041c-256\u2026"); menuItem256QAM.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { menuItem256QAMActionPerformed(e); } }); menuConstellations.add(menuItem256QAM); } menuTools.add(menuConstellations); } menuMain.add(menuTools); //======== menuHelp ======== { menuHelp.setText("\u0414\u043e\u0432\u0456\u0434\u043a\u0430"); //---- menuItemAbout ---- menuItemAbout.setText("\u041f\u0440\u043e \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u0443\u2026"); menuItemAbout.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { menuItemAboutActionPerformed(e); } }); menuHelp.add(menuItemAbout); } menuMain.add(menuHelp); } add(menuMain, CC.xywh(1, 1, 9, 1, CC.FILL, CC.FILL)); //---- labelSource ---- labelSource.setText("\u0414\u0436\u0435\u0440\u0435\u043b\u043e:"); add(labelSource, CC.xy(1, 3)); add(chooserSource, CC.xy(3, 3)); //---- buttonAddToPlan ---- buttonAddToPlan.setText("\u2192"); buttonAddToPlan.setToolTipText( "\u0414\u043e\u0434\u0430\u0442\u0438 \u0434\u043e \u043f\u043b\u0430\u043d\u0443 \u0435\u043a\u0441\u043f\u0435\u0440\u0438\u043c\u0435\u043d\u0442\u0443"); buttonAddToPlan.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { buttonAddToPlanActionPerformed(e); } }); add(buttonAddToPlan, CC.xywh(5, 3, 1, 5)); //======== panelPlan ======== { panelPlan.setLayout(new GridLayout()); //======== scrollPane1 ======== { scrollPane1.setViewportView(listPlan); } panelPlan.add(scrollPane1); } add(panelPlan, CC.xywh(7, 3, 3, 13)); //---- labelCode ---- labelCode.setText("\u041a\u043e\u0434:"); add(labelCode, CC.xy(1, 5)); add(chooserCode, CC.xy(3, 5)); //---- labelModulation ---- labelModulation.setText("\u041c\u043e\u0434\u0443\u043b\u044f\u0446\u0456\u044f:"); add(labelModulation, CC.xy(1, 7)); add(chooserModulation, CC.xy(3, 7)); //---- labelChannel ---- labelChannel.setText("\u041a\u0430\u043d\u0430\u043b:"); add(labelChannel, CC.xy(1, 9)); add(chooserChannel, CC.xy(3, 9)); //---- buttonClearPlan ---- buttonClearPlan.setText("X"); buttonClearPlan.setToolTipText( "\u041e\u0447\u0438\u0441\u0442\u0438\u0442\u0438 \u043f\u043b\u0430\u043d \u0435\u043a\u0441\u043f\u0435\u0440\u0438\u043c\u0435\u043d\u0442\u0443"); buttonClearPlan.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { buttonClearPlanActionPerformed(e); } }); add(buttonClearPlan, CC.xy(5, 9)); //---- labelErrors ---- labelErrors.setText("\u041f\u043e\u043c\u0438\u043b\u043a\u0438:"); add(labelErrors, CC.xy(1, 11)); add(chooserErrors, CC.xy(3, 11)); //---- labelLineWidth ---- labelLineWidth.setText("\u0422\u043e\u0432\u0449\u0438\u043d\u0430 \u043b\u0456\u043d\u0456\u0457:"); add(labelLineWidth, CC.xy(1, 13)); //---- spinnerLineWidth ---- spinnerLineWidth.setModel(new SpinnerNumberModel(2, 1, 5, 1)); add(spinnerLineWidth, CC.xy(3, 13)); //---- buttonRemoveFromPlan ---- buttonRemoveFromPlan.setText("\u2190"); buttonRemoveFromPlan.setToolTipText( "\u0412\u0438\u0434\u0430\u043b\u0438\u0442\u0438 \u0437 \u043f\u043b\u0430\u043d\u0443 \u0435\u043a\u0441\u043f\u0435\u0440\u0438\u043c\u0435\u043d\u0442\u0443"); buttonRemoveFromPlan.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { buttonRemoveFromPlanActionPerformed(e); } }); add(buttonRemoveFromPlan, CC.xywh(5, 11, 1, 5)); //---- labelLineColor ---- labelLineColor.setText("\u041a\u043e\u043b\u0456\u0440 \u043b\u0456\u043d\u0456\u0457:"); add(labelLineColor, CC.xy(1, 15)); add(chooserLineColor, CC.xy(3, 15)); //---- labelHSquare ---- labelHSquare.setText("h\u00b2="); add(labelHSquare, CC.xy(1, 17)); //---- spinnerHSquareLow ---- spinnerHSquareLow.setModel(new SpinnerNumberModel(0.0, null, null, 1.0)); add(spinnerHSquareLow, CC.xy(3, 17)); //---- labelEllipsis ---- labelEllipsis.setText("\u2026"); add(labelEllipsis, CC.xy(5, 17, CC.CENTER, CC.DEFAULT)); //---- spinnerHSquareHigh ---- spinnerHSquareHigh.setModel(new SpinnerNumberModel(15.0, null, null, 1.0)); add(spinnerHSquareHigh, CC.xy(7, 17)); //======== panelInner1 ======== { panelInner1.setLayout(new FormLayout("5*(default, $lcgap), default:grow", "default")); //---- labelHSquareStep ---- labelHSquareStep.setText(", \u043a\u0440\u043e\u043a:"); panelInner1.add(labelHSquareStep, CC.xy(1, 1)); //---- spinnerHSquareStep ---- spinnerHSquareStep.setModel(new SpinnerNumberModel(0.5, 0.001, null, 0.1)); panelInner1.add(spinnerHSquareStep, CC.xy(3, 1)); //---- labelMeasurementUnit ---- labelMeasurementUnit.setText(", \u043e\u0434\u0438\u043d\u0438\u0446\u0456:"); panelInner1.add(labelMeasurementUnit, CC.xy(5, 1)); //---- radioButtonMeasurementUnitTimes ---- radioButtonMeasurementUnitTimes.setText("\u0440\u0430\u0437\u0438"); radioButtonMeasurementUnitTimes.setSelected(true); panelInner1.add(radioButtonMeasurementUnitTimes, CC.xy(7, 1, CC.LEFT, CC.DEFAULT)); //---- radioButtonMeasurementUnitdB ---- radioButtonMeasurementUnitdB.setText("\u0434\u0411"); panelInner1.add(radioButtonMeasurementUnitdB, CC.xy(9, 1, CC.LEFT, CC.DEFAULT)); //---- buttonRunSimulation ---- buttonRunSimulation.setText("\u0412\u0438\u043a\u043e\u043d\u0430\u0442\u0438"); buttonRunSimulation.setToolTipText( "\u0417\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u0438 \u043c\u043e\u0434\u0435\u043b\u044e\u0432\u0430\u043d\u043d\u044f"); buttonRunSimulation.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { buttonRunSimulationActionPerformed(e); } }); panelInner1.add(buttonRunSimulation, CC.xy(11, 1, CC.RIGHT, CC.DEFAULT)); } add(panelInner1, CC.xy(9, 17)); //---- labelIterations ---- labelIterations.setText("\u0406\u0442\u0435\u0440\u0430\u0446\u0456\u0439:"); add(labelIterations, CC.xy(1, 19)); //---- spinnerIterations ---- spinnerIterations.setModel(new SpinnerNumberModel(200000, 1, null, 50000)); add(spinnerIterations, CC.xy(3, 19)); //---- checkBoxShowLineNumbers ---- checkBoxShowLineNumbers.setText( "\u041d\u0443\u043c\u0435\u0440\u0443\u0432\u0430\u0442\u0438 \u0433\u0440\u0430\u0444\u0456\u043a\u0438"); add(checkBoxShowLineNumbers, CC.xywh(7, 19, 3, 1)); //======== tabbedPaneResults ======== { //======== panelChart ======== { panelChart.setLayout(new BoxLayout(panelChart, BoxLayout.X_AXIS)); } tabbedPaneResults.addTab("\u0413\u0440\u0430\u0444\u0456\u043a\u0438", panelChart); //======== panelNumeric ======== { panelNumeric.setLayout(new FormLayout("default:grow", "default:grow")); //======== scrollPane2 ======== { //---- textAreaNumeric ---- textAreaNumeric.setCursor(Cursor.getPredefinedCursor(Cursor.TEXT_CURSOR)); textAreaNumeric.setEditable(false); scrollPane2.setViewportView(textAreaNumeric); } panelNumeric.add(scrollPane2, CC.xy(1, 1, CC.DEFAULT, CC.FILL)); } tabbedPaneResults.addTab("\u0427\u0438\u0441\u043b\u043e\u0432\u0456 \u0434\u0430\u043d\u0456", panelNumeric); } add(tabbedPaneResults, CC.xywh(1, 21, 9, 1, CC.DEFAULT, CC.FILL)); add(progressBar, CC.xywh(1, 23, 9, 1)); //---- buttonGroupMeasurementUnit ---- ButtonGroup buttonGroupMeasurementUnit = new ButtonGroup(); buttonGroupMeasurementUnit.add(radioButtonMeasurementUnitTimes); buttonGroupMeasurementUnit.add(radioButtonMeasurementUnitdB); // JFormDesigner - End of component initialization //GEN-END:initComponents }
From source file:com.mirth.connect.client.ui.panels.connectors.DestinationSettingsPanel.java
private void initComponents() { setLayout(new MigLayout("insets 4 8 4 4, novisualpadding, hidemode 3, fill", "[]13[grow]")); setBackground(UIConstants.BACKGROUND_COLOR); setBorder(BorderFactory.createTitledBorder( BorderFactory.createMatteBorder(1, 0, 0, 0, new Color(204, 204, 204)), "Destination Settings", TitledBorder.DEFAULT_JUSTIFICATION, TitledBorder.DEFAULT_POSITION, new Font("Tahoma", 1, 11))); queueMessagesLabel = new JLabel("Queue Messages:"); ButtonGroup queueMessagesButtonGroup = new ButtonGroup(); ActionListener queueMessagesActionListener = new ActionListener() { @Override//from www . ja va 2s.com public void actionPerformed(ActionEvent evt) { updateQueueMessages(); } }; queueMessagesNeverRadio = new MirthRadioButton("Never"); queueMessagesNeverRadio.setBackground(getBackground()); queueMessagesNeverRadio.setToolTipText("Disable the destination queue."); queueMessagesNeverRadio.addActionListener(queueMessagesActionListener); queueMessagesButtonGroup.add(queueMessagesNeverRadio); queueMessagesOnFailureRadio = new MirthRadioButton("On Failure"); queueMessagesOnFailureRadio.setBackground(getBackground()); queueMessagesOnFailureRadio.setToolTipText( "<html>Attempt to send the message first before queueing it. This will allow subsequent<br/>destinations and the Postprocessor to use the response from this destination if it<br/>successfully sends before queueing.</html>"); queueMessagesOnFailureRadio.addActionListener(queueMessagesActionListener); queueMessagesButtonGroup.add(queueMessagesOnFailureRadio); queueMessagesAlwaysRadio = new MirthRadioButton("Always"); queueMessagesAlwaysRadio.setBackground(getBackground()); queueMessagesAlwaysRadio.setToolTipText( "<html>Immediately queue the message. Subsequent destinations and the<br/>Postprocessor will always see this destination's response as QUEUED.</html>"); queueMessagesAlwaysRadio.addActionListener(queueMessagesActionListener); queueMessagesButtonGroup.add(queueMessagesAlwaysRadio); queueMessagesWarningLabel = new JLabel(); queueMessagesWarningLabel.setForeground(Color.RED); advancedQueueSettingsLabel = new JLabel("Advanced Queue Settings:"); advancedQueueSettingsButton = new JButton(new ImageIcon(Frame.class.getResource("images/wrench.png"))); advancedQueueSettingsButton.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent evt) { new AdvancedDialog(); } }); advancedQueueSettingsValueLabel = new JLabel(); validateResponseLabel = new JLabel("Validate Response:"); ButtonGroup validateResponseButtonGroup = new ButtonGroup(); String toolTipText = "<html>Select Yes to validate the response. Responses can only be validated if the<br>response transformer's inbound properties contains a <b>Response Validation</b><br>section. If validation fails, the message will be marked as queued or errored.</html>"; validateResponseYesRadio = new MirthRadioButton("Yes"); validateResponseYesRadio.setBackground(getBackground()); validateResponseYesRadio.setToolTipText(toolTipText); validateResponseButtonGroup.add(validateResponseYesRadio); validateResponseNoRadio = new MirthRadioButton("No"); validateResponseNoRadio.setBackground(getBackground()); validateResponseNoRadio.setToolTipText(toolTipText); validateResponseButtonGroup.add(validateResponseNoRadio); }
From source file:com.mirth.connect.connectors.tcp.TcpListener.java
private void initComponents() { setBackground(UIConstants.BACKGROUND_COLOR); transmissionModeLabel = new JLabel("Transmission Mode:"); transmissionModeComboBox = new MirthComboBox<String>(); transmissionModeComboBox.addActionListener(new ActionListener() { @Override/* w ww . j a va 2s . co m*/ public void actionPerformed(ActionEvent evt) { transmissionModeComboBoxActionPerformed(); } }); settingsPlaceHolder = new JPanel(); sampleLabel = new JLabel("Sample Frame:"); sampleValue = new JLabel( "<html><b><VT></b> <i><Message Data></i> <b><FS><CR></b></html>"); sampleValue.setForeground(new Color(153, 153, 153)); sampleValue.setEnabled(false); modeLabel = new JLabel("Mode:"); ButtonGroup modeButtonGroup = new ButtonGroup(); modeServerRadio = new MirthRadioButton("Server"); modeServerRadio.setBackground(getBackground()); modeServerRadio.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent evt) { modeServerRadioActionPerformed(); } }); modeButtonGroup.add(modeServerRadio); modeClientRadio = new MirthRadioButton("Client"); modeClientRadio.setBackground(getBackground()); modeClientRadio.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent evt) { modeClientRadioActionPerformed(); } }); modeButtonGroup.add(modeClientRadio); remoteAddressLabel = new JLabel("Remote Address:"); remoteAddressField = new MirthTextField(); remotePortLabel = new JLabel("Remote Port:"); remotePortField = new MirthTextField(); overrideLocalBindingLabel = new JLabel("Override Local Binding:"); ButtonGroup overrideLocalBindingButtonGroup = new ButtonGroup(); overrideLocalBindingYesRadio = new MirthRadioButton("Yes"); overrideLocalBindingYesRadio.setBackground(getBackground()); overrideLocalBindingButtonGroup.add(overrideLocalBindingYesRadio); overrideLocalBindingNoRadio = new MirthRadioButton("No"); overrideLocalBindingNoRadio.setBackground(getBackground()); overrideLocalBindingButtonGroup.add(overrideLocalBindingNoRadio); reconnectIntervalLabel = new JLabel("Reconnect Interval (ms):"); reconnectIntervalField = new MirthTextField(); maxConnectionsLabel = new JLabel("Max Connections:"); maxConnectionsField = new MirthTextField(); receiveTimeoutLabel = new JLabel("Receive Timeout (ms):"); receiveTimeoutField = new MirthTextField(); bufferSizeLabel = new JLabel("Buffer Size (bytes):"); bufferSizeField = new MirthTextField(); keepConnectionOpenLabel = new JLabel("Keep Connection Open:"); ButtonGroup keepConnectionOpenGroup = new ButtonGroup(); keepConnectionOpenYesRadio = new MirthRadioButton("Yes"); keepConnectionOpenYesRadio.setBackground(getBackground()); keepConnectionOpenGroup.add(keepConnectionOpenYesRadio); keepConnectionOpenNoRadio = new MirthRadioButton("No"); keepConnectionOpenNoRadio.setBackground(getBackground()); keepConnectionOpenGroup.add(keepConnectionOpenNoRadio); dataTypeLabel = new JLabel("Data Type:"); ButtonGroup dataTypeButtonGroup = new ButtonGroup(); dataTypeBinaryRadio = new MirthRadioButton("Binary"); dataTypeBinaryRadio.setBackground(getBackground()); dataTypeBinaryRadio.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent evt) { dataTypeBinaryRadioActionPerformed(); } }); dataTypeButtonGroup.add(dataTypeBinaryRadio); dataTypeTextRadio = new MirthRadioButton("Text"); dataTypeTextRadio.setBackground(getBackground()); dataTypeTextRadio.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent evt) { dataTypeASCIIRadioActionPerformed(); } }); dataTypeButtonGroup.add(dataTypeTextRadio); charsetEncodingLabel = new JLabel("Encoding:"); charsetEncodingComboBox = new MirthComboBox<CharsetEncodingInformation>(); respondOnNewConnectionLabel = new JLabel("Respond on New Connection:"); ButtonGroup respondOnNewConnectionButtonGroup = new ButtonGroup(); respondOnNewConnectionYesRadio = new MirthRadioButton("Yes"); respondOnNewConnectionYesRadio.setBackground(getBackground()); respondOnNewConnectionYesRadio.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent evt) { respondOnNewConnectionYesRadioActionPerformed(); } }); respondOnNewConnectionButtonGroup.add(respondOnNewConnectionYesRadio); respondOnNewConnectionNoRadio = new MirthRadioButton("No"); respondOnNewConnectionNoRadio.setBackground(getBackground()); respondOnNewConnectionNoRadio.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent evt) { respondOnNewConnectionNoRadioActionPerformed(); } }); respondOnNewConnectionButtonGroup.add(respondOnNewConnectionNoRadio); respondOnNewConnectionRecoveryRadio = new MirthRadioButton("Message Recovery"); respondOnNewConnectionRecoveryRadio.setBackground(getBackground()); respondOnNewConnectionRecoveryRadio.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent evt) { respondOnNewConnectionRecoveryRadioActionPerformed(); } }); respondOnNewConnectionButtonGroup.add(respondOnNewConnectionRecoveryRadio); responseAddressLabel = new JLabel("Response Address:"); responseAddressField = new MirthTextField(); responsePortLabel = new JLabel("Response Port:"); responsePortField = new MirthTextField(); }