Example usage for javax.swing JPanel setVisible

List of usage examples for javax.swing JPanel setVisible

Introduction

In this page you can find the example usage for javax.swing JPanel setVisible.

Prototype

@BeanProperty(hidden = true, visualUpdate = true)
public void setVisible(boolean aFlag) 

Source Link

Document

Makes the component visible or invisible.

Usage

From source file:com.rapidminer.gui.viewer.metadata.AttributeStatisticsPanel.java

/**
 * Updates chart panel visibility depending on enlarged status.
 *///from   w  w w  . ja  v a  2 s.  c o  m
private void updateVisibilityOfChartPanels() {
    for (JPanel chartPanel : listOfChartPanels) {
        if (getModel() != null && getModel().isEnlarged()) {
            chartPanel.setVisible(true);
        } else {
            chartPanel.setVisible(false);
        }
    }
}

From source file:lcmc.gui.resources.EditableInfo.java

/** Adds parameters to the panel. */
private void addParams(final JPanel optionsPanel, final String prefix, final String[] params,
        final MyButton thisApplyButton, final int leftWidth, final int rightWidth,
        final Map<String, Widget> sameAsFields) {
    if (params == null) {
        return;//from  w w  w.j  av  a2  s .  c o m
    }
    final MultiKeyMap<String, JPanel> panelPartsMap = new MultiKeyMap<String, JPanel>();
    final List<PanelPart> panelPartsList = new ArrayList<PanelPart>();
    final MultiKeyMap<String, Integer> panelPartRowsMap = new MultiKeyMap<String, Integer>();

    for (final String param : params) {
        final Widget paramWi = createWidget(param, prefix, rightWidth);
        /* sub panel */
        final String section = getSection(param);
        JPanel panel;
        final ConfigData.AccessType accessType = getAccessType(param);
        final String accessTypeString = accessType.toString();
        final Boolean advanced = isAdvanced(param);
        final String advancedString = advanced.toString();
        if (panelPartsMap.containsKey(section, accessTypeString, advancedString)) {
            panel = panelPartsMap.get(section, accessTypeString, advancedString);
            panelPartRowsMap.put(section, accessTypeString, advancedString,
                    panelPartRowsMap.get(section, accessTypeString, advancedString) + 1);
        } else {
            panel = new JPanel(new SpringLayout());
            panel.setBackground(Browser.PANEL_BACKGROUND);
            if (advanced) {
                advancedPanelList.add(panel);
                final JPanel p = panel;
                SwingUtilities.invokeLater(new Runnable() {
                    @Override
                    public void run() {
                        p.setVisible(Tools.getConfigData().isAdvancedMode());
                    }
                });
            }
            panelPartsMap.put(section, accessTypeString, advancedString, panel);
            panelPartsList.add(new PanelPart(section, accessType, advanced));
            panelPartRowsMap.put(section, accessTypeString, advancedString, 1);
        }

        /* label */
        final JLabel label = new JLabel(getParamShortDesc(param));
        final String longDesc = getParamLongDesc(param);
        paramWi.setLabel(label, longDesc);

        /* tool tip */
        SwingUtilities.invokeLater(new Runnable() {
            @Override
            public void run() {
                paramWi.setToolTipText(getToolTipText(param));
                label.setToolTipText(longDesc);
            }
        });
        int height = 0;
        if (paramWi.getType() == Widget.Type.LABELFIELD) {
            height = Tools.getDefaultSize("Browser.LabelFieldHeight");
        }
        addField(panel, label, paramWi, leftWidth, rightWidth, height);
    }
    for (final String param : params) {
        final Widget paramWi = getWidget(param, prefix);
        Widget rpwi = null;
        if ("wizard".equals(prefix)) {
            rpwi = getWidget(param, null);
            if (rpwi == null) {
                Tools.appError("unkown param: " + param + ". Man pages not installed?");
                continue;
            }
            int height = 0;
            if (rpwi.getType() == Widget.Type.LABELFIELD) {
                height = Tools.getDefaultSize("Browser.LabelFieldHeight");
            }
            final Widget rpwi0 = rpwi;
            SwingUtilities.invokeLater(new Runnable() {
                @Override
                public void run() {
                    if (paramWi.getValue() == null || paramWi.getValue() == Widget.NOTHING_SELECTED) {
                        rpwi0.setValueAndWait(null);
                    } else {
                        final Object value = paramWi.getStringValue();
                        rpwi0.setValueAndWait(value);
                    }
                }
            });
        }
    }
    for (final String param : params) {
        final Widget paramWi = getWidget(param, prefix);
        Widget rpwi = null;
        if ("wizard".equals(prefix)) {
            rpwi = getWidget(param, null);
        }
        final Widget realParamWi = rpwi;
        SwingUtilities.invokeLater(new Runnable() {
            @Override
            public void run() {
                paramWi.addListeners(new WidgetListener() {
                    @Override
                    public void check(final Object value) {
                        checkParameterFields(paramWi, realParamWi, param, params, thisApplyButton);
                    }
                });

            }
        });
    }

    /* add sub panels to the option panel */
    final Map<String, JPanel> sectionMap = new HashMap<String, JPanel>();
    final Set<JPanel> notAdvancedSections = new HashSet<JPanel>();
    final Set<JPanel> advancedSections = new HashSet<JPanel>();
    for (final PanelPart panelPart : panelPartsList) {
        final String section = panelPart.getSection();
        final ConfigData.AccessType accessType = panelPart.getAccessType();
        final String accessTypeString = accessType.toString();
        final Boolean advanced = panelPart.isAdvanced();
        final String advancedString = advanced.toString();

        final JPanel panel = panelPartsMap.get(section, accessTypeString, advancedString);
        final int rows = panelPartRowsMap.get(section, accessTypeString, advancedString);
        final int columns = 2;
        SpringUtilities.makeCompactGrid(panel, rows, columns, 1, 1, // initX, initY
                1, 1); // xPad, yPad
        JPanel sectionPanel;
        if (sectionMap.containsKey(section)) {
            sectionPanel = sectionMap.get(section);
        } else {
            sectionPanel = getParamPanel(section);
            sectionMap.put(section, sectionPanel);
            optionsPanel.add(sectionPanel);
            if (sameAsFields != null) {
                final Widget sameAsCombo = sameAsFields.get(section);
                if (sameAsCombo != null) {
                    final JPanel saPanel = new JPanel(new SpringLayout());
                    saPanel.setBackground(Browser.BUTTON_PANEL_BACKGROUND);
                    final JLabel label = new JLabel("Same As");
                    sameAsCombo.setLabel(label, "");
                    addField(saPanel, label, sameAsCombo, leftWidth, rightWidth, 0);
                    SpringUtilities.makeCompactGrid(saPanel, 1, 2, 1, 1, // initX, initY
                            1, 1); // xPad, yPad
                    sectionPanel.add(saPanel);
                }
            }
        }
        sectionPanel.add(panel);
        if (advanced) {
            advancedSections.add(sectionPanel);
        } else {
            notAdvancedSections.add(sectionPanel);
        }
    }
    boolean advanced = false;
    for (final JPanel sectionPanel : sectionMap.values()) {
        if (advancedSections.contains(sectionPanel)) {
            advanced = true;
        }
        if (!notAdvancedSections.contains(sectionPanel)) {
            advancedOnlySectionList.add(sectionPanel);
            SwingUtilities.invokeLater(new Runnable() {
                @Override
                public void run() {
                    sectionPanel.setVisible(Tools.getConfigData().isAdvancedMode());
                }
            });
        }
    }
    final boolean a = advanced;
    SwingUtilities.invokeLater(new Runnable() {
        @Override
        public void run() {
            moreOptionsPanel.setVisible(a && !Tools.getConfigData().isAdvancedMode());
        }
    });
}

