Example usage for javax.swing ButtonGroup add

List of usage examples for javax.swing ButtonGroup add

Introduction

In this page you can find the example usage for javax.swing ButtonGroup add.

Prototype

public void add(AbstractButton b) 

Source Link

Document

Adds the button to the group.

Usage

From source file:org.barcelonamedia.uima.tools.docanalyzer.DBAnnotationViewerDialog.java

/**
 * Create an AnnotationViewer Dialog/*from  ww w. j a  v  a  2s  . co m*/
 * 
 * @param aParentFrame
 *          frame containing this panel
 * @param aTitle
 *          title to display for the dialog
 * @param aInputDir
 *          directory containing input files (in XCAS foramt) to read
 * @param aStyleMapFile
 *          filename of style map to be used to view files in HTML
 * @param aPerformanceStats
 *          string representaiton of performance statistics, optional.
 * @param aTypeSystem
 *          the CAS Type System to which the XCAS files must conform.
 * @param aTypesToDisplay
 *          array of types that should be highlighted in the viewer. This can be set to the output
 *          types of the Analysis Engine. A value of null means to display all types.
 */
/*public DBAnnotationViewerDialog(JFrame aParentFrame, String aDialogTitle, DBPrefsMediator med,
  File aStyleMapFile, String aPerformanceStats, TypeSystem aTypeSystem,
  final String[] aTypesToDisplay, String interactiveTempFN, boolean javaViewerRBisSelected,
  boolean javaViewerUCRBisSelected, boolean xmlRBisSelected, CAS cas) {
  super(aParentFrame, aDialogTitle);
  // create the AnnotationViewGenerator (for HTML view generation)
  this.med1 = med;
  this.cas = cas;
  annotationViewGenerator = new AnnotationViewGenerator(tempDir);
        
  launchThatViewer(med.getOutputDir(), interactiveTempFN, aTypeSystem, aTypesToDisplay,
    javaViewerRBisSelected, javaViewerUCRBisSelected, xmlRBisSelected, aStyleMapFile,
    tempDir);
}*/

public DBAnnotationViewerDialog(JFrame aParentFrame, String aDialogTitle, DBPrefsMediator med,
        File aStyleMapFile, String aPerformanceStats, TypeSystem aTypeSystem, final String[] aTypesToDisplay,
        boolean generatedStyleMap, CAS cas) {

    super(aParentFrame, aDialogTitle);

    this.xmiDAO = med.getXmiDAO();

    this.med1 = med;
    this.cas = cas;

    styleMapFile = aStyleMapFile;
    final String performanceStats = aPerformanceStats;
    typeSystem = aTypeSystem;
    typesToDisplay = aTypesToDisplay;

    // create the AnnotationViewGenerator (for HTML view generation)
    annotationViewGenerator = new AnnotationViewGenerator(tempDir);

    // create StyleMapEditor dialog
    styleMapEditor = new StyleMapEditor(aParentFrame, cas);
    JPanel resultsTitlePanel = new JPanel();
    resultsTitlePanel.setLayout(new BoxLayout(resultsTitlePanel, BoxLayout.Y_AXIS));

    resultsTitlePanel.add(new JLabel("These are the Analyzed Documents."));
    resultsTitlePanel.add(new JLabel("Select viewer type and double-click file to open."));

    try {

        String[] documents = this.xmiDAO.getXMIList();
        analyzedResultsList = new JList(documents);

        JScrollPane scrollPane = new JScrollPane();
        scrollPane.getViewport().add(analyzedResultsList, null);

        JPanel southernPanel = new JPanel();
        southernPanel.setLayout(new BoxLayout(southernPanel, BoxLayout.Y_AXIS));

        JPanel controlsPanel = new JPanel();
        controlsPanel.setLayout(new SpringLayout());

        Caption displayFormatLabel = new Caption("Results Display Format:");
        controlsPanel.add(displayFormatLabel);

        JPanel displayFormatPanel = new JPanel();
        displayFormatPanel.setLayout(new FlowLayout(FlowLayout.LEFT));
        displayFormatPanel.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0));
        javaViewerRB = new JRadioButton("Java Viewer");
        javaViewerUCRB = new JRadioButton("JV user colors");
        htmlRB = new JRadioButton("HTML");
        xmlRB = new JRadioButton("XML");

        ButtonGroup displayFormatButtonGroup = new ButtonGroup();
        displayFormatButtonGroup.add(javaViewerRB);
        displayFormatButtonGroup.add(javaViewerUCRB);
        displayFormatButtonGroup.add(htmlRB);
        displayFormatButtonGroup.add(xmlRB);

        // select the appropraite viewer button according to user's prefs
        javaViewerRB.setSelected(true); // default, overriden below

        if ("Java Viewer".equals(med.getViewType())) {
            javaViewerRB.setSelected(true);
        } else if ("JV User Colors".equals(med.getViewType())) {
            javaViewerUCRB.setSelected(true);
        } else if ("HTML".equals(med.getViewType())) {
            htmlRB.setSelected(true);
        } else if ("XML".equals(med.getViewType())) {
            xmlRB.setSelected(true);
        }

        displayFormatPanel.add(javaViewerRB);
        displayFormatPanel.add(javaViewerUCRB);
        displayFormatPanel.add(htmlRB);
        displayFormatPanel.add(xmlRB);

        controlsPanel.add(displayFormatPanel);

        SpringUtilities.makeCompactGrid(controlsPanel, 1, 2, // rows, cols
                4, 4, // initX, initY
                0, 0); // xPad, yPad

        JButton editStyleMapButton = new JButton("Edit Style Map");

        // event for the editStyleMapButton button
        editStyleMapButton.addActionListener(this);

        southernPanel.add(controlsPanel);

        // southernPanel.add( new JSeparator() );

        JPanel buttonsPanel = new JPanel();
        buttonsPanel.setLayout(new FlowLayout(FlowLayout.RIGHT));

        // APL: edit style map feature disabled for SDK
        buttonsPanel.add(editStyleMapButton);

        if (performanceStats != null) {
            JButton perfStatsButton = new JButton("Performance Stats");
            perfStatsButton.addActionListener(new ActionListener() {
                public void actionPerformed(ActionEvent ae) {
                    JOptionPane.showMessageDialog((Component) ae.getSource(), performanceStats, null,
                            JOptionPane.PLAIN_MESSAGE);
                }
            });
            buttonsPanel.add(perfStatsButton);
        }

        JButton closeButton = new JButton("Close");
        buttonsPanel.add(closeButton);

        southernPanel.add(buttonsPanel);

        // add list and panel container to Dialog
        getContentPane().add(resultsTitlePanel, BorderLayout.NORTH);
        getContentPane().add(scrollPane, BorderLayout.CENTER);
        getContentPane().add(southernPanel, BorderLayout.SOUTH);

        // event for the closeButton button
        closeButton.addActionListener(new ActionListener() {
            public void actionPerformed(ActionEvent ae) {
                DBAnnotationViewerDialog.this.setVisible(false);
            }
        });

        // event for analyzedResultsDialog window closing
        this.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
        setLF(); // set default look and feel
        analyzedResultsList.setCellRenderer(new MyListCellRenderer());

        // doubleclicking on document shows the annotated result
        MouseListener mouseListener = new ListMouseAdapter();
        // styleMapFile, analyzedResultsList,
        // inputDirPath,typeSystem , typesToDisplay ,
        // javaViewerRB , javaViewerUCRB ,xmlRB ,
        // viewerDirectory , this);

        // add mouse Listener to the list
        analyzedResultsList.addMouseListener(mouseListener);
    } catch (DAOException e) {

        displayError(e.getMessage());

        this.dispatchEvent(new WindowEvent(this, WindowEvent.WINDOW_CLOSING));
    }
}