From source file:electroStaticUI.UserInput.java

@SuppressWarnings({ "rawtypes", "unchecked" })
private void getChargeData() {
    numberOfCharges = Integer.parseInt(getNumberOfCharges.getText());
    DefaultValues.allocatePointChargeArray(numberOfCharges);
    chargesToCalc = new PointCharge[numberOfCharges];
    mapper = new CustomMapper(DefaultValues.getCircOrRect());
    chargeDataFrame = new JFrame();
    chargeDataFrame.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
    JPanel chargeDataPanel = new JPanel();
    chargeDataFrame.setTitle("Data For Charge #: " + (1 + okButtonPushes));
    JLabel chargeLabel = new JLabel("Charge");
    JLabel chargeUnitLabel = new JLabel("C");
    charge = new JTextField(10);
    charge.setEditable(true);//from w w  w  . j av  a  2 s .c om
    chargeModComboBox = new JComboBox(chargeModList);
    chargeModComboBox.setSelectedIndex(5);
    chargeModComboBox.setVisible(true);
    JLabel xPositionLabel = new JLabel("X Value");
    xPosition = new JTextField(10);
    xPosition.setEditable(true);
    JLabel yPositionLabel = new JLabel("Y Value");
    yPosition = new JTextField(10);
    yPosition.setEditable(true);
    //JLabel zPositionLabel = new JLabel("Z Value");
    //JTextField zPosition = new JTextField(5);
    //zPosition.setEditable(true);
    JButton okButton = new JButton("OK");
    chargeDataPanel.add(chargeLabel);
    chargeDataPanel.add(charge);
    chargeDataPanel.add(chargeModComboBox);
    chargeDataPanel.add(chargeUnitLabel);
    chargeDataPanel.add(xPositionLabel);
    chargeDataPanel.add(xPosition);
    chargeDataPanel.add(yPositionLabel);
    chargeDataPanel.add(yPosition);
    chargeDataPanel.add(okButton);
    chargeDataPanel.setMinimumSize(new Dimension(600, 100));
    chargeDataPanel.setVisible(true);
    chargeDataFrame.add(chargeDataPanel);
    chargeDataFrame.setVisible(true);
    chargeDataFrame.setMinimumSize(new Dimension(600, 100));
    xPosition.setText("0");
    yPosition.setText("0");
    charge.setText("0");
    /*
     * okButton anonymous action listener takes the data entered into the JTextfields and creates point charges from it.
     */
    okButton.addActionListener(new ActionListener() {
        public void actionPerformed(ActionEvent e) {
            //do {
            //chargesToCalc[okButtonPushes] = new PointCharge(Double.parseDouble(charge.getText()), Double.parseDouble(xPosition.getText()), Double.parseDouble(yPosition.getText()));
            int chargeModIndex = chargeModComboBox.getSelectedIndex();
            DefaultValues.setChargeModIndex(chargeModIndex);
            chargeValue = Double.parseDouble(charge.getText());
            xValue = Double.parseDouble(xPosition.getText());
            yValue = Double.parseDouble(yPosition.getText());
            chargesToCalc[okButtonPushes] = new PointCharge(chargeValue, xValue, yValue);
            charge.setText("0");
            xPosition.setText("0");
            yPosition.setText("0");
            okButtonPushes++;
            chargeDataFrame.setTitle("Data For Charge #: " + (1 + okButtonPushes));
            if (okButtonPushes == numberOfCharges) {
                confirm = JOptionPane.showConfirmDialog(null,
                        "You have entered " + okButtonPushes
                                + " charges. Press OK to confirm. \nPress Cancel to re-enter the charges",
                        null, JOptionPane.OK_CANCEL_OPTION);
                if (confirm == JOptionPane.OK_OPTION) {
                    DefaultValues.setCurrentPointCharges(chargesToCalc);
                    ElectroStaticUIContainer.removeGraphFromdisplayPanel();
                    theCalculator = new CalculatorPanel();
                    calcVec = new VectorCalculator(mapper);
                    volts = new VoltageAtPoint(mapper.getFieldPoints());
                    manGraph = new ManualPolygons(mapper);
                    chart = manGraph.delaunayBuild();
                    drawVecs = new DrawElectricFieldLines(mapper);
                    ElectroStaticUIContainer.add3DGraphToDisplayPanel(chart);
                    ElectroStaticUIContainer.addVectorGraphToDisplayPanel(drawVecs.getChart());
                    setVectorChartToSave();
                    setChart3dToSave();
                    rotateIt = new ChartMouseController(chart);
                    okButtonPushes = 0;
                    chargeDataFrame.removeAll();
                    chargeDataFrame.dispose();
                } else if (confirm == JOptionPane.CANCEL_OPTION)
                    okButtonPushes = 0;
            }

        }
        //while(okButtonPushes < numberOfCharges);

        //}
    });
}

From source file:com.igormaznitsa.sciareto.ui.MainFrame.java