From source file:org.bigwiv.blastgraph.gui.BlastGraphFrame.java

/**
 * initialize LayoutMenu//from w  w w.  jav  a2 s.co  m
 * 
 * @return
 */
private JMenu getLayoutMenu() {
    if (layoutMenu == null) {

        layoutMenu = new JMenu();

        final JRadioButtonMenuItem frButton = new JRadioButtonMenuItem(LayoutType.FRLayout.toString());
        final JRadioButtonMenuItem ewButton = new JRadioButtonMenuItem(LayoutType.EWLayout.toString());

        ItemListener layoutMenuItemListener = new ItemListener() {
            @Override
            public void itemStateChanged(ItemEvent e) {
                if (e.getStateChange() == ItemEvent.SELECTED) {
                    if (e.getItem().equals(frButton)) {
                        setLayout(LayoutType.FRLayout);
                        layoutBox.setSelectedItem(LayoutType.FRLayout);
                    } else if (e.getItem().equals(ewButton)) {
                        setLayout(LayoutType.EWLayout);
                        layoutBox.setSelectedItem(LayoutType.EWLayout);
                    }
                }
            }
        };

        frButton.addItemListener(layoutMenuItemListener);
        ewButton.addItemListener(layoutMenuItemListener);

        ButtonGroup radio = new ButtonGroup();
        radio.add(frButton);
        radio.add(ewButton);
        frButton.setSelected(true);
        layoutMenu.add(frButton);
        layoutMenu.add(ewButton);
        layoutMenu.setToolTipText("Menu for setting graph layout");

        // layoutMenu.addItemListener(layoutMenuItemListener);

        layoutBox.addItemListener(new ItemListener() {
            @Override
            public void itemStateChanged(ItemEvent e) {
                if (e.getStateChange() == ItemEvent.SELECTED) {
                    if (e.getItem().equals(LayoutType.FRLayout)) {
                        frButton.setSelected(true);
                    } else if (e.getItem().equals(LayoutType.EWLayout)) {
                        ewButton.setSelected(true);
                    }
                }
            }
        });
    }
    return layoutMenu;
}

From source file:org.broad.igv.track.TrackMenuUtils.java

public static void addDisplayModeItems(final Collection<Track> tracks, JPopupMenu menu) {

    // Find "most representative" state from track collection
    Map<Track.DisplayMode, Integer> counts = new HashMap<Track.DisplayMode, Integer>(
            Track.DisplayMode.values().length);
    Track.DisplayMode currentMode = null;

    for (Track t : tracks) {
        Track.DisplayMode mode = t.getDisplayMode();
        if (counts.containsKey(mode)) {
            counts.put(mode, counts.get(mode) + 1);
        } else {//from   w  w  w. jav  a2 s.c o  m
            counts.put(mode, 1);
        }
    }

    int maxCount = -1;
    for (Map.Entry<Track.DisplayMode, Integer> count : counts.entrySet()) {
        if (count.getValue() > maxCount) {
            currentMode = count.getKey();
            maxCount = count.getValue();
        }
    }

    ButtonGroup group = new ButtonGroup();
    Map<String, Track.DisplayMode> modes = new LinkedHashMap<String, Track.DisplayMode>(4);
    modes.put("Collapsed", Track.DisplayMode.COLLAPSED);
    modes.put("Expanded", Track.DisplayMode.EXPANDED);
    modes.put("Squished", Track.DisplayMode.SQUISHED);
    boolean showAS = Boolean.parseBoolean(System.getProperty("showAS", "false"));
    if (showAS) {
        modes.put("Alternative Splice", Track.DisplayMode.ALTERNATIVE_SPLICE);
    }
    for (final Map.Entry<String, Track.DisplayMode> entry : modes.entrySet()) {
        JRadioButtonMenuItem mm = new JRadioButtonMenuItem(entry.getKey());
        mm.setSelected(currentMode == entry.getValue());
        mm.addActionListener(new ActionListener() {
            public void actionPerformed(ActionEvent evt) {
                setTrackDisplayMode(tracks, entry.getValue());
                refresh();
            }
        });
        group.add(mm);
        menu.add(mm);
    }

}

From source file:org.codinjutsu.tools.nosql.mongo.view.MongoAuthenticationPanel.java

public MongoAuthenticationPanel() {
    usernameField.setName("usernameField");
    passwordField.setName("passwordField");
    authenticationDatabaseField.setName("authenticationDatabaseField");
    mongoCRAuthRadioButton.setName("mongoCRAuthField");
    scramSHA1AuthRadioButton.setName("scramSHA1AuthField");
    defaultAuthMethodRadioButton.setName("defaultAuthMethod");
    sslConnectionField.setName("sslConnectionField");

    ButtonGroup authMethodGroup = new ButtonGroup();
    authMethodGroup.add(mongoCRAuthRadioButton);
    authMethodGroup.add(scramSHA1AuthRadioButton);
    authMethodGroup.add(defaultAuthMethodRadioButton);

    defaultAuthMethodRadioButton.setSelected(true);
    defaultAuthMethodRadioButton.setToolTipText("Let the driver resolves the auth. mecanism");
}

From source file:org.colombbus.tangara.CommandSelection.java

/**
 * Creates a new instance of CommandSelection from Tangara frame
 *
 *//*www.  j  a v a2s  .  c  o  m*/
public CommandSelection(EditorFrame parent, boolean modal, int mode) {
    super(parent, modal);
    this.mode = mode;
    myParent = parent;
    initializeIcons();
    initialize();
    ButtonGroup programDestinationGrp = new ButtonGroup();
    programDestinationGrp.add(buttonSaveProgram);
    programDestinationGrp.add(buttonDisplayProgram);
    changeState(STATE_COMMANDS_SELECTION);
    this.setLocation(new Point((parent.getX() + (parent.getWidth() - getWidth()) / 2),
            (parent.getY() + (parent.getHeight() - getHeight()) / 2)));
    SwingUtilities.invokeLater(new Runnable() {
        @Override
        public void run() {
            commandList.setSelectionInterval(0, commandList.getModel().getSize() - 1);
        }
    });
}

From source file:org.datanucleus.ide.idea.ui.DNEConfigForm.java

/**
 * Method generated by IntelliJ IDEA GUI Designer
 * >>> IMPORTANT!! <<<
 * DO NOT edit this method OR call it in your code!
 *
 * @noinspection ALL/* w  w  w  .  j  a  va 2s  .  c  om*/
 */