public MainFrame(@Nonnull @MustNotContainNull final String... args) {
    super();/*from  w w  w  . jav  a2  s.  com*/
    initComponents();

    this.stackPanel = new JPanel();
    this.stackPanel.setFocusable(false);
    this.stackPanel.setOpaque(false);
    this.stackPanel.setBorder(BorderFactory.createEmptyBorder(32, 32, 16, 32));
    this.stackPanel.setLayout(new BoxLayout(this.stackPanel, BoxLayout.Y_AXIS));

    final JPanel glassPanel = (JPanel) this.getGlassPane();
    glassPanel.setOpaque(false);

    this.setGlassPane(glassPanel);

    glassPanel.setLayout(new BorderLayout(8, 8));
    glassPanel.add(Box.createGlue(), BorderLayout.CENTER);

    final JPanel ppanel = new JPanel(new BorderLayout(0, 0));
    ppanel.setFocusable(false);
    ppanel.setOpaque(false);
    ppanel.setCursor(null);
    ppanel.add(this.stackPanel, BorderLayout.SOUTH);

    glassPanel.add(ppanel, BorderLayout.EAST);

    this.stackPanel.add(Box.createGlue());

    glassPanel.setVisible(false);

    this.setTitle("Scia Reto");

    setIconImage(UiUtils.loadImage("logo256x256.png"));

    this.stateless = args.length > 0;

    final MainFrame theInstance = this;

    this.addWindowListener(new WindowAdapter() {
        @Override
        public void windowClosing(@Nonnull final WindowEvent e) {
            if (doClosing()) {
                dispose();
            }
        }
    });

    this.tabPane = new EditorTabPane(this);

    this.explorerTree = new ExplorerTree(this);

    final JSplitPane splitPane = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT);
    splitPane.setOneTouchExpandable(true);
    splitPane.setDividerLocation(250);
    splitPane.setResizeWeight(0.0d);
    splitPane.setLeftComponent(this.explorerTree);
    splitPane.setRightComponent(this.tabPane);

    add(splitPane, BorderLayout.CENTER);

    this.menuOpenRecentProject.addMenuListener(new MenuListener() {
        @Override
        public void menuSelected(MenuEvent e) {
            final File[] lastOpenedProjects = FileHistoryManager.getInstance().getLastOpenedProjects();
            if (lastOpenedProjects.length > 0) {
                for (final File folder : lastOpenedProjects) {
                    final JMenuItem item = new JMenuItem(folder.getName());
                    item.setToolTipText(folder.getAbsolutePath());
                    item.addActionListener(new ActionListener() {
                        @Override
                        public void actionPerformed(ActionEvent e) {
                            openProject(folder, false);
                        }
                    });
                    menuOpenRecentProject.add(item);
                }
            }
        }

        @Override
        public void menuDeselected(MenuEvent e) {
            menuOpenRecentProject.removeAll();
        }

        @Override
        public void menuCanceled(MenuEvent e) {
        }
    });

    this.menuOpenRecentFile.addMenuListener(new MenuListener() {
        @Override
        public void menuSelected(MenuEvent e) {
            final File[] lastOpenedFiles = FileHistoryManager.getInstance().getLastOpenedFiles();
            if (lastOpenedFiles.length > 0) {
                for (final File file : lastOpenedFiles) {
                    final JMenuItem item = new JMenuItem(file.getName());
                    item.setToolTipText(file.getAbsolutePath());
                    item.addActionListener(new ActionListener() {
                        @Override
                        public void actionPerformed(ActionEvent e) {
                            openFileAsTab(file);
                        }
                    });
                    menuOpenRecentFile.add(item);
                }
            }
        }

        @Override
        public void menuDeselected(MenuEvent e) {
            menuOpenRecentFile.removeAll();
        }

        @Override
        public void menuCanceled(MenuEvent e) {
        }
    });

    if (!this.stateless) {
        restoreState();
    } else {
        boolean openedProject = false;
        for (final String filePath : args) {
            final File file = new File(filePath);
            if (file.isDirectory()) {
                openedProject = true;
                openProject(file, true);
            } else if (file.isFile()) {
                openFileAsTab(file);
            }
        }
        if (!openedProject) {
            //TODO try to hide project panel!
        }
    }

    final LookAndFeel current = UIManager.getLookAndFeel();
    final ButtonGroup lfGroup = new ButtonGroup();
    final String currentLFClassName = current.getClass().getName();
    for (final UIManager.LookAndFeelInfo info : UIManager.getInstalledLookAndFeels()) {
        final JRadioButtonMenuItem menuItem = new JRadioButtonMenuItem(info.getName());
        lfGroup.add(menuItem);
        if (currentLFClassName.equals(info.getClassName())) {
            menuItem.setSelected(true);
        }
        menuItem.addActionListener(new ActionListener() {
            @Override
            public void actionPerformed(@Nonnull final ActionEvent e) {
                try {
                    UIManager.setLookAndFeel(info.getClassName());
                    SwingUtilities.updateComponentTreeUI(theInstance);
                    PreferencesManager.getInstance().getPreferences().put(Main.PROPERTY_LOOKANDFEEL,
                            info.getClassName());
                    PreferencesManager.getInstance().flush();
                } catch (Exception ex) {
                    LOGGER.error("Can't change LF", ex);
                }
            }
        });
        this.menuLookAndFeel.add(menuItem);
    }
}

From source file:homenetapp.HomeNetAppGui.java

/** Creates new form HomeNetAppGui */
public HomeNetAppGui() {
    this.setLocationRelativeTo(null);

    //        try {
    //          javax.swing.UIManager.setLookAndFeel(javax.swing.UIManager.getSystemLookAndFeelClassName());
    //        } catch (Exception e) {e.printStackTrace();}

    homenetapp = new HomeNetApp();

    initComponents();// ww  w  .  j  a  v a2s  .  c  o  m

    ImageIcon ImageIcon = new ImageIcon(getClass().getResource("/HomeNetIcon.gif"));
    java.awt.Image Image = ImageIcon.getImage();
    this.setIconImage(Image);
    SendPacketFrame.setIconImage(Image);

    //redirectSystemStreams();//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
    System.err.println("test");
    SettingsDialog.setLocationRelativeTo(null);

    //if not configured
    //if(true){
    if (homenetapp.configDone == false) {
        System.out.println("HomeNet App Not Setup");
        System.out.println("Launching Setup Wizard");
        javax.swing.JPanel wizardPanel = new SetupWizardGui(this);
        cardPanel.add(wizardPanel, "wizard");
        //validate();

        pack();
        wizardPanel.setVisible(true);

        ((java.awt.CardLayout) cardPanel.getLayout()).next(cardPanel);
        // ((java.awt.CardLayout) cardPanel.getLayout()).show(cardPanel,"wizard");

    } else {
        startMainGui();
    }

    //redirect console to gui

}

From source file:lcmc.common.ui.EditableInfo.java