private void $$$setupUI$$$() {
    createUIComponents();
    parentPanel.setLayout(new GridLayoutManager(2, 1, new Insets(1, 0, 0, 0), -1, -1));
    configTabbedPane = new JTabbedPane();
    parentPanel.add(configTabbedPane,
            new GridConstraints(1, 0, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_BOTH,
                    GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_WANT_GROW,
                    GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_WANT_GROW, null, null,
                    null, 0, false));
    configPanel = new JPanel();
    configPanel.setLayout(new GridLayoutManager(5, 3, new Insets(6, 2, 2, 2), -1, -1));
    configTabbedPane.addTab("Enhancer", configPanel);
    indexNotReadyPanel = new JPanel();
    indexNotReadyPanel.setLayout(new GridLayoutManager(1, 1, new Insets(0, 0, 0, 0), -1, -1));
    configPanel.add(indexNotReadyPanel,
            new GridConstraints(3, 0, 1, 3, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_BOTH,
                    GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, 1, null, null,
                    null, 0, false));
    final JLabel label1 = new JLabel();
    label1.setText("Please wait until indexing is finished");
    indexNotReadyPanel.add(label1,
            new GridConstraints(0, 0, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_NONE,
                    GridConstraints.SIZEPOLICY_FIXED, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0,
                    false));
    contentPanel = new JPanel();
    contentPanel.setLayout(new GridLayoutManager(2, 1, new Insets(0, 0, 0, 0), -1, -1));
    configPanel.add(contentPanel,
            new GridConstraints(4, 0, 1, 3, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_BOTH,
                    GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_WANT_GROW,
                    GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_WANT_GROW, null, null,
                    null, 0, false));
    final JPanel panel1 = new JPanel();
    panel1.setLayout(new GridLayoutManager(1, 1, new Insets(0, 0, 0, 0), -1, -1));
    contentPanel.add(panel1,
            new GridConstraints(0, 0, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_BOTH,
                    GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW,
                    GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, null, null,
                    null, 0, false));
    panel1.setBorder(BorderFactory.createTitledBorder(BorderFactory.createLineBorder(new Color(-3355444)),
            "Affected Modules"));
    final JScrollPane scrollPane1 = new JScrollPane();
    panel1.add(scrollPane1,
            new GridConstraints(0, 0, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_BOTH,
                    GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW,
                    GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, null, null,
                    null, 0, false));
    affectedModulesTable = new JTable();
    affectedModulesTable.setEnabled(true);
    affectedModulesTable.setFillsViewportHeight(false);
    affectedModulesTable.setPreferredScrollableViewportSize(new Dimension(450, 30));
    scrollPane1.setViewportView(affectedModulesTable);
    final JPanel panel2 = new JPanel();
    panel2.setLayout(new GridLayoutManager(1, 1, new Insets(0, 0, 0, 0), -1, -1));
    contentPanel.add(panel2,
            new GridConstraints(1, 0, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_BOTH,
                    GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW,
                    GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, null, null,
                    null, 0, false));
    panel2.setBorder(BorderFactory.createTitledBorder(BorderFactory.createLineBorder(new Color(-3355444)),
            "Metadata and annotated classes for enhancement", TitledBorder.DEFAULT_JUSTIFICATION,
            TitledBorder.DEFAULT_POSITION, null, new Color(-16777216)));
    infoPanel = new JPanel();
    infoPanel.setLayout(new GridLayoutManager(1, 1, new Insets(0, 0, 0, 0), -1, -1));
    panel2.add(infoPanel,
            new GridConstraints(0, 0, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_BOTH,
                    GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW,
                    GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, null, null,
                    null, 0, false));
    final JLabel label2 = new JLabel();
    label2.setText("Please click 'Make Project' to see affected files");
    infoPanel.add(label2,
            new GridConstraints(0, 0, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_NONE,
                    GridConstraints.SIZEPOLICY_FIXED, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0,
                    false));
    metaDataAndClassesScrollPane = new JScrollPane();
    panel2.add(metaDataAndClassesScrollPane,
            new GridConstraints(0, 0, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_BOTH,
                    GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW,
                    GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, null, null,
                    null, 0, false));
    metadataAndClassesTable = new JTable();
    metadataAndClassesTable.setFillsViewportHeight(false);
    metadataAndClassesTable.setFont(new Font(metadataAndClassesTable.getFont().getName(),
            metadataAndClassesTable.getFont().getStyle(), metadataAndClassesTable.getFont().getSize()));
    metadataAndClassesTable.setPreferredScrollableViewportSize(new Dimension(450, 100));
    metaDataAndClassesScrollPane.setViewportView(metadataAndClassesTable);
    modifiersPanel = new JPanel();
    modifiersPanel.setLayout(new GridLayoutManager(2, 3, new Insets(0, 2, 0, 0), -1, -1));
    configPanel.add(modifiersPanel,
            new GridConstraints(1, 0, 2, 3, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_BOTH,
                    GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_WANT_GROW,
                    GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, null, null,
                    null, 0, false));
    final JLabel label3 = new JLabel();
    label3.setText(" Metadata file extensions (use ';' to separate)");
    modifiersPanel.add(label3,
            new GridConstraints(0, 0, 1, 2, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE,
                    GridConstraints.SIZEPOLICY_FIXED, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0,
                    false));
    includeTestClassesCheckBox = new JCheckBox();
    includeTestClassesCheckBox.setText("Include Test classes");
    modifiersPanel.add(includeTestClassesCheckBox,
            new GridConstraints(0, 2, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE,
                    GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW,
                    GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));
    metadataExtensionTextField.setAlignmentX(0.5f);
    metadataExtensionTextField.setAutoscrolls(true);
    metadataExtensionTextField.setMargin(new Insets(1, 1, 1, 1));
    modifiersPanel.add(metadataExtensionTextField,
            new GridConstraints(1, 0, 1, 2, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_HORIZONTAL,
                    GridConstraints.SIZEPOLICY_WANT_GROW, GridConstraints.SIZEPOLICY_FIXED, null,
                    new Dimension(150, -1), null, 0, false));
    addToCompilerResourceCheckBox = new JCheckBox();
    addToCompilerResourceCheckBox.setText("Add to compiler resource patterns");
    modifiersPanel.add(addToCompilerResourceCheckBox,
            new GridConstraints(1, 2, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE,
                    GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW,
                    GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));
    dependenciesPanel = new JPanel();
    dependenciesPanel.setLayout(new GridLayoutManager(3, 1, new Insets(6, 2, 2, 2), -1, -1));
    configTabbedPane.addTab("Dependencies", dependenciesPanel);
    final JPanel panel3 = new JPanel();
    panel3.setLayout(new GridLayoutManager(1, 4, new Insets(0, 0, 0, 0), 5, 5));
    dependenciesPanel.add(panel3,
            new GridConstraints(0, 0, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_HORIZONTAL,
                    GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, 1, null, null,
                    null, 0, false));
    depProjectModuleRadioButton.setText("Project Module Dependencies");
    panel3.add(depProjectModuleRadioButton,
            new GridConstraints(0, 0, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE,
                    GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW,
                    GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));
    depManualRadioButton.setText("Manual Dependencies");
    panel3.add(depManualRadioButton,
            new GridConstraints(0, 1, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE,
                    GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW,
                    GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));
    final Spacer spacer1 = new Spacer();
    panel3.add(spacer1,
            new GridConstraints(0, 3, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_HORIZONTAL,
                    GridConstraints.SIZEPOLICY_WANT_GROW, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0,
                    false));
    depManualUnsupportedLabel = new JLabel();
    depManualUnsupportedLabel.setText("(Not supported by plugin extension)");
    panel3.add(depManualUnsupportedLabel,
            new GridConstraints(0, 2, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE,
                    GridConstraints.SIZEPOLICY_FIXED, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0,
                    false));
    manualDependenciesDisabledInfoPanel.setLayout(new GridLayoutManager(1, 1, new Insets(0, 0, 0, 0), -1, -1));
    dependenciesPanel.add(manualDependenciesDisabledInfoPanel,
            new GridConstraints(1, 0, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_BOTH,
                    GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW,
                    GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, null, null,
                    null, 0, false));
    final JLabel label4 = new JLabel();
    label4.setHorizontalAlignment(0);
    label4.setHorizontalTextPosition(0);
    label4.setText("Using Enhancer and it's Dependencies from Project Module");
    manualDependenciesDisabledInfoPanel.add(label4,
            new GridConstraints(0, 0, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_NONE,
                    GridConstraints.SIZEPOLICY_FIXED, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0,
                    false));
    dependenciesPanel.add(dependenciesAddDeletePanel,
            new GridConstraints(2, 0, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_BOTH,
                    GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_WANT_GROW,
                    GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_WANT_GROW, null, null,
                    null, 0, false));
    generalPanel = new JPanel();
    generalPanel.setLayout(new GridLayoutManager(1, 3, new Insets(0, 0, 0, 0), -1, -1));
    parentPanel.add(generalPanel,
            new GridConstraints(0, 0, 1, 1, GridConstraints.ANCHOR_NORTH, GridConstraints.FILL_HORIZONTAL,
                    GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW,
                    GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, null, null,
                    null, 0, false));
    enableEnhancerCheckBox = new JCheckBox();
    enableEnhancerCheckBox.setText("Enable Enhancer");
    generalPanel.add(enableEnhancerCheckBox,
            new GridConstraints(0, 0, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE,
                    GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW,
                    GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));
    final JPanel panel4 = new JPanel();
    panel4.setLayout(new GridLayoutManager(1, 3, new Insets(0, 0, 0, 0), -1, -1));
    generalPanel.add(panel4,
            new GridConstraints(0, 2, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_HORIZONTAL,
                    GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, 1, null, null,
                    null, 0, false));
    jDORadioButton.setText("JDO");
    panel4.add(jDORadioButton,
            new GridConstraints(0, 0, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE,
                    GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW,
                    GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));
    jPARadioButton = new JRadioButton();
    jPARadioButton.setText("JPA");
    panel4.add(jPARadioButton,
            new GridConstraints(0, 1, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE,
                    GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW,
                    GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));
    final Spacer spacer2 = new Spacer();
    panel4.add(spacer2,
            new GridConstraints(0, 2, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_HORIZONTAL,
                    GridConstraints.SIZEPOLICY_WANT_GROW, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0,
                    false));
    generalPanel.add(persistenceImplComboBox,
            new GridConstraints(0, 1, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_HORIZONTAL,
                    GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0,
                    false));
    ButtonGroup buttonGroup;
    buttonGroup = new ButtonGroup();
    buttonGroup.add(jDORadioButton);
    buttonGroup.add(jPARadioButton);
    buttonGroup = new ButtonGroup();
    buttonGroup.add(depProjectModuleRadioButton);
    buttonGroup.add(depManualRadioButton);
}