/** Adds parameters to the panel. */
private void addParams(final JPanel optionsPanel, final String prefix, final String[] params,
        final MyButton thisApplyButton, final int leftWidth, final int rightWidth,
        final Map<String, Widget> sameAsFields) {
    swingUtils.isSwingThread();/*from  w  w w. ja va2  s.  c om*/
    if (params == null) {
        return;
    }
    final MultiKeyMap<String, JPanel> panelPartsMap = new MultiKeyMap<String, JPanel>();
    final Collection<PanelPart> panelPartsList = new ArrayList<PanelPart>();
    final MultiKeyMap<String, Integer> panelPartRowsMap = new MultiKeyMap<String, Integer>();

    for (final String param : params) {
        final Widget paramWi = createWidget(param, prefix, rightWidth);
        /* sub panel */
        final String section = getSection(param);
        final JPanel panel;
        final AccessMode.Type accessType = getAccessType(param);
        final String accessTypeString = accessType.toString();
        final Boolean advanced = isAdvanced(param);
        final String advancedString = advanced.toString();
        if (panelPartsMap.containsKey(section, accessTypeString, advancedString)) {
            panel = panelPartsMap.get(section, accessTypeString, advancedString);
            panelPartRowsMap.put(section, accessTypeString, advancedString,
                    panelPartRowsMap.get(section, accessTypeString, advancedString) + 1);
        } else {
            panel = new JPanel(new SpringLayout());

            panel.setBackground(getSectionColor(section));
            if (advanced) {
                advancedPanelList.add(panel);
                panel.setVisible(access.isAdvancedMode());
            }
            panelPartsMap.put(section, accessTypeString, advancedString, panel);
            panelPartsList.add(new PanelPart(section, accessType, advanced));
            panelPartRowsMap.put(section, accessTypeString, advancedString, 1);
        }

        /* label */
        final JLabel label = new JLabel(getParamShortDesc(param));
        final String longDesc = getParamLongDesc(param);
        paramWi.setLabel(label, longDesc);

        /* tool tip */
        paramWi.setToolTipText(getToolTipText(param, paramWi));
        label.setToolTipText(longDesc + additionalToolTip(param));
        int height = 0;
        if (paramWi instanceof Label) {
            height = application.getDefaultSize("Browser.LabelFieldHeight");
        }
        addField(panel, label, paramWi.getComponent(), leftWidth, rightWidth, height);
    }
    final boolean wizard = Widget.WIZARD_PREFIX.equals(prefix);
    for (final String param : params) {
        final Widget paramWi = getWidget(param, prefix);
        if (wizard) {
            final Widget rpwi = getWidget(param, null);
            if (rpwi == null) {
                LOG.error("addParams: unknown param: " + param);
                continue;
            }
            if (paramWi.getValue() == null || paramWi.getValue().isNothingSelected()) {
                rpwi.setValueAndWait(null);
            } else {
                final Value value = paramWi.getValue();
                rpwi.setValueAndWait(value);
            }
        }
    }
    for (final String param : params) {
        final Widget paramWi = getWidget(param, prefix);
        Widget rpwi = null;
        if (wizard) {
            rpwi = getWidget(param, null);
        }
        final Widget realParamWi = rpwi;
        paramWi.addListeners(new WidgetListener() {
            @Override
            public void check(final Value value) {
                checkParameterFields(paramWi, realParamWi, param, getParametersFromXML(), thisApplyButton);
            }
        });
    }

    /* add sub panels to the option panel */
    final Map<String, JPanel> sectionMap = new HashMap<String, JPanel>();
    final Collection<JPanel> notAdvancedSections = new HashSet<JPanel>();
    final Collection<JPanel> advancedSections = new HashSet<JPanel>();
    for (final PanelPart panelPart : panelPartsList) {
        final String section = panelPart.getSection();
        final AccessMode.Type accessType = panelPart.getType();
        final String accessTypeString = accessType.toString();
        final Boolean advanced = panelPart.isAdvanced();
        final String advancedString = advanced.toString();

        final JPanel panel = panelPartsMap.get(section, accessTypeString, advancedString);
        final int rows = panelPartRowsMap.get(section, accessTypeString, advancedString);
        final int columns = 2;
        SpringUtilities.makeCompactGrid(panel, rows, columns, 1, 1, // initX, initY
                1, 1); // xPad, yPad
        final JPanel sectionPanel;
        if (sectionMap.containsKey(section)) {
            sectionPanel = sectionMap.get(section);
        } else {
            sectionPanel = getParamPanel(getSectionDisplayName(section), getSectionColor(section));
            sectionMap.put(section, sectionPanel);
            addSectionPanel(section, wizard, sectionPanel);
            optionsPanel.add(sectionPanel);
            if (sameAsFields != null) {
                final Widget sameAsCombo = sameAsFields.get(section);
                if (sameAsCombo != null) {
                    final JPanel saPanel = new JPanel(new SpringLayout());
                    saPanel.setBackground(Browser.BUTTON_PANEL_BACKGROUND);
                    final JLabel label = new JLabel(Tools.getString("ClusterBrowser.SameAs"));
                    sameAsCombo.setLabel(label, "");
                    addField(saPanel, label, sameAsCombo.getComponent(), leftWidth, rightWidth, 0);
                    SpringUtilities.makeCompactGrid(saPanel, 1, 2, 1, 1, // initX, initY
                            1, 1); // xPad, yPad
                    sectionPanel.add(saPanel);
                }
            }
        }
        sectionPanel.setVisible(isSectionEnabled(section));
        sectionPanel.add(panel);
        if (advanced) {
            advancedSections.add(sectionPanel);
        } else {
            notAdvancedSections.add(sectionPanel);
        }
    }
    boolean advanced = false;
    for (final Map.Entry<String, JPanel> sectionEntry : sectionMap.entrySet()) {
        final JPanel sectionPanel = sectionEntry.getValue();
        if (advancedSections.contains(sectionPanel)) {
            advanced = true;
        }
        if (!notAdvancedSections.contains(sectionPanel)) {
            advancedOnlySectionList.add(sectionEntry.getKey());
            sectionPanel.setVisible(access.isAdvancedMode() && isSectionEnabled(sectionEntry.getKey()));
        }
    }
    moreOptionsPanel.setVisible(advanced && !access.isAdvancedMode());
}

From source file:org.cds06.speleograph.graph.ValueAxisEditor.java

/**
 * {@inheritDoc}/*from   w  ww . j a v a 2 s.c o m*/
 */