From source file:org.datanucleus.ide.idea.ui.v10x.DNEConfigFormV10x.java

/**
 * Method generated by IntelliJ IDEA GUI Designer
 * >>> IMPORTANT!! <<<
 * DO NOT edit this method OR call it in your code!
 *
 * @noinspection ALL// w  w w . java 2s.  c  om
 */
private void $$$setupUI$$$() {
    createUIComponents();
    configPanel = new JPanel();
    configPanel.setLayout(new GridLayoutManager(5, 3, new Insets(0, 0, 0, 0), -1, -1));
    enableEnhancerCheckBox = new JCheckBox();
    enableEnhancerCheckBox.setText("Enable Enhancer");
    configPanel.add(enableEnhancerCheckBox,
            new GridConstraints(0, 0, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE,
                    GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW,
                    GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));
    final JPanel panel1 = new JPanel();
    panel1.setLayout(new GridLayoutManager(1, 3, new Insets(0, 0, 0, 0), -1, -1));
    configPanel.add(panel1,
            new GridConstraints(0, 2, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_HORIZONTAL,
                    GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, 1, null, null,
                    null, 0, false));
    jDORadioButton = new JRadioButton();
    jDORadioButton.setText("JDO");
    panel1.add(jDORadioButton,
            new GridConstraints(0, 0, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE,
                    GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW,
                    GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));
    jPARadioButton = new JRadioButton();
    jPARadioButton.setText("JPA");
    panel1.add(jPARadioButton,
            new GridConstraints(0, 1, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE,
                    GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW,
                    GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));
    final Spacer spacer1 = new Spacer();
    panel1.add(spacer1,
            new GridConstraints(0, 2, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_HORIZONTAL,
                    GridConstraints.SIZEPOLICY_WANT_GROW, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0,
                    false));
    configPanel.add(persistenceImplComboBox,
            new GridConstraints(0, 1, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_HORIZONTAL,
                    GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0,
                    false));
    final JLabel label1 = new JLabel();
    label1.setText(" Metadata file extensions (use ';' to separate)");
    configPanel.add(label1,
            new GridConstraints(1, 0, 1, 2, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE,
                    GridConstraints.SIZEPOLICY_FIXED, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0,
                    false));
    includeTestClassesCheckBox = new JCheckBox();
    includeTestClassesCheckBox.setText("Include Test classes");
    configPanel.add(includeTestClassesCheckBox,
            new GridConstraints(1, 2, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE,
                    GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW,
                    GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));
    metadataExtensionTextField.setAlignmentX(0.5f);
    metadataExtensionTextField.setAutoscrolls(true);
    metadataExtensionTextField.setMargin(new Insets(1, 1, 1, 1));
    configPanel.add(metadataExtensionTextField,
            new GridConstraints(2, 0, 1, 2, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_HORIZONTAL,
                    GridConstraints.SIZEPOLICY_WANT_GROW, GridConstraints.SIZEPOLICY_FIXED, null,
                    new Dimension(150, -1), null, 0, false));
    addToCompilerResourceCheckBox = new JCheckBox();
    addToCompilerResourceCheckBox.setText("Add to compiler resource patterns");
    configPanel.add(addToCompilerResourceCheckBox,
            new GridConstraints(2, 2, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE,
                    GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW,
                    GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));
    indexNotReadyPanel = new JPanel();
    indexNotReadyPanel.setLayout(new GridLayoutManager(1, 1, new Insets(0, 0, 0, 0), -1, -1));
    configPanel.add(indexNotReadyPanel,
            new GridConstraints(3, 0, 1, 3, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_BOTH,
                    GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW,
                    GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, null, null,
                    null, 0, false));
    final JLabel label2 = new JLabel();
    label2.setText("Please wait until indexing is finished");
    indexNotReadyPanel.add(label2,
            new GridConstraints(0, 0, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_NONE,
                    GridConstraints.SIZEPOLICY_FIXED, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0,
                    false));
    contentPanel = new JPanel();
    contentPanel.setLayout(new GridLayoutManager(2, 1, new Insets(0, 0, 0, 0), -1, -1));
    configPanel.add(contentPanel,
            new GridConstraints(4, 0, 1, 3, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_BOTH,
                    GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW,
                    GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, null, null,
                    null, 0, false));
    final JPanel panel2 = new JPanel();
    panel2.setLayout(new GridLayoutManager(1, 1, new Insets(0, 0, 0, 0), -1, -1));
    contentPanel.add(panel2,
            new GridConstraints(0, 0, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_BOTH,
                    GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW,
                    GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, null, null,
                    null, 0, false));
    panel2.setBorder(BorderFactory.createTitledBorder(BorderFactory.createEtchedBorder(), "Affected Modules"));
    final JScrollPane scrollPane1 = new JScrollPane();
    panel2.add(scrollPane1,
            new GridConstraints(0, 0, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_BOTH,
                    GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW,
                    GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, null, null,
                    null, 0, false));
    affectedModulesTable = new JTable();
    affectedModulesTable.setEnabled(true);
    affectedModulesTable.setFillsViewportHeight(false);
    affectedModulesTable.setPreferredScrollableViewportSize(new Dimension(450, 30));
    scrollPane1.setViewportView(affectedModulesTable);
    final JPanel panel3 = new JPanel();
    panel3.setLayout(new GridLayoutManager(1, 1, new Insets(0, 0, 0, 0), -1, -1));
    contentPanel.add(panel3,
            new GridConstraints(1, 0, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_BOTH,
                    GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW,
                    GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, null, null,
                    null, 0, false));
    panel3.setBorder(BorderFactory.createTitledBorder("Metadata and annotated classes for enhancement"));
    infoPanel = new JPanel();
    infoPanel.setLayout(new GridLayoutManager(1, 1, new Insets(0, 0, 0, 0), -1, -1));
    panel3.add(infoPanel,
            new GridConstraints(0, 0, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_BOTH,
                    GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW,
                    GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, null, null,
                    null, 0, false));
    final JLabel label3 = new JLabel();
    label3.setText("Please click 'Make Project' to see affected files");
    infoPanel.add(label3,
            new GridConstraints(0, 0, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_NONE,
                    GridConstraints.SIZEPOLICY_FIXED, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0,
                    false));
    metaDataAndClassesScrollPane = new JScrollPane();
    panel3.add(metaDataAndClassesScrollPane,
            new GridConstraints(0, 0, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_BOTH,
                    GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW,
                    GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, null, null,
                    null, 0, false));
    metadataAndClassesTable = new JTable();
    metadataAndClassesTable.setFillsViewportHeight(false);
    metadataAndClassesTable.setFont(new Font(metadataAndClassesTable.getFont().getName(),
            metadataAndClassesTable.getFont().getStyle(), metadataAndClassesTable.getFont().getSize()));
    metadataAndClassesTable.setPreferredScrollableViewportSize(new Dimension(450, 100));
    metaDataAndClassesScrollPane.setViewportView(metadataAndClassesTable);
    ButtonGroup buttonGroup;
    buttonGroup = new ButtonGroup();
    buttonGroup.add(jDORadioButton);
    buttonGroup.add(jPARadioButton);
}