@Override
protected void setup() {
    PanelBuilder builder = new PanelBuilder(getFormLayout(), getPanel());
    CellConstraints cc = new CellConstraints();

    Dimension d = maxModifier.getPreferredSize();
    maxModifier.setPreferredSize(new Dimension(d.width + 50, d.height));
    d = minModifier.getPreferredSize();
    minModifier.setPreferredSize(new Dimension(d.width + 50, d.height));

    {
        builder.add(new JLabel("Titre de l'axe :"));
        final JTextField axisTitleField = new JTextField();
        axisTitleField.setText(axis.getLabel());
        builder.nextColumn(2);
        builder.add(axisTitleField, cc.xyw(3, 1, 5));
        addListenerOnSuccess(new ActionListener() {
            @Override
            public void actionPerformed(ActionEvent e) {
                String text = axisTitleField.getText();
                if (text != null && !text.equals(""))
                    axis.setLabel(axisTitleField.getText());
            }
        });
    }

    {
        builder.nextLine(2);
        builder.add(new JLabel("Valeur min. :"));
        builder.nextColumn(2);
        builder.add(lowField);
        addListenerOnSuccess(new ActionListener() {
            @Override
            public void actionPerformed(ActionEvent e) {
                try {
                    Double value = Double.valueOf(lowField.getText());
                    if (isApply) {
                        axis.setLowerBound(value);
                    } else if (isCancel && oldLowValue != null)
                        axis.setLowerBound(oldLowValue);
                } catch (NumberFormatException e1) {
                    canClose = false;
                    JOptionPane.showMessageDialog(ValueAxisEditor.this.getParent(),
                            "'" + lowField.getText() + "' n'est pas un nombre", "Erreur",
                            JOptionPane.ERROR_MESSAGE);
                }
            }
        });
        builder.nextColumn(2);
        builder.add(new JLabel("+"));
        builder.nextColumn(2);
        builder.add(minModifier);
    }

    {
        builder.nextLine(2);
        builder.add(new JLabel("Valeur max. :"));
        builder.nextColumn(2);
        builder.add(maxField);
        addListenerOnSuccess(new ActionListener() {
            @Override
            public void actionPerformed(ActionEvent e) {
                try {
                    Double value = Double.valueOf(maxField.getText());
                    if (isApply) {
                        axis.setUpperBound(value);
                    } else if (isCancel && oldHighValue != null)
                        axis.setUpperBound(oldHighValue);
                } catch (NumberFormatException e1) {
                    canClose = false;
                    JOptionPane.showMessageDialog(ValueAxisEditor.this.getParent(),
                            "'" + maxField.getText() + "' n'est pas un nombre", "Erreur",
                            JOptionPane.ERROR_MESSAGE);
                }
            }
        });
        builder.nextColumn(2);
        builder.add(new JLabel("+"));
        builder.nextColumn(2);
        builder.add(maxModifier);
    }

    {
        builder.nextLine(2);
        builder.add(new JLabel("<HTML><strong>Sries associes  l'axe</strong></HTML>"), cc.xyw(1, 7, 3));
        String linkedSeries = "<html><ul>";
        for (Series series : Series.getInstances()) {
            if (series.getAxis().equals(axis))
                linkedSeries += "<li>" + series.toString(true) + "</li>";
        }
        linkedSeries += "</ul></html>";

        builder.add(new JLabel(linkedSeries), cc.xyw(1, 8, 3));
    }

    JPanel buttonPanel = new JPanel();
    ButtonBarBuilder buttonBuilder = new ButtonBarBuilder(buttonPanel);
    buttonBuilder.addGlue();
    {
        buttonBuilder.addButton(new AbstractAction() {

            {
                putValue(NAME, I18nSupport.translate("cancel"));
            }

            @Override
            public void actionPerformed(ActionEvent e) {
                isCancel = true;
                isApply = false;
                canClose = true;
                validateForm();
            }
        });
    }

    {
        buttonBuilder.addButton(new AbstractAction() {

            {
                putValue(NAME, I18nSupport.translate("apply"));
            }

            @Override
            public void actionPerformed(ActionEvent e) {
                isCancel = false;
                isApply = true;
                canClose = false;
                validateForm();
            }
        });
    }

    {
        buttonBuilder.addButton(new AbstractAction() {

            {
                putValue(NAME, I18nSupport.translate("ok"));
            }

            @Override
            public void actionPerformed(ActionEvent e) {
                isCancel = false;
                isApply = true;
                canClose = true;
                validateForm();
            }
        });
    }

    buttonBuilder.build();
    buttonPanel.setVisible(true);
    builder.add(buttonBuilder.getPanel(), cc.xyw(1, 10, 10));

    {
        translateSlider.setToolTipText("Translation des axes");
        translateSlider.addChangeListener(new ChangeListener() {
            @Override
            public void stateChanged(ChangeEvent e) {
                int maxValue = -translateSlider.getValue();
                maxModifier.setText(String.valueOf(maxValue));
                int lowValue = -translateSlider.getValue();
                minModifier.setText(String.valueOf(lowValue));
            }
        });
        builder.add(translateSlider, cc.xywh(9, 1, 1, 8));
    }
    {
        homotSlider.setToolTipText("Homothtie sur les axes");
        homotSlider.addChangeListener(new ChangeListener() {
            @Override
            public void stateChanged(ChangeEvent e) {
                int maxValue = -homotSlider.getValue();
                maxModifier.setText(String.valueOf(maxValue));
                int lowValue = homotSlider.getValue();
                minModifier.setText(String.valueOf(lowValue));
            }
        });
        builder.add(homotSlider, cc.xywh(10, 1, 1, 8));
    }

    builder.build();

    getPanel().setBorder(BorderFactory.createEmptyBorder(2, 2, 2, 2));

    addListenerOnSuccess(new ActionListener() {
        @Override
        public void actionPerformed(ActionEvent e) {
            if (canClose)
                setVisible(false);
        }
    });
}

From source file:org.esa.snap.rcp.statistics.StatisticsPanel.java