From source file:org.drugis.addis.gui.WelcomeDialog.java

private void initComps() {

    final ButtonGroup examples = new ButtonGroup();
    examples.add(new JRadioButton(Main.Examples.DEPRESSION.name, true));
    examples.add(new JRadioButton(Main.Examples.HYPERTENSION.name));

    final AbstractAction exampleAction = new AbstractAction() {
        public void actionPerformed(ActionEvent arg0) {
            d_main.loadExampleDomain(Main.Examples.findFileName(getSelection(examples).getText()));
            closeWelcome();/*w  ww. ja  v a 2  s  .  c  o  m*/
        }
    };

    final AbstractAction loadAction = new AbstractAction() {
        public void actionPerformed(ActionEvent arg0) {
            if (d_main.fileLoadActions() == JFileChooser.APPROVE_OPTION) {
                closeWelcome();
            }
        }
    };

    final AbstractAction newAction = new AbstractAction() {
        public void actionPerformed(ActionEvent arg0) {
            d_main.newFileActions();
            closeWelcome();
        }
    };

    FormLayout layout = new FormLayout("left:pref, " + SPACING + "px, left:pref",
            "p, 3dlu, p, " + SPACING + "px, p, " + SPACING + "px, p, 3dlu, p");
    PanelBuilder builder = new PanelBuilder(layout);
    final CellConstraints cc = new CellConstraints();

    builder.add(createImageLabel(FileNames.IMAGE_HEADER), cc.xyw(1, 1, 3));
    builder.add(createButton("Load example", FileNames.ICON_TIP, exampleAction), cc.xy(1, 3));

    final PanelBuilder radios = new PanelBuilder(new FormLayout("p, fill:pref:grow, right:pref", "p, 3dlu, p"));

    final ArrayList<AbstractButton> buttons = Collections.list(examples.getElements());
    forAllDo(buttons, new Closure<AbstractButton>() {
        public void execute(final AbstractButton exampleOption) {
            int row = buttons.indexOf(exampleOption) == 0 ? 1 : buttons.indexOf(exampleOption) + 2;
            exampleOption.setOpaque(false);
            radios.add(exampleOption, cc.xy(1, row));
            radios.add(createHelpButton(exampleOption), cc.xy(3, row));
        }

        private JButton createHelpButton(final AbstractButton exampleOption) {
            JButton help = GUIFactory.createIconButton(org.drugis.mtc.gui.FileNames.ICON_ABOUT,
                    "Information about this example");
            removeBackground(help);

            help.addActionListener(new ActionListener() {
                public void actionPerformed(ActionEvent e) {
                    Examples example = Examples.findByName(exampleOption.getText());
                    String helpText = s_help.getHelpText(example.name().toLowerCase());
                    showExampleInfo(helpText);
                }
            });
            return help;
        }
    });

    JPanel radiosPanel = radios.getPanel();
    setBorder(radiosPanel);
    builder.add(radiosPanel, cc.xy(3, 3));

    builder.add(createButton("Open file", FileNames.ICON_OPENFILE, loadAction), cc.xy(1, 5));
    JTextPane load = createLabel("Load an existing ADDIS data file stored on your computer.");
    builder.add(load, cc.xy(3, 5));

    builder.add(createButton("New dataset", FileNames.ICON_FILE_NEW, newAction), cc.xy(1, 7));
    builder.add(createLabel("Start with an empty file to build up your own data and analyses."), cc.xy(3, 7));

    builder.add(createImageLabel(FileNames.IMAGE_FOOTER), cc.xyw(1, 9, 3));

    setContentPane(builder.getPanel());
}