@Override
protected void initComponents() {
    init = true;//  w  w w .  java  2s .c  o m

    computePanel = new MultipleRoiComputePanel(this, getRaster());
    exportButton = getExportButton();

    final JPanel exportAndHelpPanel = GridBagUtils.createPanel();
    GridBagConstraints helpPanelConstraints = GridBagUtils
            .createConstraints("anchor=NORTHWEST,fill=HORIZONTAL,insets.top=2,weightx=1,ipadx=0");
    GridBagUtils.addToPanel(exportAndHelpPanel, new JSeparator(), helpPanelConstraints,
            "fill=HORIZONTAL,gridwidth=2,insets.left=5,insets.right=5");
    GridBagUtils.addToPanel(exportAndHelpPanel, exportButton, helpPanelConstraints,
            "gridy=1,anchor=WEST,fill=NONE");
    GridBagUtils.addToPanel(exportAndHelpPanel, getHelpButton(), helpPanelConstraints,
            "gridx=1,gridy=1,anchor=EAST,fill=NONE");

    final JPanel rightPanel = GridBagUtils.createPanel();
    GridBagConstraints extendedOptionsPanelConstraints = GridBagUtils
            .createConstraints("anchor=NORTHWEST,fill=HORIZONTAL,insets.top=2,weightx=1,insets.right=-2");
    GridBagUtils.addToPanel(rightPanel, computePanel, extendedOptionsPanelConstraints,
            "gridy=0,fill=BOTH,weighty=1");
    GridBagUtils.addToPanel(rightPanel, createAccuracyPanel(), extendedOptionsPanelConstraints,
            "gridy=1,fill=BOTH,weighty=1");
    GridBagUtils.addToPanel(rightPanel, exportAndHelpPanel, extendedOptionsPanelConstraints,
            "gridy=2,anchor=SOUTHWEST,fill=HORIZONTAL,weighty=0");

    final ImageIcon collapseIcon = UIUtils.loadImageIcon("icons/PanelRight12.png");
    final ImageIcon collapseRolloverIcon = ToolButtonFactory.createRolloverIcon(collapseIcon);
    final ImageIcon expandIcon = UIUtils.loadImageIcon("icons/PanelLeft12.png");
    final ImageIcon expandRolloverIcon = ToolButtonFactory.createRolloverIcon(expandIcon);

    hideAndShowButton = ToolButtonFactory.createButton(collapseIcon, false);
    hideAndShowButton.setToolTipText("Collapse Options Panel");
    hideAndShowButton.setName("switchToChartButton");
    hideAndShowButton.addActionListener(new ActionListener() {

        public boolean rightPanelShown;

        @Override
        public void actionPerformed(ActionEvent e) {
            rightPanel.setVisible(rightPanelShown);
            if (rightPanelShown) {
                hideAndShowButton.setIcon(collapseIcon);
                hideAndShowButton.setRolloverIcon(collapseRolloverIcon);
                hideAndShowButton.setToolTipText("Collapse Options Panel");
            } else {
                hideAndShowButton.setIcon(expandIcon);
                hideAndShowButton.setRolloverIcon(expandRolloverIcon);
                hideAndShowButton.setToolTipText("Expand Options Panel");
            }
            rightPanelShown = !rightPanelShown;
        }
    });

    contentPanel = new JPanel(new GridLayout(-1, 1));
    contentPanel.setBackground(Color.WHITE);
    contentPanel.addMouseListener(popupHandler);

    final JScrollPane contentScrollPane = new JScrollPane(contentPanel);
    contentScrollPane.setBorder(null);
    contentScrollPane.setBackground(Color.WHITE);

    backgroundPanel = new JPanel(new GridBagLayout());
    GridBagConstraints gbc = new GridBagConstraints();
    GridBagUtils.addToPanel(backgroundPanel, contentScrollPane, gbc,
            "fill=BOTH, weightx=1.0, weighty=1.0, anchor=NORTH");
    GridBagUtils.addToPanel(backgroundPanel, rightPanel, gbc, "gridx=1, fill=VERTICAL, weightx=0.0");

    JLayeredPane layeredPane = new JLayeredPane();
    layeredPane.add(backgroundPanel);
    layeredPane.add(hideAndShowButton);
    add(layeredPane);
}

From source file:org.esa.beam.visat.toolviews.stat.StatisticsPanel.java

@Override
protected void initComponents() {
    init = true;/*  w  w w.  j a v  a 2  s .  co  m*/

    initHashMaps();

    statsSpreadsheet = null;

    statisticsCriteriaPanel = new StatisticsCriteriaPanel(getParentDialogContentPane());

    final JPanel rightPanel = getRightPanel();

    final ImageIcon collapseIcon = UIUtils.loadImageIcon("icons/PanelRight12.png");
    final ImageIcon collapseRolloverIcon = ToolButtonFactory.createRolloverIcon(collapseIcon);
    final ImageIcon expandIcon = UIUtils.loadImageIcon("icons/PanelLeft12.png");
    final ImageIcon expandRolloverIcon = ToolButtonFactory.createRolloverIcon(expandIcon);

    hideAndShowButton = ToolButtonFactory.createButton(collapseIcon, false);
    hideAndShowButton.setToolTipText("Collapse Options Panel");
    hideAndShowButton.setName("switchToChartButton");
    hideAndShowButton.addActionListener(new ActionListener() {

        public boolean rightPanelShown;

        @Override
        public void actionPerformed(ActionEvent e) {
            rightPanel.setVisible(rightPanelShown);
            if (rightPanelShown) {
                hideAndShowButton.setIcon(collapseIcon);
                hideAndShowButton.setRolloverIcon(collapseRolloverIcon);
                hideAndShowButton.setVisible(true);
                hideAndShowButton.setToolTipText("Collapse Options Panel");
            } else {
                hideAndShowButton.setIcon(expandIcon);
                hideAndShowButton.setRolloverIcon(expandRolloverIcon);
                hideAndShowButton.setVisible(true);
                hideAndShowButton.setToolTipText("Expand Options Panel");
            }
            rightPanelShown = !rightPanelShown;
        }
    });

    hideAndShowButton.setVisible(true);

    contentPanel = new JPanel(new GridLayout(-1, 1));
    contentPanel.setBackground(Color.WHITE);
    contentPanel.addMouseListener(popupHandler);

    contentScrollPane = new JScrollPane(contentPanel);
    contentScrollPane.setBorder(null);
    contentScrollPane.setBackground(Color.WHITE);

    spreadsheetPanel = new JPanel(new GridLayout(-1, 1));
    //    spreadsheetPanel.setBackground(Color.WHITE);
    spreadsheetPanel.addMouseListener(popupHandler);

    spreadsheetScrollPane = new JScrollPane(spreadsheetPanel);

    spreadsheetScrollPane.setBorder(null);
    //    spreadsheetScrollPane.setBackground(Color.WHITE);
    spreadsheetScrollPane.setMinimumSize(new Dimension(100, 100));
    spreadsheetScrollPane.setBorder(UIUtils.createGroupBorder("Statistics Spreadsheet"));
    spreadsheetScrollPane.setVisible(statisticsCriteriaPanel.showStatsSpreadSheet());

    leftPanel = new JPanel(new GridBagLayout());
    //        GridBagConstraints gbcLeftPanel = new GridBagConstraints();
    //        GridBagUtils.addToPanel(leftPanel, contentScrollPane, gbcLeftPanel, "fill=BOTH, weightx=1.0, weighty=1.0, anchor=NORTHWEST");
    //        GridBagUtils.addToPanel(leftPanel, spreadsheetScrollPane, gbcLeftPanel, "fill=BOTH, weightx=1.0, weighty=0.0, anchor=NORTHWEST, gridy=1,insets.top=5");

    initLeftPanel();

    backgroundPanel = new JPanel(new GridBagLayout());
    GridBagConstraints gbc = new GridBagConstraints();
    GridBagUtils.addToPanel(backgroundPanel, leftPanel, gbc,
            "fill=BOTH, weightx=1.0, weighty=1.0, anchor=NORTHWEST,insets.right=5");
    //   GridBagUtils.addToPanel(backgroundPanel, contentScrollPane, gbc, "fill=BOTH, weightx=1.0, weighty=1.0, anchor=NORTHWEST");
    //  GridBagUtils.addToPanel(backgroundPanel, spreadsheetScrollPane, gbc, "fill=BOTH, weightx=1.0, weighty=1.0, anchor=NORTHWEST, gridy=1");
    GridBagUtils.addToPanel(backgroundPanel, rightPanel, gbc,
            "gridx=1,gridy=0, fill=BOTH, weightx=0.0,anchor=NORTHEAST,insets.left=5");

    //   GridBagUtils.addToPanel(backgroundPanel, spreadsheetScrollPane, gbcLeftPanel, "fill=HORIZONTAL, weightx=1.0, weighty=1.0, anchor=NORTHWEST, gridy=1,gridx=0,gridwidth=2,insets.top=5");
    JLayeredPane layeredPane = new JLayeredPane();
    layeredPane.add(backgroundPanel, new Integer(0));
    layeredPane.add(hideAndShowButton, new Integer(1));
    add(layeredPane);

    int minWidth = leftPanel.getMinimumSize().width + rightPanel.getMinimumSize().width;
    int minHeight = Math.max(leftPanel.getMinimumSize().height, rightPanel.getMinimumSize().height);
    setMinimumSize(new Dimension(minWidth, minHeight));

}