From source file:org.esa.s1tbx.ocean.worldwind.layers.Level2ProductLayer.java

public JPanel getControlPanel(final WorldWindowGLCanvas wwd) {
    theControlLevel2Panel = new JPanel(new GridLayout(7, 1, 5, 5));
    theControlLevel2Panel.setVisible(false);
    final JRadioButton owiBtn = new JRadioButton("OWI");
    owiBtn.addActionListener(new ActionListener() {
        public void actionPerformed(ActionEvent actionEvent) {
            theSelectedComp = "owi";
            setComponentVisible("owi", wwd);
            theArrowsCB.setEnabled(true);
        }//  w  w w  .  j a v  a 2s.c  om
    });

    final JRadioButton oswBtn = new JRadioButton("OSW");
    oswBtn.addActionListener(new ActionListener() {
        public void actionPerformed(ActionEvent actionEvent) {
            theSelectedComp = "osw";
            setComponentVisible("osw", wwd);
            theArrowsCB.setEnabled(false);

            //SystemUtils.LOG.info("theSurfaceProductHash " + theSurfaceProductHash);
            //SystemUtils.LOG.info("theSurfaceSequenceHash " + theSurfaceSequenceHash);
        }
    });

    final JRadioButton rvlBtn = new JRadioButton("RVL");
    rvlBtn.addActionListener(new ActionListener() {
        public void actionPerformed(ActionEvent actionEvent) {
            theSelectedComp = "rvl";
            //System.out.println("rvl:");
            //setComponentVisible("owi", false, getWwd());
            //setComponentVisible("osw", false, getWwd());
            setComponentVisible("rvl", wwd);
            theArrowsCB.setEnabled(false);
        }
    });

    final ButtonGroup group = new ButtonGroup();
    group.add(owiBtn);
    group.add(oswBtn);
    group.add(rvlBtn);
    owiBtn.setSelected(true);

    theSelectedComp = "owi";

    final JPanel componentTypePanel = new JPanel(new GridLayout(1, 4, 5, 5));
    componentTypePanel.setBorder(BorderFactory.createEmptyBorder(4, 4, 4, 4));
    componentTypePanel.add(new JLabel("Component:"));
    componentTypePanel.add(owiBtn);
    componentTypePanel.add(oswBtn);
    componentTypePanel.add(rvlBtn);
    theControlLevel2Panel.add(componentTypePanel);

    final JPanel arrowDisplayPanel = new JPanel(new GridLayout(1, 2, 5, 5));

    theArrowsCB = new JCheckBox(new AbstractAction() {
        public void actionPerformed(ActionEvent actionEvent) {
            // Simply enable or disable the layer based on its toggle button.
            if (((JCheckBox) actionEvent.getSource()).isSelected())
                theOWIArrowsDisplayed = true;
            else
                theOWIArrowsDisplayed = false;

            wwd.redrawNow();
        }
    });

    arrowDisplayPanel.add(new JLabel("Display Wind Vectors:"));
    arrowDisplayPanel.add(theArrowsCB);
    theControlLevel2Panel.add(arrowDisplayPanel);

    /*
    final JPanel subsectionPanel = new JPanel(new GridLayout(1, 2, 5, 5));
    JComboBox sectionDropDown = new JComboBox();
    sectionDropDown.addItem("001");
    sectionDropDown.addActionListener(new ActionListener() {
    public void actionPerformed(ActionEvent e) {
        SystemUtils.LOG.info("drop down changed");
    }
    });
            
    subsectionPanel.add(new JLabel("Subsection:"));
    subsectionPanel.add(sectionDropDown);
            
    theControlLevel2Panel.add(subsectionPanel);
    */

    final JPanel maxPanel = new JPanel(new GridLayout(1, 2, 5, 5));
    maxPanel.add(new JLabel("Max OWI Wind Speed:"));

    final JSpinner maxSP = new JSpinner(new SpinnerNumberModel(10, 0, 10, 1));
    maxSP.addChangeListener(new ChangeListener() {
        @Override
        public void stateChanged(ChangeEvent e) {
            int newValue = (Integer) ((JSpinner) e.getSource()).getValue();

            theOWILimitChanged = true;
        }
    });
    maxPanel.add(maxSP);
    theControlLevel2Panel.add(maxPanel);

    final JPanel minPanel = new JPanel(new GridLayout(1, 2, 5, 5));
    minPanel.add(new JLabel("Min OWI Wind Speed:"));

    final JSpinner minSP = new JSpinner(new SpinnerNumberModel(0, 0, 10, 1));
    minSP.addChangeListener(new ChangeListener() {
        @Override
        public void stateChanged(ChangeEvent e) {
            theOWILimitChanged = true;
        }
    });
    minPanel.add(minSP);
    theControlLevel2Panel.add(minPanel);

    final JPanel maxRVLPanel = new JPanel(new GridLayout(1, 2, 5, 5));
    maxRVLPanel.add(new JLabel("Max RVL Rad Vel.:"));

    final JSpinner maxRVLSP = new JSpinner(new SpinnerNumberModel(6, 0, 10, 1));
    maxRVLSP.addChangeListener(new ChangeListener() {
        @Override
        public void stateChanged(ChangeEvent e) {
            int newValue = (Integer) ((JSpinner) e.getSource()).getValue();
            theRVLLimitChanged = true;
        }
    });
    maxRVLPanel.add(maxRVLSP);
    theControlLevel2Panel.add(maxRVLPanel);

    final JButton updateButton = new JButton("Update");
    updateButton.addActionListener(new ActionListener() {
        public void actionPerformed(ActionEvent actionEvent) {

            if (theOWILimitChanged) {

                //double minValue = ((Integer) minSP.getValue()) * 1.0e4;
                //double maxValue = ((Integer) maxSP.getValue()) * 1.0e4;
                double minValue = ((Integer) minSP.getValue());
                double maxValue = ((Integer) maxSP.getValue());
                recreateColorBarAndGradient(minValue, maxValue, "owi", wwd,
                        theSelectedComp.equalsIgnoreCase("owi"));
            }

            if (theRVLLimitChanged) {
                //SystemUtils.LOG.info("theRVLLimitChanged");

                //double minValue = ((Integer) minSP.getValue()) * 1.0e4;
                //double maxValue = ((Integer) maxSP.getValue()) * 1.0e4;

                double maxValue = ((Integer) maxRVLSP.getValue());
                double minValue = -1 * maxValue;

                recreateColorBarAndGradient(minValue, maxValue, "rvl", wwd,
                        theSelectedComp.equalsIgnoreCase("rvl"));
            }

            theOWILimitChanged = false;
            theRVLLimitChanged = false;
        }
    });
    theControlLevel2Panel.add(updateButton);

    createColorBarLegend(0, 10, "OWI Wind Speed", "owi");
    createColorBarLegend(0, 10, "OSW Wave Height.", "osw");
    createColorBarLegend(-6, 6, "RVL Rad. Vel.", "rvl");
    //addRenderable(theColorBarLegendHash.get("owi"));

    return theControlLevel2Panel;
}

From source file:org.executequery.gui.scriptgenerators.GenerateScriptsPanelThree.java

private void createTableOptionsPanel() {

    constraintsCheck = new JCheckBox("Include constraints");
    consAsAlterCheck = new JCheckBox("As ALTER TABLE statements", true);
    consInCreateCheck = new JCheckBox("Within CREATE TABLE statements");

    constraintsCheck.addItemListener(this);

    ButtonGroup bg = new ButtonGroup();
    bg.add(consAsAlterCheck);
    bg.add(consInCreateCheck);/*from www . j  a  v a2  s  .  co m*/

    consInCreateCheck.setEnabled(false);
    consAsAlterCheck.setEnabled(false);

    createTableOptionsPanel = new ComponentTitledPanel(constraintsCheck);
    JPanel _panel = createTableOptionsPanel.getContentPane();
    _panel.setLayout(new FlowLayout(FlowLayout.LEFT, 15, 5));
    _panel.add(consAsAlterCheck);
    _panel.add(consInCreateCheck);
}