From source file:musite.ui.MusiteResultPanel.java

/** This method is called from within the constructor to
 * initialize the form./*from w ww  .  j a v a 2 s.  c o  m*/
 * WARNING: Do NOT modify this code. The content of this method is
 * always regenerated by the Form Editor.
 */
@SuppressWarnings("unchecked")
// <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
private void initComponents() {
    java.awt.GridBagConstraints gridBagConstraints;

    resDispPanel = new javax.swing.JPanel();
    javax.swing.JPanel modelPanel = new javax.swing.JPanel();
    modelComboBox = new javax.swing.JComboBox();
    javax.swing.JPanel accPanel = new javax.swing.JPanel();
    proteinListComboBox = new javax.swing.JComboBox();
    javax.swing.JPanel optionPanel = new javax.swing.JPanel();
    phosphoCheckBox = new javax.swing.JCheckBox();
    alphabetCheckBox = new javax.swing.JCheckBox();
    displayTabbedPane = new javax.swing.JTabbedPane();
    sequenceScrollPane = new javax.swing.JScrollPane();
    sitesScrollPane = new javax.swing.JScrollPane();
    javax.swing.JPanel adjustPanel = new javax.swing.JPanel();
    javax.swing.JPanel threholdPanel = new javax.swing.JPanel();
    javax.swing.JPanel sliderBasePanel = new javax.swing.JPanel();
    sliderTitleComboBox = new javax.swing.JComboBox();
    javax.swing.JPanel specificityPanel = new javax.swing.JPanel();
    javax.swing.JLabel specificityLabel = new javax.swing.JLabel();
    specificityTextField = new javax.swing.JTextField();
    javax.swing.JLabel percLabel = new javax.swing.JLabel();
    javax.swing.JLabel scoreCutoffLabel = new javax.swing.JLabel();
    scoreCutoffTextField = new javax.swing.JTextField();
    specificitySlider = new javax.swing.JSlider();
    javax.swing.JPanel exportPanel = new javax.swing.JPanel();
    exportComboBox = new javax.swing.JComboBox();
    javax.swing.JPanel closePanel = new javax.swing.JPanel();
    javax.swing.JButton saveButton = new javax.swing.JButton();

    setLayout(new java.awt.GridBagLayout());

    resDispPanel.setLayout(new java.awt.GridBagLayout());

    modelPanel.setVisible(result.getModels().size() > 1);
    modelPanel.setBorder(javax.swing.BorderFactory.createTitledBorder("Select model"));
    modelPanel.setLayout(new javax.swing.BoxLayout(modelPanel, javax.swing.BoxLayout.LINE_AXIS));

    PredictionModel[] models = result.getModels().toArray(new PredictionModel[0]);
    java.util.Arrays.sort(models, new java.util.Comparator<PredictionModel>() {
        public int compare(PredictionModel model1, PredictionModel model2) {
            String name1 = model1.getName();
            String name2 = model2.getName();
            if (name1 == null)
                return name2 == null ? 0 : -1;
            if (name2 == null)
                return 1;
            return name1.compareTo(name2);
        }
    });
    modelComboBox.setModel(new javax.swing.DefaultComboBoxModel(models));
    modelComboBox.setSelectedIndex(0);
    modelComboBox.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            modelComboBoxActionPerformed(evt);
        }
    });
    modelPanel.add(modelComboBox);

    gridBagConstraints = new java.awt.GridBagConstraints();
    gridBagConstraints.gridx = 0;
    gridBagConstraints.gridy = 0;
    gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
    gridBagConstraints.weightx = 1.0;
    gridBagConstraints.insets = new java.awt.Insets(3, 3, 3, 3);
    resDispPanel.add(modelPanel, gridBagConstraints);

    accPanel.setBorder(javax.swing.BorderFactory.createTitledBorder("Select protein(s)"));
    accPanel.setLayout(new java.awt.GridBagLayout());

    Vector pros = new Vector(result.proteins());
    //pros.add("Display all listed proteins");
    proteinListComboBox.setModel(new javax.swing.DefaultComboBoxModel(pros));
    proteinListComboBox.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            proteinListComboBoxActionPerformed(evt);
        }
    });
    gridBagConstraints = new java.awt.GridBagConstraints();
    gridBagConstraints.gridx = 0;
    gridBagConstraints.gridy = 1;
    gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
    gridBagConstraints.anchor = java.awt.GridBagConstraints.LINE_START;
    gridBagConstraints.weightx = 1.0;
    gridBagConstraints.insets = new java.awt.Insets(0, 3, 0, 3);
    accPanel.add(proteinListComboBox, gridBagConstraints);

    optionPanel.setLayout(new java.awt.FlowLayout(java.awt.FlowLayout.LEFT, 3, 3));

    phosphoCheckBox.setText("List predicted phosphoproteins only");
    phosphoCheckBox.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            phosphoCheckBoxActionPerformed(evt);
        }
    });
    optionPanel.add(phosphoCheckBox);

    alphabetCheckBox.setText("List alphabetically (according to accessions)");
    alphabetCheckBox.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            alphabetCheckBoxActionPerformed(evt);
        }
    });
    optionPanel.add(alphabetCheckBox);

    gridBagConstraints = new java.awt.GridBagConstraints();
    gridBagConstraints.gridx = 0;
    gridBagConstraints.gridy = 0;
    gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
    accPanel.add(optionPanel, gridBagConstraints);

    gridBagConstraints = new java.awt.GridBagConstraints();
    gridBagConstraints.gridx = 0;
    gridBagConstraints.gridy = 1;
    gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
    gridBagConstraints.weightx = 1.0;
    resDispPanel.add(accPanel, gridBagConstraints);

    displayTextPane = new ViewResultTextPane();
    sequenceScrollPane.setViewportView(displayTextPane);

    displayTabbedPane.addTab("Sequence(s)", sequenceScrollPane);

    displayTable = new ViewResultTable();
    sitesScrollPane.setViewportView(displayTable);

    displayTabbedPane.addTab("Predicted Sites", sitesScrollPane);

    gridBagConstraints = new java.awt.GridBagConstraints();
    gridBagConstraints.gridx = 0;
    gridBagConstraints.gridy = 2;
    gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
    gridBagConstraints.weightx = 1.0;
    gridBagConstraints.weighty = 1.0;
    resDispPanel.add(displayTabbedPane, gridBagConstraints);

    adjustPanel.setBorder(javax.swing.BorderFactory.createTitledBorder("Stringency setting"));
    adjustPanel.setLayout(new java.awt.GridBagLayout());

    threholdPanel.setLayout(new java.awt.FlowLayout(java.awt.FlowLayout.CENTER, 5, 0));

    sliderBasePanel.setBorder(javax.swing.BorderFactory.createTitledBorder("Sliding according to"));
    sliderBasePanel.setLayout(new java.awt.FlowLayout(java.awt.FlowLayout.CENTER, 5, 0));

    sliderTitleComboBox.setMinimumSize(new java.awt.Dimension(150, 18));
    sliderTitleComboBox.setPreferredSize(new java.awt.Dimension(150, 22));
    sliderTitleComboBox.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            sliderTitleComboBoxActionPerformed(evt);
        }
    });
    sliderBasePanel.add(sliderTitleComboBox);

    threholdPanel.add(sliderBasePanel);

    specificityPanel.setBorder(javax.swing.BorderFactory.createTitledBorder("Cutoff"));
    specificityPanel.setLayout(new java.awt.GridBagLayout());

    specificityLabel.setText("Specificity:");
    gridBagConstraints = new java.awt.GridBagConstraints();
    gridBagConstraints.gridy = 0;
    gridBagConstraints.insets = new java.awt.Insets(3, 3, 3, 0);
    specificityPanel.add(specificityLabel, gridBagConstraints);

    specificityTextField.setHorizontalAlignment(javax.swing.JTextField.RIGHT);
    specificityTextField.setMinimumSize(new java.awt.Dimension(60, 19));
    specificityTextField.setPreferredSize(new java.awt.Dimension(60, 19));
    specificityTextField.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            specificityTextFieldActionPerformed(evt);
        }
    });
    gridBagConstraints = new java.awt.GridBagConstraints();
    gridBagConstraints.gridy = 0;
    gridBagConstraints.insets = new java.awt.Insets(0, 3, 0, 1);
    specificityPanel.add(specificityTextField, gridBagConstraints);

    percLabel.setText("%");
    gridBagConstraints = new java.awt.GridBagConstraints();
    gridBagConstraints.gridy = 0;
    gridBagConstraints.insets = new java.awt.Insets(0, 1, 0, 20);
    specificityPanel.add(percLabel, gridBagConstraints);

    scoreCutoffLabel.setText("Score:");
    gridBagConstraints = new java.awt.GridBagConstraints();
    gridBagConstraints.gridy = 0;
    specificityPanel.add(scoreCutoffLabel, gridBagConstraints);

    scoreCutoffTextField.setHorizontalAlignment(javax.swing.JTextField.RIGHT);
    scoreCutoffTextField.setMinimumSize(new java.awt.Dimension(60, 19));
    scoreCutoffTextField.setPreferredSize(new java.awt.Dimension(60, 19));
    scoreCutoffTextField.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            scoreCutoffTextFieldActionPerformed(evt);
        }
    });
    gridBagConstraints = new java.awt.GridBagConstraints();
    gridBagConstraints.gridy = 0;
    gridBagConstraints.insets = new java.awt.Insets(0, 3, 0, 20);
    specificityPanel.add(scoreCutoffTextField, gridBagConstraints);

    threholdPanel.add(specificityPanel);

    gridBagConstraints = new java.awt.GridBagConstraints();
    gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
    adjustPanel.add(threholdPanel, gridBagConstraints);

    specificitySlider.setPaintLabels(true);
    specificitySlider.addChangeListener(new javax.swing.event.ChangeListener() {
        public void stateChanged(javax.swing.event.ChangeEvent evt) {
            specificitySliderStateChanged(evt);
        }
    });
    gridBagConstraints = new java.awt.GridBagConstraints();
    gridBagConstraints.gridx = 0;
    gridBagConstraints.gridy = 2;
    gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
    gridBagConstraints.weightx = 1.0;
    adjustPanel.add(specificitySlider, gridBagConstraints);

    gridBagConstraints = new java.awt.GridBagConstraints();
    gridBagConstraints.gridx = 0;
    gridBagConstraints.gridy = 3;
    gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
    gridBagConstraints.weightx = 1.0;
    gridBagConstraints.insets = new java.awt.Insets(2, 2, 2, 2);
    resDispPanel.add(adjustPanel, gridBagConstraints);

    exportPanel.setLayout(new javax.swing.BoxLayout(exportPanel, javax.swing.BoxLayout.LINE_AXIS));

    exportComboBox.setModel(new javax.swing.DefaultComboBoxModel(
            new String[] { "Export this result as...", "Tab-delimited text file" }));
    exportComboBox.setMinimumSize(new java.awt.Dimension(200, 18));
    exportComboBox.setPreferredSize(new java.awt.Dimension(200, 22));
    exportComboBox.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            exportComboBoxActionPerformed(evt);
        }
    });
    exportPanel.add(exportComboBox);

    gridBagConstraints = new java.awt.GridBagConstraints();
    gridBagConstraints.gridx = 0;
    gridBagConstraints.gridy = 4;
    gridBagConstraints.anchor = java.awt.GridBagConstraints.LINE_START;
    gridBagConstraints.insets = new java.awt.Insets(5, 5, 5, 5);
    resDispPanel.add(exportPanel, gridBagConstraints);

    closePanel.setLayout(new javax.swing.BoxLayout(closePanel, javax.swing.BoxLayout.LINE_AXIS));

    saveButton.setText("Save As...");
    saveButton.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            saveButtonActionPerformed(evt);
        }
    });
    closePanel.add(saveButton);

    gridBagConstraints = new java.awt.GridBagConstraints();
    gridBagConstraints.gridx = 0;
    gridBagConstraints.gridy = 4;
    gridBagConstraints.anchor = java.awt.GridBagConstraints.LINE_END;
    gridBagConstraints.insets = new java.awt.Insets(5, 5, 5, 5);
    resDispPanel.add(closePanel, gridBagConstraints);

    gridBagConstraints = new java.awt.GridBagConstraints();
    gridBagConstraints.gridx = 0;
    gridBagConstraints.gridy = 0;
    gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
    gridBagConstraints.weightx = 1.0;
    gridBagConstraints.weighty = 1.0;
    add(resDispPanel, gridBagConstraints);
}