Example usage for javax.swing JPanel setName

List of usage examples for javax.swing JPanel setName

Introduction

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

Prototype

public void setName(String name) 

Source Link

Document

Sets the name of the component to the specified string.

Usage

From source file:org.gumtree.vis.hist2d.Hist2DChartEditor.java

private JPanel createHelpPanel(JFreeChart chart) {
    JPanel wrap = new JPanel(new GridLayout(1, 1));

    JPanel helpPanel = new JPanel(new GridLayout(1, 1));
    helpPanel.setBorder(BorderFactory.createEmptyBorder(2, 2, 2, 2));
    //       helpPanel.setBorder(BorderFactory.createTitledBorder(
    //            BorderFactory.createEtchedBorder(), "Help Topics"));

    SpringLayout spring = new SpringLayout();
    JPanel inner = new JPanel(spring);
    inner.setBorder(BorderFactory.createEmptyBorder());

    final IHelpProvider provider = new Hist2DHelpProvider();
    final JList list = new JList(provider.getHelpMap().keySet().toArray());
    list.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
    //      list.setBorder(BorderFactory.createEtchedBorder());
    JScrollPane listPane1 = new JScrollPane(list);
    inner.add(listPane1);//  w w w . j  a  v  a 2s.c om
    listPane1.setMaximumSize(new Dimension(140, 0));
    listPane1.setMinimumSize(new Dimension(70, 0));
    //      JPanel contentPanel = new JPanel(new GridLayout(2, 1));
    //      inner.add(list);
    final JTextField keyField = new JTextField();
    keyField.setMaximumSize(new Dimension(400, 20));
    keyField.setEditable(false);
    //      keyField.setMaximumSize();
    //      keyArea.setLineWrap(true);
    //      keyArea.setWrapStyleWord(true);
    //      keyArea.setBorder(BorderFactory.createEtchedBorder());
    inner.add(keyField);
    //      contentPanel.add(new JLabel());
    //      contentPanel.add(new JLabel());
    final JTextArea helpArea = new JTextArea();
    JScrollPane areaPane = new JScrollPane(helpArea);
    helpArea.setEditable(false);
    helpArea.setLineWrap(true);
    helpArea.setWrapStyleWord(true);
    //      helpArea.setBorder(BorderFactory.createEtchedBorder());
    inner.add(areaPane);
    //      contentPanel.add(new JLabel());
    //      contentPanel.add(new JLabel());
    //      inner.add(contentPanel);
    spring.putConstraint(SpringLayout.WEST, listPane1, 2, SpringLayout.WEST, inner);
    spring.putConstraint(SpringLayout.NORTH, listPane1, 2, SpringLayout.NORTH, inner);
    spring.putConstraint(SpringLayout.WEST, keyField, 4, SpringLayout.EAST, listPane1);
    spring.putConstraint(SpringLayout.NORTH, keyField, 2, SpringLayout.NORTH, inner);
    spring.putConstraint(SpringLayout.EAST, inner, 2, SpringLayout.EAST, keyField);
    spring.putConstraint(SpringLayout.WEST, areaPane, 4, SpringLayout.EAST, listPane1);
    spring.putConstraint(SpringLayout.NORTH, areaPane, 4, SpringLayout.SOUTH, keyField);
    spring.putConstraint(SpringLayout.EAST, areaPane, -2, SpringLayout.EAST, inner);
    spring.putConstraint(SpringLayout.SOUTH, inner, 2, SpringLayout.SOUTH, areaPane);
    spring.putConstraint(SpringLayout.SOUTH, listPane1, -2, SpringLayout.SOUTH, inner);

    list.addListSelectionListener(new ListSelectionListener() {

        @Override
        public void valueChanged(ListSelectionEvent e) {
            Object[] selected = list.getSelectedValues();
            if (selected.length >= 0) {
                HelpObject help = provider.getHelpMap().get(selected[0]);
                if (help != null) {
                    keyField.setText(help.getKey());
                    helpArea.setText(help.getDiscription());
                }
            }
        }
    });

    helpPanel.add(inner, BorderLayout.NORTH);
    wrap.setName("Help");

    wrap.add(helpPanel, BorderLayout.NORTH);
    return wrap;

}

From source file:org.gumtree.vis.plot1d.Plot1DChartEditor.java

private JPanel createHelpPanel(JFreeChart chart) {
    JPanel wrap = new JPanel(new GridLayout(1, 1));

    JPanel helpPanel = new JPanel(new GridLayout(1, 1));
    helpPanel.setBorder(BorderFactory.createEmptyBorder(2, 2, 2, 2));
    //       helpPanel.setBorder(BorderFactory.createTitledBorder(
    //            BorderFactory.createEtchedBorder(), "Help Topics"));

    SpringLayout spring = new SpringLayout();
    JPanel inner = new JPanel(spring);
    inner.setBorder(BorderFactory.createEmptyBorder());

    final IHelpProvider provider = new Plot1DHelpProvider();
    final JList list = new JList(provider.getHelpMap().keySet().toArray());
    list.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
    //      list.setBorder(BorderFactory.createEtchedBorder());
    JScrollPane listPane1 = new JScrollPane(list);
    inner.add(listPane1);/*from  w  w  w.j a v a2 s. c  o m*/
    listPane1.setMaximumSize(new Dimension(140, 0));
    listPane1.setMinimumSize(new Dimension(70, 0));
    //      JPanel contentPanel = new JPanel(new GridLayout(2, 1));
    //      inner.add(list);
    final JTextField keyField = new JTextField();
    keyField.setMaximumSize(new Dimension(400, 20));
    keyField.setEditable(false);
    //      keyField.setMaximumSize();
    //      keyArea.setLineWrap(true);
    //      keyArea.setWrapStyleWord(true);
    //      keyArea.setBorder(BorderFactory.createEtchedBorder());
    inner.add(keyField);
    //      contentPanel.add(new JLabel());
    //      contentPanel.add(new JLabel());
    final JTextArea helpArea = new JTextArea();
    JScrollPane areaPane = new JScrollPane(helpArea);
    helpArea.setEditable(false);
    helpArea.setLineWrap(true);
    helpArea.setWrapStyleWord(true);
    //      helpArea.setBorder(BorderFactory.createEtchedBorder());
    inner.add(areaPane);
    //      contentPanel.add(new JLabel());
    //      contentPanel.add(new JLabel());
    //      inner.add(contentPanel);
    spring.putConstraint(SpringLayout.WEST, listPane1, 2, SpringLayout.WEST, inner);
    spring.putConstraint(SpringLayout.NORTH, listPane1, 2, SpringLayout.NORTH, inner);
    spring.putConstraint(SpringLayout.WEST, keyField, 4, SpringLayout.EAST, listPane1);
    spring.putConstraint(SpringLayout.NORTH, keyField, 2, SpringLayout.NORTH, inner);
    spring.putConstraint(SpringLayout.EAST, inner, 2, SpringLayout.EAST, keyField);
    spring.putConstraint(SpringLayout.WEST, areaPane, 4, SpringLayout.EAST, listPane1);
    spring.putConstraint(SpringLayout.NORTH, areaPane, 4, SpringLayout.SOUTH, keyField);
    spring.putConstraint(SpringLayout.EAST, areaPane, -2, SpringLayout.EAST, inner);
    spring.putConstraint(SpringLayout.SOUTH, inner, 2, SpringLayout.SOUTH, areaPane);
    spring.putConstraint(SpringLayout.SOUTH, listPane1, -2, SpringLayout.SOUTH, inner);

    list.addListSelectionListener(new ListSelectionListener() {

        @Override
        public void valueChanged(ListSelectionEvent e) {
            Object[] selected = list.getSelectedValues();
            if (selected.length >= 0) {
                HelpObject help = provider.getHelpMap().get(selected[0]);
                if (help != null) {
                    keyField.setText(help.getKey());
                    helpArea.setText(help.getDiscription());
                }
            }
        }
    });

    helpPanel.add(inner, BorderLayout.NORTH);
    wrap.setName("Help");

    wrap.add(helpPanel, BorderLayout.NORTH);
    return wrap;

}

From source file:org.gumtree.vis.plot1d.Plot1DChartEditor.java

private JPanel createCurvesPanel() {
    JPanel wrap = new JPanel(new BorderLayout());
    JPanel curves = new JPanel(new BorderLayout());
    curves.setBorder(BorderFactory.createEmptyBorder(2, 2, 2, 2));

    JPanel general = new JPanel(new BorderLayout());
    general.setBorder(BorderFactory.createTitledBorder(BorderFactory.createEtchedBorder(), "General"));

    JPanel inner = new JPanel(new LCBLayout(6));
    inner.setBorder(BorderFactory.createEmptyBorder(0, 5, 0, 5));

    inner.add(new JLabel("Show Marker"));
    showMarker = new JCheckBox();
    showMarker.setActionCommand(SHOW_MARKER_COMMAND);
    showMarker.addActionListener(this);
    inner.add(showMarker);/* w ww . j  ava  2s .c o m*/
    inner.add(new JLabel());

    inner.add(new JLabel("Show Error"));
    showError = new JCheckBox();
    showError.setActionCommand(SHOW_ERROR_COMMAND);
    showError.addActionListener(this);
    inner.add(showError);
    inner.add(new JLabel());

    general.add(inner, BorderLayout.NORTH);
    curves.add(general, BorderLayout.NORTH);

    JPanel individual = new JPanel(new BorderLayout());
    individual.setBorder(BorderFactory.createTitledBorder(BorderFactory.createEtchedBorder(), "Individual"));

    JPanel interior = new JPanel(new LCBLayout(6));
    interior.setBorder(BorderFactory.createEmptyBorder(0, 5, 0, 5));

    XYDataset dataset = chart.getXYPlot().getDataset();
    int numberOfSeries = dataset.getSeriesCount();
    String[] seriesNames = new String[numberOfSeries];
    currentSeriesIndex = -1;
    for (int i = 0; i < numberOfSeries; i++) {
        seriesNames[i] = (String) dataset.getSeriesKey(i);
        if (seriesNames[i].equals(currentSeriesKey)) {
            currentSeriesIndex = i;
        }
    }
    if (currentSeriesIndex < 0 && seriesNames.length > 0) {
        currentSeriesIndex = 0;
        currentSeriesKey = seriesNames[currentSeriesIndex];
    }

    //Select curve combo
    this.seriesCombo = new JComboBox(seriesNames);
    seriesCombo.setActionCommand(CHANGE_CURVE_COMMAND);
    seriesCombo.addActionListener(this);
    interior.add(new JLabel("Select Curve"));
    interior.add(seriesCombo);
    interior.add(new JLabel(""));

    interior.add(new JLabel("Curve Stroke"));
    curveStrokeSample = new StrokeSample(new BasicStroke());
    curveStrokeSample.setEnabled(false);
    interior.add(curveStrokeSample);
    //      JButton button = new JButton(localizationResources.getString("Edit..."));
    Float[] strokes = new Float[] { 0f, 0.2f, 0.5f, 1f, 1.5f, 2f, 3f };
    strokeCombo = new JComboBox(strokes);
    strokeCombo.setActionCommand(CURVE_STROCK_COMMAND);
    strokeCombo.addActionListener(this);
    interior.add(strokeCombo);

    interior.add(new JLabel("Curve Colour"));
    curveColorPaint = new PaintSample(chart.getBackgroundPaint());
    interior.add(curveColorPaint);
    JButton button = new JButton(localizationResources.getString("Edit..."));
    button.setActionCommand(CURVE_COLOR_COMMAND);
    button.addActionListener(this);
    interior.add(button);

    interior.add(new JLabel("Marker Shape"));
    shapeLabel = new JLabel();
    interior.add(shapeLabel);
    Integer[] shapeIndex = new Integer[MarkerShape.size];
    for (int i = 0; i < shapeIndex.length; i++) {
        shapeIndex[i] = i;
    }
    shapeCombo = new JComboBox(shapeIndex);
    comboRender = new ImageComboRender();
    comboRender.setShapes(StaticValues.LOCAL_SHAPE_SERIES);
    shapeCombo.setRenderer(comboRender);
    shapeCombo.setMaximumRowCount(7);
    shapeCombo.setActionCommand(MARKER_SHAPE_COMMAND);
    shapeCombo.addActionListener(this);
    interior.add(shapeCombo);

    interior.add(new JLabel("Marker Filled"));
    markerFilled = new JCheckBox();
    markerFilled.setActionCommand(MARKER_FILLED_COMMAND);
    markerFilled.addActionListener(this);
    interior.add(markerFilled);
    interior.add(new JLabel());

    interior.add(new JLabel("Curve Visable"));
    curveVisable = new JCheckBox();
    curveVisable.setActionCommand(CURVE_VISIBLE_COMMAND);
    curveVisable.addActionListener(this);
    interior.add(curveVisable);
    interior.add(new JLabel());

    individual.add(interior, BorderLayout.NORTH);
    curves.add(individual);
    curves.setName("Curves");
    wrap.setName("Curves");
    wrap.add(curves, BorderLayout.NORTH);
    return wrap;
}

From source file:org.gumtree.vis.plot1d.Plot1DChartEditor.java

private JPanel createMaskingPanel(JFreeChart chart) {
    JPanel wrap = new JPanel(new BorderLayout());

    JPanel maskingPanel = new JPanel(new GridLayout(1, 1));
    maskingPanel.setBorder(BorderFactory.createEmptyBorder(2, 2, 2, 2));

    //Horizontal group
    JPanel managePanel = new JPanel(new BorderLayout());
    managePanel.setBorder(/*from   w  w w .j ava2  s. com*/
            BorderFactory.createTitledBorder(BorderFactory.createEtchedBorder(), "Region of Interests"));

    JPanel inner = new JPanel(new LCBLayout(6));
    inner.setBorder(BorderFactory.createEmptyBorder(0, 5, 0, 5));
    inner.add(new JLabel("Select Region"));
    roiCombo = new JComboBox(panel.getMasks().toArray());
    //      colourScaleCombo.setMaximumRowCount(7);
    roiCombo.setSelectedIndex(-1);
    roiCombo.setActionCommand(CHANGE_ROI_COMMAND);
    roiCombo.addActionListener(this);
    inner.add(roiCombo);
    inner.add(new JLabel());

    inner.add(new JLabel("or create"));
    newRectangleButton = new JButton("New Region of Interests");
    newRectangleButton.setActionCommand(CREATE_NEW_RECT_REGION_COMMAND);
    newRectangleButton.addActionListener(this);
    inner.add(newRectangleButton);
    inner.add(new JLabel());

    JPanel editPanel = new JPanel(new BorderLayout());
    editPanel
            .setBorder(BorderFactory.createTitledBorder(BorderFactory.createEtchedBorder(), "Edit the Region"));

    JPanel editInner = new JPanel(new LCBLayout(6));
    editInner.setBorder(BorderFactory.createEmptyBorder(0, 5, 0, 5));
    editInner.add(new JLabel("Name"));
    roiName = new JTextField(10);
    //      colourScaleCombo.setMaximumRowCount(7);
    roiName.setActionCommand(CHANGE_ROI_NAME_COMMAND);
    roiName.addActionListener(this);
    editInner.add(roiName);
    editInner.add(new JLabel());

    editInner.add(new JLabel("Usage"));
    ButtonGroup buttonGroup = new ButtonGroup();
    JPanel radioPanel = new JPanel(new GridLayout(1, 2));
    inclusiveRadio = new JRadioButton("inclusive");
    inclusiveRadio.setActionCommand(USE_INCLUSIVE_COMMAND);
    inclusiveRadio.addActionListener(this);
    buttonGroup.add(inclusiveRadio);
    radioPanel.add(inclusiveRadio);
    exclusiveRadio = new JRadioButton("exclusive");
    exclusiveRadio.setActionCommand(USE_EXCLUSIVE_COMMAND);
    exclusiveRadio.addActionListener(this);
    buttonGroup.add(exclusiveRadio);
    radioPanel.add(exclusiveRadio);
    editInner.add(radioPanel);
    editInner.add(new JLabel());

    editInner.add(new JLabel("X Range"));
    JPanel xRangePanel = new JPanel(new GridLayout(1, 2));
    JPanel xMinPanel = new JPanel(new FlowLayout(FlowLayout.RIGHT));
    xMinPanel.add(new JLabel("min: "));
    xMin = new JTextField(10);
    //      xMin.setActionCommand(CHANGE_XMIN_COMMAND);
    //      xMin.addActionListener(this);
    xMin.addKeyListener(this);
    xMinPanel.add(xMin);
    xRangePanel.add(xMinPanel);
    JPanel xMaxPanel = new JPanel(new FlowLayout(FlowLayout.RIGHT));
    xMaxPanel.add(new JLabel("max: "));
    xMax = new JTextField(10);
    //      xMax.setActionCommand(CHANGE_XMAX_COMMAND);
    xMax.addKeyListener(this);
    xMaxPanel.add(xMax);
    xRangePanel.add(xMaxPanel);
    editInner.add(xRangePanel);
    editInner.add(new JLabel());

    editInner.add(new JLabel());
    JPanel applyPanel = new JPanel(new GridLayout(1, 2));
    deleteButton = new JButton("Remove");
    deleteButton.setEnabled(false);
    deleteButton.setActionCommand(REMOVE_CHANGE_ACTION);
    deleteButton.addActionListener(this);
    applyPanel.add(deleteButton);
    applyPanel.add(new JLabel());
    applyButton = new JButton("Apply");
    applyButton.setEnabled(false);
    applyButton.setActionCommand(APPLY_CHANGE_ACTION);
    applyButton.addActionListener(this);
    applyPanel.add(applyButton);
    editInner.add(applyPanel);
    editInner.add(new JLabel());
    //      inner.add(new JLabel("X Range"));
    //      inner.add(inclusiveRadio);
    //      exclusiveRadio = new JRadioButton("exclusive");
    //      exclusiveRadio.setActionCommand(USE_EXCLUSIVE_COMMAND);
    //      exclusiveRadio.addActionListener(this);
    //      inner.add(exclusiveRadio);
    editPanel.add(editInner, BorderLayout.NORTH);
    managePanel.add(editPanel, BorderLayout.SOUTH);
    managePanel.add(inner, BorderLayout.NORTH);
    maskingPanel.add(managePanel);
    wrap.setName("ROI");

    wrap.add(maskingPanel, BorderLayout.NORTH);
    return wrap;
}

From source file:eu.crisis_economics.abm.dashboard.Page_Parameters.java

@SuppressWarnings("serial")
private JPanel createParamsweepGUI() {

    // left//w  w  w  .  j a v a2s  .c o  m
    parameterList = new JList();
    parameterList.setSelectionMode(ListSelectionModel.MULTIPLE_INTERVAL_SELECTION);
    new ListAction(parameterList, new AbstractAction() {
        public void actionPerformed(final ActionEvent event) {
            final AvailableParameter selectedParameter = (AvailableParameter) parameterList.getSelectedValue();
            addParameterToTree(new AvailableParameter[] { selectedParameter }, parameterTreeBranches.get(0));
            enableDisableParameterCombinationButtons();
        }
    });
    parameterList.addListSelectionListener(new ListSelectionListener() {
        public void valueChanged(ListSelectionEvent e) {
            if (!parameterList.isSelectionEmpty()) {
                boolean success = true;
                if (editedNode != null)
                    success = modify();

                if (success) {
                    cancelAllSelectionBut(parameterList);
                    resetSettings();
                    updateDescriptionField(parameterList.getSelectedValues());
                    enableDisableParameterCombinationButtons();
                } else
                    parameterList.clearSelection();
            }
        }
    });

    final JScrollPane parameterListPane = new JScrollPane(parameterList);
    parameterListPane.setBorder(BorderFactory.createTitledBorder("")); // for rounded border
    parameterListPane.setPreferredSize(new Dimension(300, 300));

    final JPanel parametersPanel = FormsUtils.build("p ' p:g", "[DialogBorder]00||" + "12||" + "34||" +
    //                                          "56||" + 
            "55||" + "66 f:p:g", new FormsUtils.Separator("<html><b>General parameters</b></html>"),
            NUMBER_OF_TURNS_LABEL_TEXT, numberOfTurnsFieldPSW, NUMBER_OF_TIMESTEPS_TO_IGNORE_LABEL_TEXT,
            numberTimestepsIgnoredPSW,
            //                                          UPDATE_CHARTS_LABEL_TEXT,onLineChartsCheckBoxPSW,
            new FormsUtils.Separator("<html><b>Model parameters</b></html>"), parameterListPane).getPanel();

    combinationsPanel = new JPanel(new GridLayout(0, 1, 5, 5));
    combinationsScrPane = new JScrollPane(combinationsPanel, ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED,
            ScrollPaneConstants.HORIZONTAL_SCROLLBAR_AS_NEEDED);
    combinationsScrPane.setBorder(null);
    combinationsScrPane.setPreferredSize(new Dimension(550, 500));

    parameterDescriptionLabel = new JXLabel();
    parameterDescriptionLabel.setLineWrap(true);
    parameterDescriptionLabel.setVerticalAlignment(SwingConstants.TOP);
    final JScrollPane descriptionScrollPane = new JScrollPane(parameterDescriptionLabel);
    descriptionScrollPane.setBorder(BorderFactory.createTitledBorder(null, "Description", TitledBorder.LEADING,
            TitledBorder.BELOW_TOP));
    descriptionScrollPane.setPreferredSize(
            new Dimension(PARAMETER_DESCRIPTION_LABEL_WIDTH, PARAMETER_DESCRIPTION_LABEL_HEIGHT));
    descriptionScrollPane.setViewportBorder(null);

    final JButton addNewBoxButton = new JButton("Add new combination");
    addNewBoxButton.setActionCommand(ACTIONCOMMAND_ADD_BOX);

    final JPanel left = FormsUtils.build("p ~ f:p:g ~ p", "011 f:p:g ||" + "0_2 p", parametersPanel,
            combinationsScrPane, addNewBoxButton).getPanel();
    left.setBorder(BorderFactory.createTitledBorder(null, "Specify parameter combinations",
            TitledBorder.LEADING, TitledBorder.BELOW_TOP));
    Style.registerCssClasses(left, Dashboard.CSS_CLASS_COMMON_PANEL);

    final JPanel leftAndDesc = new JPanel(new BorderLayout());
    leftAndDesc.add(left, BorderLayout.CENTER);
    leftAndDesc.add(descriptionScrollPane, BorderLayout.SOUTH);
    Style.registerCssClasses(leftAndDesc, Dashboard.CSS_CLASS_COMMON_PANEL);

    // right
    editedParameterText = new JLabel(ORIGINAL_TEXT);
    editedParameterText.setPreferredSize(new Dimension(280, 40));
    constDef = new JRadioButton("Constant");
    listDef = new JRadioButton("List");
    incrDef = new JRadioButton("Increment");

    final JPanel rightTop = FormsUtils.build("p:g", "[DialogBorder]0||" + "1||" + "2||" + "3",
            editedParameterText, constDef, listDef, incrDef).getPanel();

    Style.registerCssClasses(rightTop, Dashboard.CSS_CLASS_COMMON_PANEL);

    constDefField = new JTextField();
    final JPanel constDefPanel = FormsUtils
            .build("p ~ p:g", "[DialogBorder]01 p", "Constant value: ", CellConstraints.TOP, constDefField)
            .getPanel();

    listDefArea = new JTextArea();
    final JScrollPane listDefScr = new JScrollPane(listDefArea,
            ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED, ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER);
    final JPanel listDefPanel = FormsUtils.build("p ~ p:g", "[DialogBorder]01|" + "_1 f:p:g||" + "_2 p",
            "Value list: ", listDefScr, "(Separate values with spaces!)").getPanel();

    incrStartValueField = new JTextField();
    incrEndValueField = new JTextField();
    incrStepField = new JTextField();

    final JPanel incrDefPanel = FormsUtils.build("p ~ p:g", "[DialogBorder]01||" + "23||" + "45",
            "Start value: ", incrStartValueField, "End value: ", incrEndValueField, "Step: ", incrStepField)
            .getPanel();

    enumDefBox = new JComboBox(new DefaultComboBoxModel());
    final JPanel enumDefPanel = FormsUtils
            .build("p ~ p:g", "[DialogBorder]01 p", "Constant value:", CellConstraints.TOP, enumDefBox)
            .getPanel();

    submodelTypeBox = new JComboBox();
    final JPanel submodelTypePanel = FormsUtils
            .build("p ~ p:g", "[DialogBorder]01", "Constant value:", CellConstraints.TOP, submodelTypeBox)
            .getPanel();

    fileTextField = new JTextField();
    fileTextField.addKeyListener(new KeyAdapter() {
        public void keyTyped(final KeyEvent e) {
            final char character = e.getKeyChar();
            final File file = new File(Character.isISOControl(character) ? fileTextField.getText()
                    : fileTextField.getText() + character);
            fileTextField.setToolTipText(file.getAbsolutePath());
        }
    });
    fileBrowseButton = new JButton(BROWSE_BUTTON_TEXT);
    fileBrowseButton.setActionCommand(ACTIONCOMMAND_BROWSE);
    final JPanel fileDefPanel = FormsUtils
            .build("p ~ p:g ~p", "[DialogBorder]012", "File:", fileTextField, fileBrowseButton).getPanel();

    constDefPanel.setName("CONST");
    listDefPanel.setName("LIST");
    incrDefPanel.setName("INCREMENT");
    enumDefPanel.setName("ENUM");
    submodelTypePanel.setName("SUBMODEL");
    fileDefPanel.setName("FILE");

    Style.registerCssClasses(constDefPanel, Dashboard.CSS_CLASS_COMMON_PANEL);
    Style.registerCssClasses(listDefPanel, Dashboard.CSS_CLASS_COMMON_PANEL);
    Style.registerCssClasses(incrDefPanel, Dashboard.CSS_CLASS_COMMON_PANEL);
    Style.registerCssClasses(enumDefPanel, Dashboard.CSS_CLASS_COMMON_PANEL);
    Style.registerCssClasses(submodelTypePanel, Dashboard.CSS_CLASS_COMMON_PANEL);
    Style.registerCssClasses(fileDefPanel, Dashboard.CSS_CLASS_COMMON_PANEL);

    rightMiddle = new JPanel(new CardLayout());
    Style.registerCssClasses(rightMiddle, Dashboard.CSS_CLASS_COMMON_PANEL);
    rightMiddle.add(constDefPanel, constDefPanel.getName());
    rightMiddle.add(listDefPanel, listDefPanel.getName());
    rightMiddle.add(incrDefPanel, incrDefPanel.getName());
    rightMiddle.add(enumDefPanel, enumDefPanel.getName());
    rightMiddle.add(submodelTypePanel, submodelTypePanel.getName());
    rightMiddle.add(fileDefPanel, fileDefPanel.getName());

    modifyButton = new JButton("Modify");
    cancelButton = new JButton("Cancel");

    final JPanel rightBottom = FormsUtils
            .build("p:g p ~ p ~ p:g", "[DialogBorder]_01_ p", modifyButton, cancelButton).getPanel();

    Style.registerCssClasses(rightBottom, Dashboard.CSS_CLASS_COMMON_PANEL);

    final JPanel right = new JPanel(new BorderLayout());
    right.add(rightTop, BorderLayout.NORTH);
    right.add(rightMiddle, BorderLayout.CENTER);
    right.add(rightBottom, BorderLayout.SOUTH);
    right.setBorder(BorderFactory.createTitledBorder(null, "Parameter settings", TitledBorder.LEADING,
            TitledBorder.BELOW_TOP));

    Style.registerCssClasses(right, Dashboard.CSS_CLASS_COMMON_PANEL);

    // the whole paramsweep panel

    final JPanel content = FormsUtils.build("p:g p", "01 f:p:g", leftAndDesc, right).getPanel();
    Style.registerCssClasses(content, Dashboard.CSS_CLASS_COMMON_PANEL);

    sweepPanel = new JPanel();
    Style.registerCssClasses(sweepPanel, Dashboard.CSS_CLASS_COMMON_PANEL);
    sweepPanel.setLayout(new BorderLayout());
    final JScrollPane sp = new JScrollPane(content);
    sp.setBorder(null);
    sp.setViewportBorder(null);
    sweepPanel.add(sp, BorderLayout.CENTER);

    GUIUtils.createButtonGroup(constDef, listDef, incrDef);
    constDef.setSelected(true);
    constDef.setActionCommand("CONST");
    listDef.setActionCommand("LIST");
    incrDef.setActionCommand("INCREMENT");

    constDefField.setActionCommand("CONST_FIELD");
    incrStartValueField.setActionCommand("START_FIELD");
    incrEndValueField.setActionCommand("END_FIELD");
    incrStepField.setActionCommand("STEP_FIELD");

    modifyButton.setActionCommand("EDIT");
    cancelButton.setActionCommand("CANCEL");

    listDefArea.setLineWrap(true);
    listDefArea.setWrapStyleWord(true);
    listDefScr.setPreferredSize(new Dimension(100, 200));

    GUIUtils.addActionListener(this, modifyButton, cancelButton, constDef, listDef, incrDef, constDefField,
            incrStartValueField, incrEndValueField, incrStepField, addNewBoxButton, submodelTypeBox,
            fileBrowseButton);

    return sweepPanel;
}

From source file:org.gumtree.vis.awt.time.TimePlotChartEditor.java

private JPanel createCurvesPanel() {
    JPanel wrap = new JPanel(new BorderLayout());
    JPanel curves = new JPanel(new BorderLayout());
    curves.setBorder(BorderFactory.createEmptyBorder(2, 2, 2, 2));

    //      JPanel general = new JPanel(new BorderLayout());
    //      general.setBorder(BorderFactory.createTitledBorder(
    //            BorderFactory.createEtchedBorder(), "General"));
    ///*w ww .jav a 2 s .c  o m*/
    //      JPanel inner = new JPanel(new LCBLayout(6));
    //      inner.setBorder(BorderFactory.createEmptyBorder(0, 5, 0, 5));
    //
    //      inner.add(new JLabel("Show Marker"));
    //      showMarker = new JCheckBox();
    //      showMarker.setActionCommand(SHOW_MARKER_COMMAND);
    //      showMarker.addActionListener(this);
    //      inner.add(showMarker);
    //      inner.add(new JLabel());

    //      inner.add(new JLabel("Show Error"));
    //      showError = new JCheckBox();
    //      showError.setActionCommand(SHOW_ERROR_COMMAND);
    //      showError.addActionListener(this);
    //      inner.add(showError);
    //      inner.add(new JLabel());
    //
    //      general.add(inner, BorderLayout.NORTH);
    //      curves.add(general, BorderLayout.NORTH);

    JPanel individual = new JPanel(new BorderLayout());
    individual.setBorder(
            BorderFactory.createTitledBorder(BorderFactory.createEtchedBorder(), "Individual Curve"));

    JPanel interior = new JPanel(new LCBLayout(7));
    interior.setBorder(BorderFactory.createEmptyBorder(0, 5, 0, 5));

    int numberOfDataset = chart.getXYPlot().getDatasetCount();
    currentDataset = null;
    currentSeriesIndex = -1;
    List<String> seriesNames = new ArrayList<String>();
    for (int i = 0; i < numberOfDataset; i++) {
        XYDataset dataset = chart.getXYPlot().getDataset(i);
        if (dataset != null && dataset instanceof ITimeSeriesSet) {
            int numberOfSeries = dataset.getSeriesCount();
            for (int j = 0; j < numberOfSeries; j++) {
                String seriesName = (String) dataset.getSeriesKey(j);
                seriesNames.add(seriesName);
                if (seriesName.equals(currentSeriesKey)) {
                    currentDataset = (IDataset) dataset;
                    currentSeriesIndex = j;
                }
            }
        }
    }
    if ((currentDataset == null || currentSeriesIndex < 0) && seriesNames.size() > 0) {
        for (int i = 0; i < numberOfDataset; i++) {
            XYDataset dataset = chart.getXYPlot().getDataset(i);
            if (dataset != null && dataset instanceof ITimeSeriesSet && dataset.getSeriesCount() > 0) {
                currentDataset = (IDataset) dataset;
                currentSeriesIndex = 0;
                currentSeriesKey = (String) dataset.getSeriesKey(currentSeriesIndex);
                break;
            }
        }
    }

    //Select curve combo
    this.seriesCombo = new JComboBox(seriesNames.toArray());
    seriesCombo.setActionCommand(CHANGE_CURVE_COMMAND);
    seriesCombo.addActionListener(this);
    interior.add(new JLabel("Select Curve"));
    interior.add(seriesCombo);
    interior.add(new JLabel(""));

    interior.add(new JLabel("Curve Stroke"));
    curveStrokeSample = new StrokeSample(new BasicStroke());
    curveStrokeSample.setEnabled(false);
    interior.add(curveStrokeSample);
    //      JButton button = new JButton(localizationResources.getString("Edit..."));
    Float[] strokes = new Float[] { 0f, 0.2f, 0.5f, 1f, 1.5f, 2f, 3f };
    strokeCombo = new JComboBox(strokes);
    strokeCombo.setActionCommand(CURVE_STROCK_COMMAND);
    strokeCombo.addActionListener(this);
    interior.add(strokeCombo);

    interior.add(new JLabel("Curve Colour"));
    curveColorPaint = new PaintSample(chart.getBackgroundPaint());
    interior.add(curveColorPaint);
    JButton button = new JButton(localizationResources.getString("Edit..."));
    button.setActionCommand(CURVE_COLOR_COMMAND);
    button.addActionListener(this);
    interior.add(button);

    interior.add(new JLabel("Marker Visible"));
    showMarker = new JCheckBox();
    showMarker.setActionCommand(SHOW_MARKER_COMMAND);
    showMarker.addActionListener(this);
    interior.add(showMarker);
    interior.add(new JLabel());

    interior.add(new JLabel("Marker Shape"));
    shapeLabel = new JLabel();
    interior.add(shapeLabel);
    Integer[] shapeIndex = new Integer[MarkerShape.size];
    for (int i = 0; i < shapeIndex.length; i++) {
        shapeIndex[i] = i;
    }
    shapeCombo = new JComboBox(shapeIndex);
    comboRender = new ImageComboRender();
    comboRender.setShapes(StaticValues.LOCAL_SHAPE_SERIES);
    shapeCombo.setRenderer(comboRender);
    shapeCombo.setMaximumRowCount(7);
    shapeCombo.setActionCommand(MARKER_SHAPE_COMMAND);
    shapeCombo.addActionListener(this);
    interior.add(shapeCombo);

    interior.add(new JLabel("Marker Filled"));
    markerFilled = new JCheckBox();
    markerFilled.setActionCommand(MARKER_FILLED_COMMAND);
    markerFilled.addActionListener(this);
    interior.add(markerFilled);
    interior.add(new JLabel());

    interior.add(new JLabel("Curve Visable"));
    curveVisable = new JCheckBox();
    curveVisable.setActionCommand(CURVE_VISIBLE_COMMAND);
    curveVisable.addActionListener(this);
    interior.add(curveVisable);
    interior.add(new JLabel());

    individual.add(interior, BorderLayout.NORTH);
    curves.add(individual, BorderLayout.NORTH);
    curves.setName("Curves");
    wrap.setName("Curves");
    wrap.add(curves, BorderLayout.NORTH);
    return wrap;
}

From source file:org.gumtree.vis.hist2d.Hist2DChartEditor.java

private JPanel createMaskingPanel(JFreeChart chart) {
    JPanel wrap = new JPanel(new BorderLayout());

    JPanel maskingPanel = new JPanel(new GridLayout(1, 1));
    maskingPanel.setBorder(BorderFactory.createEmptyBorder(2, 2, 2, 2));

    //Horizontal group
    JPanel managePanel = new JPanel(new BorderLayout());
    managePanel.setBorder(//  w ww  . ja v a 2  s. c  o  m
            BorderFactory.createTitledBorder(BorderFactory.createEtchedBorder(), "Region of Interests"));

    JPanel inner = new JPanel(new LCBLayout(6));
    inner.setBorder(BorderFactory.createEmptyBorder(0, 5, 0, 5));
    inner.add(new JLabel("Select Region"));
    roiCombo = new JComboBox(panel.getMasks().toArray());
    //      colourScaleCombo.setMaximumRowCount(7);
    roiCombo.setActionCommand(CHANGE_ROI_COMMAND);
    roiCombo.addActionListener(this);
    roiCombo.setSelectedIndex(-1);
    inner.add(roiCombo);
    inner.add(new JLabel());

    inner.add(new JLabel("or create"));
    JPanel createNewPanel = new JPanel(new GridLayout(1, 2));
    newRectangleButton = new JButton("New Rectangle");
    newRectangleButton.setActionCommand(CREATE_NEW_RECT_REGION_COMMAND);
    newRectangleButton.addActionListener(this);
    newEllipseButton = new JButton("New Ellipse");
    newEllipseButton.setActionCommand(CREATE_NEW_ELLIPSE_REGION_COMMAND);
    newEllipseButton.addActionListener(this);
    createNewPanel.add(newRectangleButton);
    createNewPanel.add(newEllipseButton);
    inner.add(createNewPanel);
    inner.add(new JLabel());

    JPanel editPanel = new JPanel(new BorderLayout());
    editPanel
            .setBorder(BorderFactory.createTitledBorder(BorderFactory.createEtchedBorder(), "Edit the Region"));

    JPanel editInner = new JPanel(new LCBLayout(6));
    editInner.setBorder(BorderFactory.createEmptyBorder(0, 5, 0, 5));
    editInner.add(new JLabel("Name"));
    roiName = new JTextField(10);
    //      colourScaleCombo.setMaximumRowCount(7);
    roiName.setActionCommand(CHANGE_ROI_NAME_COMMAND);
    roiName.addActionListener(this);
    editInner.add(roiName);
    editInner.add(new JLabel());

    editInner.add(new JLabel("Usage"));
    ButtonGroup buttonGroup = new ButtonGroup();
    JPanel radioPanel = new JPanel(new GridLayout(1, 2));
    inclusiveRadio = new JRadioButton("inclusive");
    inclusiveRadio.setActionCommand(USE_INCLUSIVE_COMMAND);
    inclusiveRadio.addActionListener(this);
    buttonGroup.add(inclusiveRadio);
    radioPanel.add(inclusiveRadio);
    exclusiveRadio = new JRadioButton("exclusive");
    exclusiveRadio.setActionCommand(USE_EXCLUSIVE_COMMAND);
    exclusiveRadio.addActionListener(this);
    buttonGroup.add(exclusiveRadio);
    radioPanel.add(exclusiveRadio);
    editInner.add(radioPanel);
    editInner.add(new JLabel());

    editInner.add(new JLabel("Shape"));
    //      ButtonGroup shapeGroup = new ButtonGroup();
    //      JPanel shapePanel = new JPanel(new GridLayout(1, 2));
    //      rectangleRadio = new JRadioButton("rectangle");
    //      rectangleRadio.setActionCommand(CHOOSE_RECTANGLE_SHAPE_COMMAND);
    //      rectangleRadio.addActionListener(this);
    //      shapeGroup.add(rectangleRadio);
    //      shapePanel.add(rectangleRadio);
    //      ellipseRadio = new JRadioButton("ellipse");
    //      ellipseRadio.setActionCommand(CHOOSE_ELLIPSE_SHAPE_COMMAND);
    //      ellipseRadio.addActionListener(this);
    //      shapeGroup.add(ellipseRadio);
    //      shapePanel.add(ellipseRadio);
    //      editInner.add(shapePanel);
    shapeLabel = new JLabel();
    editInner.add(shapeLabel);
    editInner.add(new JLabel());

    editInner.add(new JLabel("X Range"));
    JPanel xRangePanel = new JPanel(new GridLayout(1, 2));
    JPanel xMinPanel = new JPanel(new FlowLayout(FlowLayout.RIGHT));
    xMinPanel.add(new JLabel("min: "));
    xMin = new JTextField(10);
    //      xMin.setActionCommand(CHANGE_XMIN_COMMAND);
    //      xMin.addActionListener(this);
    xMin.addKeyListener(this);
    xMinPanel.add(xMin);
    xRangePanel.add(xMinPanel);
    JPanel xMaxPanel = new JPanel(new FlowLayout(FlowLayout.RIGHT));
    xMaxPanel.add(new JLabel("max: "));
    xMax = new JTextField(10);
    //      xMax.setActionCommand(CHANGE_XMAX_COMMAND);
    xMax.addKeyListener(this);
    xMaxPanel.add(xMax);
    xRangePanel.add(xMaxPanel);
    editInner.add(xRangePanel);
    editInner.add(new JLabel());

    editInner.add(new JLabel("Y Range"));
    JPanel yRangePanel = new JPanel(new GridLayout(1, 2));
    JPanel yMinPanel = new JPanel(new FlowLayout(FlowLayout.RIGHT));
    yMinPanel.add(new JLabel("min: "));
    yMin = new JTextField(10);
    //      yMin.setActionCommand(CHANGE_YMIN_COMMAND);
    //      yMin.addActionListener(this);
    yMin.addKeyListener(this);
    yMinPanel.add(yMin);
    yRangePanel.add(yMinPanel);
    JPanel yMaxPanel = new JPanel(new FlowLayout(FlowLayout.RIGHT));
    yMaxPanel.add(new JLabel("max: "));
    yMax = new JTextField(10);
    //      yMax.setActionCommand(CHANGE_YMAX_COMMAND);
    //      yMax.addActionListener(this);
    yMax.addKeyListener(this);
    yMaxPanel.add(yMax);
    yRangePanel.add(yMaxPanel);
    editInner.add(yRangePanel);
    editInner.add(new JLabel());

    editInner.add(new JLabel());
    JPanel applyPanel = new JPanel(new GridLayout(1, 2));
    deleteButton = new JButton("Remove");
    deleteButton.setEnabled(false);
    deleteButton.setActionCommand(REMOVE_CHANGE_ACTION);
    deleteButton.addActionListener(this);
    applyPanel.add(deleteButton);
    applyPanel.add(new JLabel());
    applyButton = new JButton("Apply");
    applyButton.setEnabled(false);
    applyButton.setActionCommand(APPLY_CHANGE_ACTION);
    applyButton.addActionListener(this);
    applyPanel.add(applyButton);
    editInner.add(applyPanel);
    editInner.add(new JLabel());
    //      inner.add(new JLabel("X Range"));
    //      inner.add(inclusiveRadio);
    //      exclusiveRadio = new JRadioButton("exclusive");
    //      exclusiveRadio.setActionCommand(USE_EXCLUSIVE_COMMAND);
    //      exclusiveRadio.addActionListener(this);
    //      inner.add(exclusiveRadio);
    editPanel.add(editInner, BorderLayout.NORTH);
    managePanel.add(editPanel, BorderLayout.SOUTH);
    managePanel.add(inner, BorderLayout.NORTH);
    maskingPanel.add(managePanel);
    wrap.setName("ROI");

    wrap.add(maskingPanel, BorderLayout.NORTH);
    return wrap;
}

From source file:cfa.vo.sed.science.stacker.SedStackerFrame.java

/** This method is called from within the constructor to
 * initialize the form./*from w  w  w.j  a va 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() {
    bindingGroup = new org.jdesktop.beansbinding.BindingGroup();

    javax.swing.ButtonGroup buttonGroup1 = new javax.swing.ButtonGroup();
    javax.swing.ButtonGroup buttonGroup2 = new javax.swing.ButtonGroup();
    jPopupMenu1 = new javax.swing.JPopupMenu();
    javax.swing.JMenuItem jMenuItem1 = new javax.swing.JMenuItem();
    jPopupMenu2 = new javax.swing.JPopupMenu();
    javax.swing.JMenuItem jMenuItem2 = new javax.swing.JMenuItem();
    jButton1 = new javax.swing.JButton();
    javax.swing.JPanel jPanel1 = new javax.swing.JPanel();
    stackPanel = new javax.swing.JScrollPane();
    jList1 = new javax.swing.JList();
    javax.swing.JPanel jPanel5 = new javax.swing.JPanel();
    correctFlux = new javax.swing.JCheckBox();
    jTextField8 = new javax.swing.JTextField();
    javax.swing.JLabel jLabel11 = new javax.swing.JLabel();
    redshiftButton = new javax.swing.JButton();
    javax.swing.JLabel jLabel6 = new javax.swing.JLabel();
    jRadioButton3 = new javax.swing.JRadioButton();
    jRadioButton4 = new javax.swing.JRadioButton();
    integrationXMaxText = new javax.swing.JTextField();
    integrationMinMaxUnit = new WiderJComboBox();
    integrationYUnit = new WiderJComboBox();
    integrationValueText = new javax.swing.JTextField();
    integrationNormType = new javax.swing.JComboBox();
    javax.swing.JLabel integrationNormToLabel = new javax.swing.JLabel();
    javax.swing.JLabel integrationXMinLabel = new javax.swing.JLabel();
    integrationXMinText = new javax.swing.JTextField();
    jRadioButton1 = new javax.swing.JRadioButton();
    jRadioButton2 = new javax.swing.JRadioButton();
    javax.swing.JLabel atPointXLabel = new javax.swing.JLabel();
    javax.swing.JLabel atPointYLabel = new javax.swing.JLabel();
    atPointXText = new javax.swing.JTextField();
    atPointYType = new javax.swing.JComboBox();
    atPointXUnit = new javax.swing.JComboBox();
    atPointYText = new javax.swing.JTextField();
    atPointYUnit = new javax.swing.JComboBox();
    normalizeButton = new javax.swing.JButton();
    javax.swing.JSeparator jSeparator1 = new javax.swing.JSeparator();
    javax.swing.JLabel integrationXMaxLabel = new javax.swing.JLabel();
    javax.swing.JCheckBox jCheckBox1 = new javax.swing.JCheckBox();
    javax.swing.JCheckBox jCheckBox2 = new javax.swing.JCheckBox();
    javax.swing.JPanel jPanel4 = new javax.swing.JPanel();
    addButton = new javax.swing.JButton();
    removeButton = new javax.swing.JButton();
    javax.swing.JScrollPane jScrollPane2 = new javax.swing.JScrollPane();
    sedsTable = new javax.swing.JTable();
    javax.swing.JPanel jPanel6 = new javax.swing.JPanel();
    javax.swing.JLabel jLabel7 = new javax.swing.JLabel();
    stackStatisticComboBox = new javax.swing.JComboBox();
    smoothCheckBox = new javax.swing.JCheckBox();
    javax.swing.JLabel jLabel8 = new javax.swing.JLabel();
    jTextField6 = new javax.swing.JTextField();
    logBinningCheckBox = new javax.swing.JCheckBox();
    javax.swing.JLabel jLabel9 = new javax.swing.JLabel();
    binsizeTextField = new javax.swing.JTextField();
    stackBinSizeUnitsComboBox = new javax.swing.JComboBox();
    javax.swing.JLabel jLabel10 = new javax.swing.JLabel();
    stackButton = new javax.swing.JButton();
    stackYUnitComboBox = new javax.swing.JComboBox();
    javax.swing.JLabel jLabel1 = new javax.swing.JLabel();
    javax.swing.JPanel jPanel2 = new javax.swing.JPanel();
    resetButton = new javax.swing.JButton();
    javax.swing.JButton deleteButton = new javax.swing.JButton();
    createSedButton = new javax.swing.JButton();

    jPopupMenu1.setName("jPopupMenu1"); // NOI18N

    jMenuItem1.setText("Rename...");
    jMenuItem1.setName("jMenuItem1"); // NOI18N
    jMenuItem1.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            jMenuItem1ActionPerformed(evt);
        }
    });
    jPopupMenu1.add(jMenuItem1);

    jPopupMenu2.setName("jPopupMenu2"); // NOI18N

    jMenuItem2.setText("Change redshift...");
    jMenuItem2.setName("jMenuItem2"); // NOI18N
    jMenuItem2.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            jMenuItem2ActionPerformed(evt);
        }
    });
    jPopupMenu2.add(jMenuItem2);

    setClosable(true);
    setDefaultCloseOperation(javax.swing.WindowConstants.HIDE_ON_CLOSE);
    setIconifiable(true);
    setResizable(true);
    setTitle("SED Stacker");

    jButton1.setText("Create New Stack");
    jButton1.setName("jButton1"); // NOI18N
    jButton1.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            newStack(evt);
        }
    });

    jPanel1.setBorder(javax.swing.BorderFactory.createTitledBorder("Open Stacks"));
    jPanel1.setName("jPanel1"); // NOI18N

    stackPanel.setName("stackPanel"); // NOI18N

    jList1.setModel(new javax.swing.AbstractListModel() {
        String[] strings = { "Item 1", "Item 2", "Item 3", "Item 4", "Item 5" };

        public int getSize() {
            return strings.length;
        }

        public Object getElementAt(int i) {
            return strings[i];
        }
    });
    jList1.setSelectionMode(javax.swing.ListSelectionModel.SINGLE_SELECTION);
    jList1.setName("jList1"); // NOI18N

    org.jdesktop.beansbinding.ELProperty eLProperty = org.jdesktop.beansbinding.ELProperty.create("${stacks}");
    org.jdesktop.swingbinding.JListBinding jListBinding = org.jdesktop.swingbinding.SwingBindings
            .createJListBinding(org.jdesktop.beansbinding.AutoBinding.UpdateStrategy.READ_WRITE, this,
                    eLProperty, jList1);
    jListBinding.setSourceUnreadableValue(null);
    bindingGroup.addBinding(jListBinding);
    org.jdesktop.beansbinding.Binding binding = org.jdesktop.beansbinding.Bindings.createAutoBinding(
            org.jdesktop.beansbinding.AutoBinding.UpdateStrategy.READ_WRITE, this,
            org.jdesktop.beansbinding.ELProperty.create("${selectedStack}"), jList1,
            org.jdesktop.beansbinding.BeanProperty.create("selectedElement"));
    bindingGroup.addBinding(binding);

    jList1.addMouseListener(new java.awt.event.MouseAdapter() {
        public void mousePressed(java.awt.event.MouseEvent evt) {
            jList1MousePressed(evt);
        }

        public void mouseReleased(java.awt.event.MouseEvent evt) {
            jList1MouseReleased(evt);
        }
    });
    stackPanel.setViewportView(jList1);

    org.jdesktop.layout.GroupLayout jPanel1Layout = new org.jdesktop.layout.GroupLayout(jPanel1);
    jPanel1.setLayout(jPanel1Layout);
    jPanel1Layout.setHorizontalGroup(jPanel1Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
            .add(stackPanel, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 153, Short.MAX_VALUE));
    jPanel1Layout.setVerticalGroup(jPanel1Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
            .add(org.jdesktop.layout.GroupLayout.TRAILING, stackPanel));

    jPanel5.setBorder(javax.swing.BorderFactory.createTitledBorder("Redshift and Normalize"));
    jPanel5.setName("jPanel5"); // NOI18N

    correctFlux.setText("Correct flux");
    correctFlux.setName("correctFlux"); // NOI18N

    binding = org.jdesktop.beansbinding.Bindings.createAutoBinding(
            org.jdesktop.beansbinding.AutoBinding.UpdateStrategy.READ_WRITE, this,
            org.jdesktop.beansbinding.ELProperty.create("${selectedConfig.redshiftConfiguration.correctFlux}"),
            correctFlux, org.jdesktop.beansbinding.BeanProperty.create("selected"));
    bindingGroup.addBinding(binding);

    jTextField8.setName("jTextField8"); // NOI18N

    binding = org.jdesktop.beansbinding.Bindings.createAutoBinding(
            org.jdesktop.beansbinding.AutoBinding.UpdateStrategy.READ_WRITE, this,
            org.jdesktop.beansbinding.ELProperty.create("${selectedConfig.redshiftConfiguration.toRedshift}"),
            jTextField8, org.jdesktop.beansbinding.BeanProperty.create("text"));
    bindingGroup.addBinding(binding);

    jLabel11.setText("Move to redshift:");
    jLabel11.setName("jLabel11"); // NOI18N

    redshiftButton.setText("Redshift");
    redshiftButton.setName("redshiftButton"); // NOI18N
    redshiftButton.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            redshiftButtonActionPerformed(evt);
        }
    });

    jLabel6.setText("Add or multiply normalization constant:");
    jLabel6.setName("jLabel6"); // NOI18N

    buttonGroup2.add(jRadioButton3);
    jRadioButton3.setText("Add");
    jRadioButton3.setName("jRadioButton3"); // NOI18N

    binding = org.jdesktop.beansbinding.Bindings.createAutoBinding(
            org.jdesktop.beansbinding.AutoBinding.UpdateStrategy.READ_WRITE, this,
            org.jdesktop.beansbinding.ELProperty.create("${selectedConfig.normConfiguration.add}"),
            jRadioButton3, org.jdesktop.beansbinding.BeanProperty.create("selected"));
    bindingGroup.addBinding(binding);

    buttonGroup2.add(jRadioButton4);
    jRadioButton4.setText("Multiply");
    jRadioButton4.setName("jRadioButton4"); // NOI18N

    binding = org.jdesktop.beansbinding.Bindings.createAutoBinding(
            org.jdesktop.beansbinding.AutoBinding.UpdateStrategy.READ_WRITE, this,
            org.jdesktop.beansbinding.ELProperty.create("${selectedConfig.normConfiguration.multiply}"),
            jRadioButton4, org.jdesktop.beansbinding.BeanProperty.create("selected"));
    bindingGroup.addBinding(binding);

    integrationXMaxText.setName("integrationXMaxText"); // NOI18N

    binding = org.jdesktop.beansbinding.Bindings.createAutoBinding(
            org.jdesktop.beansbinding.AutoBinding.UpdateStrategy.READ_WRITE, this,
            org.jdesktop.beansbinding.ELProperty.create("${selectedConfig.normConfiguration.xmax}"),
            integrationXMaxText, org.jdesktop.beansbinding.BeanProperty.create("text"));
    bindingGroup.addBinding(binding);
    binding = org.jdesktop.beansbinding.Bindings.createAutoBinding(
            org.jdesktop.beansbinding.AutoBinding.UpdateStrategy.READ_WRITE, jRadioButton1,
            org.jdesktop.beansbinding.ELProperty.create("${selected}"), integrationXMaxText,
            org.jdesktop.beansbinding.BeanProperty.create("enabled"));
    bindingGroup.addBinding(binding);

    integrationMinMaxUnit.setModel(new DefaultComboBoxModel(loadEnum(XUnit.class)));
    integrationMinMaxUnit.setToolTipText("null");
    integrationMinMaxUnit.setName("integrationMinMaxUnit"); // NOI18N

    binding = org.jdesktop.beansbinding.Bindings.createAutoBinding(
            org.jdesktop.beansbinding.AutoBinding.UpdateStrategy.READ_WRITE, this,
            org.jdesktop.beansbinding.ELProperty.create("${selectedConfig.normConfiguration.XUnits}"),
            integrationMinMaxUnit, org.jdesktop.beansbinding.BeanProperty.create("selectedItem"));
    bindingGroup.addBinding(binding);
    binding = org.jdesktop.beansbinding.Bindings.createAutoBinding(
            org.jdesktop.beansbinding.AutoBinding.UpdateStrategy.READ_WRITE, jRadioButton1,
            org.jdesktop.beansbinding.ELProperty.create("${selected}"), integrationMinMaxUnit,
            org.jdesktop.beansbinding.BeanProperty.create("enabled"));
    bindingGroup.addBinding(binding);

    integrationYUnit.setModel(new javax.swing.DefaultComboBoxModel(
            new String[] { "erg/s/cm2", "Jy-Hz", "Watt/m2", "erg/s", "Watt" }));
    integrationYUnit.setName("integrationYUnit"); // NOI18N

    binding = org.jdesktop.beansbinding.Bindings.createAutoBinding(
            org.jdesktop.beansbinding.AutoBinding.UpdateStrategy.READ_WRITE, this,
            org.jdesktop.beansbinding.ELProperty
                    .create("${selectedConfig.normConfiguration.integrateValueYUnits}"),
            integrationYUnit, org.jdesktop.beansbinding.BeanProperty.create("selectedItem"));
    bindingGroup.addBinding(binding);
    binding = org.jdesktop.beansbinding.Bindings.createAutoBinding(
            org.jdesktop.beansbinding.AutoBinding.UpdateStrategy.READ_WRITE, jRadioButton1,
            org.jdesktop.beansbinding.ELProperty.create("${selected}"), integrationYUnit,
            org.jdesktop.beansbinding.BeanProperty.create("enabled"));
    bindingGroup.addBinding(binding);

    integrationValueText.setName("integrationValueText"); // NOI18N

    binding = org.jdesktop.beansbinding.Bindings.createAutoBinding(
            org.jdesktop.beansbinding.AutoBinding.UpdateStrategy.READ_WRITE, this,
            org.jdesktop.beansbinding.ELProperty.create("${selectedConfig.normConfiguration.YValue}"),
            integrationValueText, org.jdesktop.beansbinding.BeanProperty.create("text"));
    bindingGroup.addBinding(binding);
    binding = org.jdesktop.beansbinding.Bindings.createAutoBinding(
            org.jdesktop.beansbinding.AutoBinding.UpdateStrategy.READ_WRITE, this,
            org.jdesktop.beansbinding.ELProperty
                    .create("${selectedConfig.normConfiguration.integrateYTextEnabled}"),
            integrationValueText, org.jdesktop.beansbinding.BeanProperty.create("enabled"));
    bindingGroup.addBinding(binding);

    integrationNormType
            .setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Value", "Average", "Median" }));
    integrationNormType.setName("integrationNormType"); // NOI18N

    binding = org.jdesktop.beansbinding.Bindings.createAutoBinding(
            org.jdesktop.beansbinding.AutoBinding.UpdateStrategy.READ_WRITE, this,
            org.jdesktop.beansbinding.ELProperty.create("${selectedConfig.normConfiguration.stats}"),
            integrationNormType, org.jdesktop.beansbinding.BeanProperty.create("selectedItem"));
    bindingGroup.addBinding(binding);
    binding = org.jdesktop.beansbinding.Bindings.createAutoBinding(
            org.jdesktop.beansbinding.AutoBinding.UpdateStrategy.READ_WRITE, jRadioButton1,
            org.jdesktop.beansbinding.ELProperty.create("${selected}"), integrationNormType,
            org.jdesktop.beansbinding.BeanProperty.create("enabled"));
    bindingGroup.addBinding(binding);

    integrationNormToLabel.setText("Normalize to");
    integrationNormToLabel.setName("integrationNormToLabel"); // NOI18N

    binding = org.jdesktop.beansbinding.Bindings.createAutoBinding(
            org.jdesktop.beansbinding.AutoBinding.UpdateStrategy.READ_WRITE, jRadioButton1,
            org.jdesktop.beansbinding.ELProperty.create("${selected}"), integrationNormToLabel,
            org.jdesktop.beansbinding.BeanProperty.create("enabled"));
    bindingGroup.addBinding(binding);

    integrationXMinLabel.setText("X Min:");
    integrationXMinLabel.setName("integrationXMinLabel"); // NOI18N

    binding = org.jdesktop.beansbinding.Bindings.createAutoBinding(
            org.jdesktop.beansbinding.AutoBinding.UpdateStrategy.READ_WRITE, jRadioButton1,
            org.jdesktop.beansbinding.ELProperty.create("${selected}"), integrationXMinLabel,
            org.jdesktop.beansbinding.BeanProperty.create("enabled"));
    bindingGroup.addBinding(binding);

    integrationXMinText.setName("integrationXMinText"); // NOI18N

    binding = org.jdesktop.beansbinding.Bindings.createAutoBinding(
            org.jdesktop.beansbinding.AutoBinding.UpdateStrategy.READ_WRITE, this,
            org.jdesktop.beansbinding.ELProperty.create("${selectedConfig.normConfiguration.xmin}"),
            integrationXMinText, org.jdesktop.beansbinding.BeanProperty.create("text"));
    bindingGroup.addBinding(binding);
    binding = org.jdesktop.beansbinding.Bindings.createAutoBinding(
            org.jdesktop.beansbinding.AutoBinding.UpdateStrategy.READ_WRITE, jRadioButton1,
            org.jdesktop.beansbinding.ELProperty.create("${selected}"), integrationXMinText,
            org.jdesktop.beansbinding.BeanProperty.create("enabled"));
    bindingGroup.addBinding(binding);

    buttonGroup1.add(jRadioButton1);
    jRadioButton1.setText("Integration");
    jRadioButton1.setName("jRadioButton1"); // NOI18N

    binding = org.jdesktop.beansbinding.Bindings.createAutoBinding(
            org.jdesktop.beansbinding.AutoBinding.UpdateStrategy.READ_WRITE, this,
            org.jdesktop.beansbinding.ELProperty.create("${selectedConfig.normConfiguration.integrate}"),
            jRadioButton1, org.jdesktop.beansbinding.BeanProperty.create("selected"));
    bindingGroup.addBinding(binding);

    buttonGroup1.add(jRadioButton2);
    jRadioButton2.setText("At point");
    jRadioButton2.setName("jRadioButton2"); // NOI18N

    binding = org.jdesktop.beansbinding.Bindings.createAutoBinding(
            org.jdesktop.beansbinding.AutoBinding.UpdateStrategy.READ_WRITE, this,
            org.jdesktop.beansbinding.ELProperty.create("${selectedConfig.normConfiguration.atPoint}"),
            jRadioButton2, org.jdesktop.beansbinding.BeanProperty.create("selected"));
    bindingGroup.addBinding(binding);

    atPointXLabel.setText("X:");
    atPointXLabel.setName("atPointXLabel"); // NOI18N

    binding = org.jdesktop.beansbinding.Bindings.createAutoBinding(
            org.jdesktop.beansbinding.AutoBinding.UpdateStrategy.READ_WRITE, jRadioButton2,
            org.jdesktop.beansbinding.ELProperty.create("${selected}"), atPointXLabel,
            org.jdesktop.beansbinding.BeanProperty.create("enabled"));
    bindingGroup.addBinding(binding);

    atPointYLabel.setText("Y:");
    atPointYLabel.setName("atPointYLabel"); // NOI18N

    binding = org.jdesktop.beansbinding.Bindings.createAutoBinding(
            org.jdesktop.beansbinding.AutoBinding.UpdateStrategy.READ_WRITE, jRadioButton2,
            org.jdesktop.beansbinding.ELProperty.create("${selected}"), atPointYLabel,
            org.jdesktop.beansbinding.BeanProperty.create("enabled"));
    bindingGroup.addBinding(binding);

    atPointXText.setName("atPointXText"); // NOI18N

    binding = org.jdesktop.beansbinding.Bindings.createAutoBinding(
            org.jdesktop.beansbinding.AutoBinding.UpdateStrategy.READ_WRITE, this,
            org.jdesktop.beansbinding.ELProperty.create("${selectedConfig.normConfiguration.atPointXValue}"),
            atPointXText, org.jdesktop.beansbinding.BeanProperty.create("text"));
    bindingGroup.addBinding(binding);
    binding = org.jdesktop.beansbinding.Bindings.createAutoBinding(
            org.jdesktop.beansbinding.AutoBinding.UpdateStrategy.READ_WRITE, jRadioButton2,
            org.jdesktop.beansbinding.ELProperty.create("${selected}"), atPointXText,
            org.jdesktop.beansbinding.BeanProperty.create("enabled"));
    bindingGroup.addBinding(binding);

    atPointYType.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Value", "Average", "Median" }));
    atPointYType.setName("atPointYType"); // NOI18N

    binding = org.jdesktop.beansbinding.Bindings.createAutoBinding(
            org.jdesktop.beansbinding.AutoBinding.UpdateStrategy.READ_WRITE, this,
            org.jdesktop.beansbinding.ELProperty.create("${selectedConfig.normConfiguration.atPointStats}"),
            atPointYType, org.jdesktop.beansbinding.BeanProperty.create("selectedItem"));
    bindingGroup.addBinding(binding);
    binding = org.jdesktop.beansbinding.Bindings.createAutoBinding(
            org.jdesktop.beansbinding.AutoBinding.UpdateStrategy.READ_WRITE, jRadioButton2,
            org.jdesktop.beansbinding.ELProperty.create("${selected}"), atPointYType,
            org.jdesktop.beansbinding.BeanProperty.create("enabled"));
    bindingGroup.addBinding(binding);

    atPointXUnit.setModel(new DefaultComboBoxModel(loadEnum(XUnit.class)));
    atPointXUnit.setName("atPointXUnit"); // NOI18N

    binding = org.jdesktop.beansbinding.Bindings.createAutoBinding(
            org.jdesktop.beansbinding.AutoBinding.UpdateStrategy.READ_WRITE, this,
            org.jdesktop.beansbinding.ELProperty.create("${selectedConfig.normConfiguration.atPointXUnits}"),
            atPointXUnit, org.jdesktop.beansbinding.BeanProperty.create("selectedItem"));
    bindingGroup.addBinding(binding);
    binding = org.jdesktop.beansbinding.Bindings.createAutoBinding(
            org.jdesktop.beansbinding.AutoBinding.UpdateStrategy.READ_WRITE, jRadioButton2,
            org.jdesktop.beansbinding.ELProperty.create("${selected}"), atPointXUnit,
            org.jdesktop.beansbinding.BeanProperty.create("enabled"));
    bindingGroup.addBinding(binding);

    atPointYText.setName("atPointYText"); // NOI18N

    binding = org.jdesktop.beansbinding.Bindings.createAutoBinding(
            org.jdesktop.beansbinding.AutoBinding.UpdateStrategy.READ_WRITE, this,
            org.jdesktop.beansbinding.ELProperty.create("${selectedConfig.normConfiguration.atPointYValue}"),
            atPointYText, org.jdesktop.beansbinding.BeanProperty.create("text"));
    bindingGroup.addBinding(binding);
    binding = org.jdesktop.beansbinding.Bindings.createAutoBinding(
            org.jdesktop.beansbinding.AutoBinding.UpdateStrategy.READ_WRITE, this,
            org.jdesktop.beansbinding.ELProperty
                    .create("${selectedConfig.normConfiguration.atPointYTextEnabled}"),
            atPointYText, org.jdesktop.beansbinding.BeanProperty.create("enabled"));
    bindingGroup.addBinding(binding);

    atPointYUnit.setModel(new DefaultComboBoxModel(loadEnum(SPVYUnit.class)));
    atPointYUnit.setName("atPointYUnit"); // NOI18N

    binding = org.jdesktop.beansbinding.Bindings.createAutoBinding(
            org.jdesktop.beansbinding.AutoBinding.UpdateStrategy.READ_WRITE, this,
            org.jdesktop.beansbinding.ELProperty.create("${selectedConfig.normConfiguration.atPointYUnits}"),
            atPointYUnit, org.jdesktop.beansbinding.BeanProperty.create("selectedItem"));
    bindingGroup.addBinding(binding);
    binding = org.jdesktop.beansbinding.Bindings.createAutoBinding(
            org.jdesktop.beansbinding.AutoBinding.UpdateStrategy.READ_WRITE, jRadioButton2,
            org.jdesktop.beansbinding.ELProperty.create("${selected}"), atPointYUnit,
            org.jdesktop.beansbinding.BeanProperty.create("enabled"));
    bindingGroup.addBinding(binding);

    normalizeButton.setText("Normalize");
    normalizeButton.setName("normalizeButton"); // NOI18N
    normalizeButton.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            normalizeButtonActionPerformed(evt);
        }
    });

    jSeparator1.setName("jSeparator1"); // NOI18N

    integrationXMaxLabel.setText("X Max:");
    integrationXMaxLabel.setName("integrationXMaxLabel"); // NOI18N

    binding = org.jdesktop.beansbinding.Bindings.createAutoBinding(
            org.jdesktop.beansbinding.AutoBinding.UpdateStrategy.READ_WRITE, jRadioButton1,
            org.jdesktop.beansbinding.ELProperty.create("${selected}"), integrationXMaxLabel,
            org.jdesktop.beansbinding.BeanProperty.create("enabled"));
    bindingGroup.addBinding(binding);

    jCheckBox1.setText("Create SED");
    jCheckBox1.setToolTipText("Create and view SED after redshifting");
    jCheckBox1.setName("jCheckBox1"); // NOI18N

    binding = org.jdesktop.beansbinding.Bindings.createAutoBinding(
            org.jdesktop.beansbinding.AutoBinding.UpdateStrategy.READ_WRITE, this,
            org.jdesktop.beansbinding.ELProperty.create("${createSedAfterRedshift}"), jCheckBox1,
            org.jdesktop.beansbinding.BeanProperty.create("selected"));
    bindingGroup.addBinding(binding);

    jCheckBox2.setText("Create SED");
    jCheckBox2.setToolTipText("Create and view SED after normalizing");
    jCheckBox2.setName("jCheckBox2"); // NOI18N

    binding = org.jdesktop.beansbinding.Bindings.createAutoBinding(
            org.jdesktop.beansbinding.AutoBinding.UpdateStrategy.READ_WRITE, this,
            org.jdesktop.beansbinding.ELProperty.create("${createSedAfterNormalize}"), jCheckBox2,
            org.jdesktop.beansbinding.BeanProperty.create("selected"));
    bindingGroup.addBinding(binding);

    org.jdesktop.layout.GroupLayout jPanel5Layout = new org.jdesktop.layout.GroupLayout(jPanel5);
    jPanel5.setLayout(jPanel5Layout);
    jPanel5Layout
            .setHorizontalGroup(jPanel5Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
                    .add(jPanel5Layout.createSequentialGroup().addContainerGap().add(jPanel5Layout
                            .createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING).add(jSeparator1)
                            .add(jPanel5Layout.createSequentialGroup().add(jLabel11)
                                    .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
                                    .add(jTextField8, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 76,
                                            org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                                    .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED).add(correctFlux)
                                    .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED,
                                            org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                                    .add(jCheckBox1).addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
                                    .add(redshiftButton))
                            .add(jPanel5Layout.createSequentialGroup().add(jPanel5Layout
                                    .createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
                                    .add(jPanel5Layout.createSequentialGroup().add(jRadioButton2)
                                            .add(26, 26, 26)
                                            .add(jPanel5Layout
                                                    .createParallelGroup(
                                                            org.jdesktop.layout.GroupLayout.LEADING)
                                                    .add(jPanel5Layout.createSequentialGroup()
                                                            .add(atPointXLabel)
                                                            .addPreferredGap(
                                                                    org.jdesktop.layout.LayoutStyle.RELATED)
                                                            .add(atPointXText,
                                                                    org.jdesktop.layout.GroupLayout.PREFERRED_SIZE,
                                                                    73,
                                                                    org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                                                            .add(3, 3, 3).add(atPointXUnit,
                                                                    org.jdesktop.layout.GroupLayout.PREFERRED_SIZE,
                                                                    116,
                                                                    org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
                                                    .add(jPanel5Layout.createSequentialGroup()
                                                            .add(atPointYLabel)
                                                            .addPreferredGap(
                                                                    org.jdesktop.layout.LayoutStyle.RELATED)
                                                            .add(atPointYType,
                                                                    org.jdesktop.layout.GroupLayout.PREFERRED_SIZE,
                                                                    org.jdesktop.layout.GroupLayout.DEFAULT_SIZE,
                                                                    org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                                                            .addPreferredGap(
                                                                    org.jdesktop.layout.LayoutStyle.RELATED)
                                                            .add(atPointYText,
                                                                    org.jdesktop.layout.GroupLayout.PREFERRED_SIZE,
                                                                    78,
                                                                    org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                                                            .add(7, 7, 7)
                                                            .add(atPointYUnit,
                                                                    org.jdesktop.layout.GroupLayout.PREFERRED_SIZE,
                                                                    116,
                                                                    org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))))
                                    .add(jPanel5Layout.createSequentialGroup().add(jPanel5Layout
                                            .createParallelGroup(org.jdesktop.layout.GroupLayout.TRAILING)
                                            .add(jPanel5Layout.createSequentialGroup()
                                                    .add(integrationNormToLabel)
                                                    .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
                                                    .add(integrationNormType,
                                                            org.jdesktop.layout.GroupLayout.PREFERRED_SIZE,
                                                            org.jdesktop.layout.GroupLayout.DEFAULT_SIZE,
                                                            org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                                                    .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED))
                                            .add(jPanel5Layout.createSequentialGroup().add(jRadioButton1)
                                                    .add(8, 8, 8).add(integrationXMinLabel).add(3, 3, 3)
                                                    .add(integrationXMinText,
                                                            org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 73,
                                                            org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                                                    .addPreferredGap(
                                                            org.jdesktop.layout.LayoutStyle.RELATED)
                                                    .add(integrationXMaxLabel).add(3, 3, 3)))
                                            .add(jPanel5Layout
                                                    .createParallelGroup(
                                                            org.jdesktop.layout.GroupLayout.TRAILING, false)
                                                    .add(jPanel5Layout
                                                            .createSequentialGroup()
                                                            .add(integrationXMaxText,
                                                                    org.jdesktop.layout.GroupLayout.PREFERRED_SIZE,
                                                                    73,
                                                                    org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                                                            .addPreferredGap(
                                                                    org.jdesktop.layout.LayoutStyle.RELATED)
                                                            .add(integrationMinMaxUnit,
                                                                    org.jdesktop.layout.GroupLayout.PREFERRED_SIZE,
                                                                    116,
                                                                    org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
                                                    .add(jPanel5Layout.createSequentialGroup().add(
                                                            integrationValueText,
                                                            org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 73,
                                                            org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                                                            .addPreferredGap(
                                                                    org.jdesktop.layout.LayoutStyle.RELATED)
                                                            .add(integrationYUnit,
                                                                    org.jdesktop.layout.GroupLayout.PREFERRED_SIZE,
                                                                    116,
                                                                    org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))))
                                    .add(jPanel5Layout.createSequentialGroup().add(jLabel6)
                                            .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
                                            .add(jRadioButton3)
                                            .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
                                            .add(jRadioButton4)))
                                    .add(0, 0, Short.MAX_VALUE))
                            .add(org.jdesktop.layout.GroupLayout.TRAILING,
                                    jPanel5Layout.createSequentialGroup().add(0, 0, Short.MAX_VALUE)
                                            .add(jCheckBox2)
                                            .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
                                            .add(normalizeButton)))
                            .addContainerGap()));
    jPanel5Layout.setVerticalGroup(jPanel5Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
            .add(jPanel5Layout.createSequentialGroup()
                    .add(jPanel5Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
                            .add(jPanel5Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
                                    .add(correctFlux)
                                    .add(jTextField8, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE,
                                            org.jdesktop.layout.GroupLayout.DEFAULT_SIZE,
                                            org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                                    .add(jLabel11))
                            .add(jPanel5Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
                                    .add(redshiftButton).add(jCheckBox1)))
                    .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
                    .add(jSeparator1, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 10,
                            org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                    .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
                    .add(jPanel5Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
                            .add(jLabel6).add(jRadioButton3).add(jRadioButton4))
                    .add(18, 18, 18)
                    .add(jPanel5Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
                            .add(jRadioButton1)
                            .add(integrationMinMaxUnit, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE,
                                    org.jdesktop.layout.GroupLayout.DEFAULT_SIZE,
                                    org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                            .add(integrationXMaxText, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE,
                                    org.jdesktop.layout.GroupLayout.DEFAULT_SIZE,
                                    org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                            .add(integrationXMinText, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE,
                                    org.jdesktop.layout.GroupLayout.DEFAULT_SIZE,
                                    org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                            .add(integrationXMinLabel).add(integrationXMaxLabel))
                    .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
                    .add(jPanel5Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
                            .add(integrationYUnit, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE,
                                    org.jdesktop.layout.GroupLayout.DEFAULT_SIZE,
                                    org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                            .add(integrationValueText, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE,
                                    org.jdesktop.layout.GroupLayout.DEFAULT_SIZE,
                                    org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                            .add(integrationNormType, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE,
                                    org.jdesktop.layout.GroupLayout.DEFAULT_SIZE,
                                    org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                            .add(integrationNormToLabel))
                    .add(11, 11, 11)
                    .add(jPanel5Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
                            .add(jRadioButton2)
                            .add(jPanel5Layout.createSequentialGroup().add(jPanel5Layout
                                    .createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
                                    .add(jPanel5Layout
                                            .createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
                                            .add(atPointXText, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE,
                                                    org.jdesktop.layout.GroupLayout.DEFAULT_SIZE,
                                                    org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                                            .add(atPointXLabel))
                                    .add(atPointXUnit, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE,
                                            org.jdesktop.layout.GroupLayout.DEFAULT_SIZE,
                                            org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
                                    .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
                                    .add(jPanel5Layout
                                            .createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
                                            .add(atPointYLabel)
                                            .add(atPointYType, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE,
                                                    org.jdesktop.layout.GroupLayout.DEFAULT_SIZE,
                                                    org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                                            .add(atPointYText, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE,
                                                    org.jdesktop.layout.GroupLayout.DEFAULT_SIZE,
                                                    org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                                            .add(atPointYUnit, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE,
                                                    org.jdesktop.layout.GroupLayout.DEFAULT_SIZE,
                                                    org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))))
                    .addPreferredGap(org.jdesktop.layout.LayoutStyle.UNRELATED)
                    .add(jPanel5Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
                            .add(normalizeButton).add(jCheckBox2))
                    .addContainerGap(org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)));

    jPanel4.setBorder(javax.swing.BorderFactory.createTitledBorder("Added SEDs"));
    jPanel4.setName("jPanel4"); // NOI18N

    addButton.setText("Add...");
    addButton.setName("addButton"); // NOI18N
    addButton.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            addButtonActionPerformed(evt);
        }
    });

    removeButton.setText("Remove");
    removeButton.setName("removeButton"); // NOI18N
    removeButton.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            removeButtonActionPerformed(evt);
        }
    });

    jScrollPane2.setName("jScrollPane2"); // NOI18N

    sedsTable.setModel(new StackTableModel());
    sedsTable.setName("sedsTable"); // NOI18N
    sedsTable.getTableHeader().setReorderingAllowed(false);

    binding = org.jdesktop.beansbinding.Bindings.createAutoBinding(
            org.jdesktop.beansbinding.AutoBinding.UpdateStrategy.READ_WRITE, this,
            org.jdesktop.beansbinding.ELProperty.create("${selectedSeds}"), sedsTable,
            org.jdesktop.beansbinding.BeanProperty.create("selectedElements"));
    bindingGroup.addBinding(binding);

    sedsTable.addMouseListener(new java.awt.event.MouseAdapter() {
        public void mousePressed(java.awt.event.MouseEvent evt) {
            sedsTableMousePressed(evt);
        }
    });
    jScrollPane2.setViewportView(sedsTable);

    org.jdesktop.layout.GroupLayout jPanel4Layout = new org.jdesktop.layout.GroupLayout(jPanel4);
    jPanel4.setLayout(jPanel4Layout);
    jPanel4Layout
            .setHorizontalGroup(jPanel4Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
                    .add(org.jdesktop.layout.GroupLayout.TRAILING, jPanel4Layout.createSequentialGroup()
                            .add(jPanel4Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
                                    .add(addButton).add(removeButton))
                            .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED).add(jScrollPane2,
                                    org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 653, Short.MAX_VALUE)));
    jPanel4Layout.setVerticalGroup(jPanel4Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
            .add(jPanel4Layout.createSequentialGroup().add(addButton)
                    .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED).add(removeButton))
            .add(jScrollPane2, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 160,
                    org.jdesktop.layout.GroupLayout.PREFERRED_SIZE));

    jPanel6.setBorder(javax.swing.BorderFactory.createTitledBorder("Stacking Options"));
    jPanel6.setName("jPanel6"); // NOI18N

    jLabel7.setText("Statistic:");
    jLabel7.setName("jLabel7"); // NOI18N

    stackStatisticComboBox
            .setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Average", "Weighted Avg", "Sum" }));
    stackStatisticComboBox.setName("stackStatisticComboBox"); // NOI18N

    binding = org.jdesktop.beansbinding.Bindings.createAutoBinding(
            org.jdesktop.beansbinding.AutoBinding.UpdateStrategy.READ_WRITE, this,
            org.jdesktop.beansbinding.ELProperty.create("${selectedConfig.stackConfiguration.statistic}"),
            stackStatisticComboBox, org.jdesktop.beansbinding.BeanProperty.create("selectedItem"));
    bindingGroup.addBinding(binding);

    smoothCheckBox.setText("Smooth");
    smoothCheckBox.setName("smoothCheckBox"); // NOI18N

    binding = org.jdesktop.beansbinding.Bindings.createAutoBinding(
            org.jdesktop.beansbinding.AutoBinding.UpdateStrategy.READ_WRITE, this,
            org.jdesktop.beansbinding.ELProperty.create("${selectedConfig.stackConfiguration.smooth}"),
            smoothCheckBox, org.jdesktop.beansbinding.BeanProperty.create("selected"));
    bindingGroup.addBinding(binding);

    jLabel8.setText("Box Size:");
    jLabel8.setName("jLabel8"); // NOI18N

    binding = org.jdesktop.beansbinding.Bindings.createAutoBinding(
            org.jdesktop.beansbinding.AutoBinding.UpdateStrategy.READ_WRITE, smoothCheckBox,
            org.jdesktop.beansbinding.ELProperty.create("${selected}"), jLabel8,
            org.jdesktop.beansbinding.BeanProperty.create("enabled"));
    bindingGroup.addBinding(binding);

    jTextField6.setName("jTextField6"); // NOI18N

    binding = org.jdesktop.beansbinding.Bindings.createAutoBinding(
            org.jdesktop.beansbinding.AutoBinding.UpdateStrategy.READ_WRITE, this,
            org.jdesktop.beansbinding.ELProperty.create("${selectedConfig.stackConfiguration.smoothBinsize}"),
            jTextField6, org.jdesktop.beansbinding.BeanProperty.create("text"));
    bindingGroup.addBinding(binding);
    binding = org.jdesktop.beansbinding.Bindings.createAutoBinding(
            org.jdesktop.beansbinding.AutoBinding.UpdateStrategy.READ_WRITE, smoothCheckBox,
            org.jdesktop.beansbinding.ELProperty.create("${selected}"), jTextField6,
            org.jdesktop.beansbinding.BeanProperty.create("enabled"));
    bindingGroup.addBinding(binding);

    logBinningCheckBox.setText("Logarithmic Binning");
    logBinningCheckBox.setToolTipText(
            "java.lang.String \"Note: If logarithmic binning is on, the Bin Size is also logarithmic (e.g., a bin size of 1.0 with logarithmic binning spans 1 decade).\""); // NOI18N
    logBinningCheckBox.setName("logBinningCheckBox"); // NOI18N

    binding = org.jdesktop.beansbinding.Bindings.createAutoBinding(
            org.jdesktop.beansbinding.AutoBinding.UpdateStrategy.READ_WRITE, this,
            org.jdesktop.beansbinding.ELProperty.create("${selectedConfig.stackConfiguration.logbin}"),
            logBinningCheckBox, org.jdesktop.beansbinding.BeanProperty.create("selected"));
    bindingGroup.addBinding(binding);

    jLabel9.setText("Bin Size:");
    jLabel9.setName("jLabel9"); // NOI18N

    binsizeTextField.setName("binsizeTextField"); // NOI18N

    binding = org.jdesktop.beansbinding.Bindings.createAutoBinding(
            org.jdesktop.beansbinding.AutoBinding.UpdateStrategy.READ_WRITE, this,
            org.jdesktop.beansbinding.ELProperty.create("${selectedConfig.stackConfiguration.binsize}"),
            binsizeTextField, org.jdesktop.beansbinding.BeanProperty.create("text"));
    bindingGroup.addBinding(binding);

    stackBinSizeUnitsComboBox.setModel(new DefaultComboBoxModel(loadEnum(XUnit.class)));
    stackBinSizeUnitsComboBox.setName("stackBinSizeUnitsComboBox"); // NOI18N

    binding = org.jdesktop.beansbinding.Bindings.createAutoBinding(
            org.jdesktop.beansbinding.AutoBinding.UpdateStrategy.READ_WRITE, this,
            org.jdesktop.beansbinding.ELProperty.create("${selectedConfig.stackConfiguration.binsizeUnit}"),
            stackBinSizeUnitsComboBox, org.jdesktop.beansbinding.BeanProperty.create("selectedItem"));
    bindingGroup.addBinding(binding);

    jLabel10.setText("Bin Size Units:");
    jLabel10.setName("jLabel10"); // NOI18N

    stackButton.setText("Stack!");
    stackButton.setName("stackButton"); // NOI18N
    stackButton.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            stackButtonActionPerformed(evt);
        }
    });

    stackYUnitComboBox.setModel(new DefaultComboBoxModel(loadEnum(SPVYUnit.class)));
    stackYUnitComboBox.setName("stackYUnitComboBox"); // NOI18N

    binding = org.jdesktop.beansbinding.Bindings.createAutoBinding(
            org.jdesktop.beansbinding.AutoBinding.UpdateStrategy.READ_WRITE, this,
            org.jdesktop.beansbinding.ELProperty.create("${selectedConfig.stackConfiguration.YUnits}"),
            stackYUnitComboBox, org.jdesktop.beansbinding.BeanProperty.create("selectedItem"));
    bindingGroup.addBinding(binding);

    jLabel1.setText("Y Axis:");
    jLabel1.setName("jLabel1"); // NOI18N

    org.jdesktop.layout.GroupLayout jPanel6Layout = new org.jdesktop.layout.GroupLayout(jPanel6);
    jPanel6.setLayout(jPanel6Layout);
    jPanel6Layout.setHorizontalGroup(jPanel6Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
            .add(jPanel6Layout.createSequentialGroup().addContainerGap().add(jPanel6Layout
                    .createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
                    .add(org.jdesktop.layout.GroupLayout.TRAILING,
                            jPanel6Layout.createSequentialGroup().add(0, 0, Short.MAX_VALUE).add(stackButton)
                                    .addContainerGap())
                    .add(jPanel6Layout.createSequentialGroup().add(29, 29, 29).add(jLabel8)
                            .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED).add(jTextField6)
                            .add(17, 17, 17))
                    .add(jPanel6Layout.createSequentialGroup()
                            .add(jPanel6Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
                                    .add(jPanel6Layout.createSequentialGroup().add(jLabel10)
                                            .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
                                            .add(stackBinSizeUnitsComboBox,
                                                    org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 116,
                                                    org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
                                    .add(jPanel6Layout.createSequentialGroup().add(jPanel6Layout
                                            .createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
                                            .add(jLabel7).add(jLabel1))
                                            .add(jPanel6Layout
                                                    .createParallelGroup(
                                                            org.jdesktop.layout.GroupLayout.LEADING)
                                                    .add(jPanel6Layout.createSequentialGroup().add(12, 12, 12)
                                                            .add(stackYUnitComboBox,
                                                                    org.jdesktop.layout.GroupLayout.PREFERRED_SIZE,
                                                                    143,
                                                                    org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
                                                    .add(jPanel6Layout.createSequentialGroup()
                                                            .addPreferredGap(
                                                                    org.jdesktop.layout.LayoutStyle.UNRELATED)
                                                            .add(stackStatisticComboBox,
                                                                    org.jdesktop.layout.GroupLayout.PREFERRED_SIZE,
                                                                    143,
                                                                    org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))))
                                    .add(smoothCheckBox).add(logBinningCheckBox)
                                    .add(jPanel6Layout.createSequentialGroup().add(jLabel9).add(43, 43, 43).add(
                                            binsizeTextField, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE,
                                            115, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)))
                            .addContainerGap(org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)))));
    jPanel6Layout.setVerticalGroup(jPanel6Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
            .add(jPanel6Layout.createSequentialGroup().addContainerGap()
                    .add(jPanel6Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
                            .add(jLabel7).add(stackStatisticComboBox,
                                    org.jdesktop.layout.GroupLayout.PREFERRED_SIZE,
                                    org.jdesktop.layout.GroupLayout.DEFAULT_SIZE,
                                    org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
                    .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED,
                            org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .add(jPanel6Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
                            .add(stackYUnitComboBox, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE,
                                    org.jdesktop.layout.GroupLayout.DEFAULT_SIZE,
                                    org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                            .add(jLabel1))
                    .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
                    .add(jPanel6Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
                            .add(jLabel9).add(binsizeTextField, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE,
                                    org.jdesktop.layout.GroupLayout.DEFAULT_SIZE,
                                    org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
                    .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
                    .add(jPanel6Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
                            .add(jLabel10).add(stackBinSizeUnitsComboBox,
                                    org.jdesktop.layout.GroupLayout.PREFERRED_SIZE,
                                    org.jdesktop.layout.GroupLayout.DEFAULT_SIZE,
                                    org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
                    .add(9, 9, 9).add(logBinningCheckBox)
                    .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED).add(smoothCheckBox)
                    .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
                    .add(jPanel6Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
                            .add(jLabel8).add(jTextField6, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE,
                                    org.jdesktop.layout.GroupLayout.DEFAULT_SIZE,
                                    org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
                    .add(18, 18, 18).add(stackButton).add(18, 18, 18)));

    jPanel2.setBorder(javax.swing.BorderFactory.createTitledBorder("Managment"));
    jPanel2.setName("jPanel2"); // NOI18N

    resetButton.setText("Reset");
    resetButton.setToolTipText("Reset SEDs to their original values");
    resetButton.setName("resetButton"); // NOI18N
    resetButton.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            resetButtonActionPerformed(evt);
        }
    });

    deleteButton.setText("Delete");
    deleteButton.setToolTipText("Delete the currently selected Stack");
    deleteButton.setName("deleteButton"); // NOI18N
    deleteButton.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            deleteButtonActionPerformed(evt);
        }
    });

    createSedButton.setText("Create SED");
    createSedButton.setToolTipText("Create new SED of the current Stack.");
    createSedButton.setName("createSedButton"); // NOI18N
    createSedButton.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            createSedButtonActionPerformed(evt);
        }
    });

    org.jdesktop.layout.GroupLayout jPanel2Layout = new org.jdesktop.layout.GroupLayout(jPanel2);
    jPanel2.setLayout(jPanel2Layout);
    jPanel2Layout.setHorizontalGroup(jPanel2Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
            .add(jPanel2Layout.createSequentialGroup()
                    .add(jPanel2Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
                            .add(resetButton).add(createSedButton).add(deleteButton))
                    .addContainerGap(org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)));
    jPanel2Layout.setVerticalGroup(jPanel2Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
            .add(jPanel2Layout.createSequentialGroup().addContainerGap().add(resetButton)
                    .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED).add(deleteButton)
                    .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED,
                            org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .add(createSedButton).addContainerGap()));

    org.jdesktop.layout.GroupLayout layout = new org.jdesktop.layout.GroupLayout(getContentPane());
    getContentPane().setLayout(layout);
    layout.setHorizontalGroup(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING).add(layout
            .createSequentialGroup().addContainerGap()
            .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING, false)
                    .add(jPanel4, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE,
                            org.jdesktop.layout.GroupLayout.DEFAULT_SIZE,
                            org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                    .add(layout.createSequentialGroup()
                            .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
                                    .add(jButton1).add(jPanel1, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE,
                                            org.jdesktop.layout.GroupLayout.DEFAULT_SIZE,
                                            org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
                            .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED).add(jPanel5,
                                    org.jdesktop.layout.GroupLayout.DEFAULT_SIZE,
                                    org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)))
            .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
            .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.TRAILING, false)
                    .add(org.jdesktop.layout.GroupLayout.LEADING, jPanel2,
                            org.jdesktop.layout.GroupLayout.DEFAULT_SIZE,
                            org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .add(org.jdesktop.layout.GroupLayout.LEADING, jPanel6,
                            org.jdesktop.layout.GroupLayout.DEFAULT_SIZE,
                            org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
            .add(0, 10, Short.MAX_VALUE)));
    layout.setVerticalGroup(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
            .add(org.jdesktop.layout.GroupLayout.TRAILING, layout.createSequentialGroup()
                    .addContainerGap(org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.TRAILING, false)
                            .add(org.jdesktop.layout.GroupLayout.LEADING, layout.createSequentialGroup()
                                    .add(jButton1).addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
                                    .add(jPanel1, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE,
                                            org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                            .add(org.jdesktop.layout.GroupLayout.LEADING, jPanel6,
                                    org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 301, Short.MAX_VALUE)
                            .add(org.jdesktop.layout.GroupLayout.LEADING, jPanel5,
                                    org.jdesktop.layout.GroupLayout.DEFAULT_SIZE,
                                    org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                    .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
                    .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING, false)
                            .add(jPanel4, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE,
                                    org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                            .add(jPanel2, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE,
                                    org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                    .addContainerGap()));

    bindingGroup.bind();

    pack();
}

From source file:ffx.ui.ModelingPanel.java

private void loadCommand() {
    synchronized (this) {
        // Force Field X Command
        Element command;//ww w  .  ja  va2 s.c  o m
        // Command Options
        NodeList options;
        Element option;
        // Option Values
        NodeList values;
        Element value;
        // Options may be Conditional based on previous Option values (not
        // always supplied)
        NodeList conditionalList;
        Element conditional;
        // JobPanel GUI Components that change based on command
        JPanel optionPanel;
        // Clear the previous components
        commandPanel.removeAll();
        optionsTabbedPane.removeAll();
        conditionals.clear();
        String currentCommand = (String) currentCommandBox.getSelectedItem();
        if (currentCommand == null) {
            commandPanel.validate();
            commandPanel.repaint();
            return;
        }
        command = null;
        for (int i = 0; i < commandList.getLength(); i++) {
            command = (Element) commandList.item(i);
            String name = command.getAttribute("name");
            if (name.equalsIgnoreCase(currentCommand)) {
                break;
            }
        }
        int div = splitPane.getDividerLocation();
        descriptTextArea.setText(currentCommand.toUpperCase() + ": " + command.getAttribute("description"));
        splitPane.setBottomComponent(descriptScrollPane);
        splitPane.setDividerLocation(div);
        // The "action" tells Force Field X what to do when the
        // command finishes
        commandActions = command.getAttribute("action").trim();
        // The "fileType" specifies what file types this command can execute
        // on
        String string = command.getAttribute("fileType").trim();
        String[] types = string.split(" +");
        commandFileTypes.clear();
        for (String type : types) {
            if (type.contains("XYZ")) {
                commandFileTypes.add(FileType.XYZ);
            }
            if (type.contains("INT")) {
                commandFileTypes.add(FileType.INT);
            }
            if (type.contains("ARC")) {
                commandFileTypes.add(FileType.ARC);
            }
            if (type.contains("PDB")) {
                commandFileTypes.add(FileType.PDB);
            }
            if (type.contains("ANY")) {
                commandFileTypes.add(FileType.ANY);
            }
        }
        // Determine what options are available for this command
        options = command.getElementsByTagName("Option");
        int length = options.getLength();
        for (int i = 0; i < length; i++) {
            // This Option will be enabled (isEnabled = true) unless a
            // Conditional disables it
            boolean isEnabled = true;
            option = (Element) options.item(i);
            conditionalList = option.getElementsByTagName("Conditional");
            /*
             * Currently, there can only be 0 or 1 Conditionals per Option
             * There are three types of Conditionals implemented. 1.)
             * Conditional on a previous Option, this option may be
             * available 2.) Conditional on input for this option, a
             * sub-option may be available 3.) Conditional on the presence
             * of keywords, this option may be available
             */
            if (conditionalList != null) {
                conditional = (Element) conditionalList.item(0);
            } else {
                conditional = null;
            }
            // Get the command line flag
            String flag = option.getAttribute("flag").trim();
            // Get the description
            String optionDescript = option.getAttribute("description");
            JTextArea optionTextArea = new JTextArea("  " + optionDescript.trim());
            optionTextArea.setEditable(false);
            optionTextArea.setLineWrap(true);
            optionTextArea.setWrapStyleWord(true);
            optionTextArea.setBorder(etchedBorder);
            // Get the default for this Option (if one exists)
            String defaultOption = option.getAttribute("default");
            // Option Panel
            optionPanel = new JPanel(new BorderLayout());
            optionPanel.add(optionTextArea, BorderLayout.NORTH);
            String swing = option.getAttribute("gui");
            JPanel optionValuesPanel = new JPanel(new FlowLayout());
            optionValuesPanel.setBorder(etchedBorder);
            ButtonGroup bg = null;
            if (swing.equalsIgnoreCase("CHECKBOXES")) {
                // CHECKBOXES allows selection of 1 or more values from a
                // predefined set (Analyze, for example)
                values = option.getElementsByTagName("Value");
                for (int j = 0; j < values.getLength(); j++) {
                    value = (Element) values.item(j);
                    JCheckBox jcb = new JCheckBox(value.getAttribute("name"));
                    jcb.addMouseListener(this);
                    jcb.setName(flag);
                    if (defaultOption != null && jcb.getActionCommand().equalsIgnoreCase(defaultOption)) {
                        jcb.setSelected(true);
                    }
                    optionValuesPanel.add(jcb);
                }
            } else if (swing.equalsIgnoreCase("TEXTFIELD")) {
                // TEXTFIELD takes an arbitrary String as input
                JTextField jtf = new JTextField(20);
                jtf.addMouseListener(this);
                jtf.setName(flag);
                if (defaultOption != null && defaultOption.equals("ATOMS")) {
                    FFXSystem sys = mainPanel.getHierarchy().getActive();
                    if (sys != null) {
                        jtf.setText("" + sys.getAtomList().size());
                    }
                } else if (defaultOption != null) {
                    jtf.setText(defaultOption);
                }
                optionValuesPanel.add(jtf);
            } else if (swing.equalsIgnoreCase("RADIOBUTTONS")) {
                // RADIOBUTTONS allows one choice from a set of predifined
                // values
                bg = new ButtonGroup();
                values = option.getElementsByTagName("Value");
                for (int j = 0; j < values.getLength(); j++) {
                    value = (Element) values.item(j);
                    JRadioButton jrb = new JRadioButton(value.getAttribute("name"));
                    jrb.addMouseListener(this);
                    jrb.setName(flag);
                    bg.add(jrb);
                    if (defaultOption != null && jrb.getActionCommand().equalsIgnoreCase(defaultOption)) {
                        jrb.setSelected(true);
                    }
                    optionValuesPanel.add(jrb);
                }
            } else if (swing.equalsIgnoreCase("PROTEIN")) {
                // Protein allows selection of amino acids for the protein
                // builder
                optionValuesPanel.setLayout(new BoxLayout(optionValuesPanel, BoxLayout.Y_AXIS));
                optionValuesPanel.add(Box.createRigidArea(new Dimension(0, 5)));
                optionValuesPanel.add(getAminoAcidPanel());
                optionValuesPanel.add(Box.createRigidArea(new Dimension(0, 5)));
                acidComboBox.removeAllItems();
                JButton add = new JButton("Edit");
                add.setActionCommand("PROTEIN");
                add.addActionListener(this);
                add.setAlignmentX(Button.CENTER_ALIGNMENT);
                JPanel comboPanel = new JPanel(new FlowLayout(FlowLayout.CENTER));
                comboPanel.add(acidTextField);
                comboPanel.add(add);
                optionValuesPanel.add(comboPanel);
                optionValuesPanel.add(Box.createRigidArea(new Dimension(0, 5)));
                JButton remove = new JButton("Remove");
                add.setMinimumSize(remove.getPreferredSize());
                add.setPreferredSize(remove.getPreferredSize());
                remove.setActionCommand("PROTEIN");
                remove.addActionListener(this);
                remove.setAlignmentX(Button.CENTER_ALIGNMENT);
                comboPanel = new JPanel(new FlowLayout(FlowLayout.CENTER));
                comboPanel.add(acidComboBox);
                comboPanel.add(remove);
                optionValuesPanel.add(comboPanel);
                optionValuesPanel.add(Box.createRigidArea(new Dimension(0, 5)));
                optionValuesPanel.add(acidScrollPane);
                optionValuesPanel.add(Box.createRigidArea(new Dimension(0, 5)));
                JButton reset = new JButton("Reset");
                reset.setActionCommand("PROTEIN");
                reset.addActionListener(this);
                reset.setAlignmentX(Button.CENTER_ALIGNMENT);
                optionValuesPanel.add(reset);
                optionValuesPanel.add(Box.createRigidArea(new Dimension(0, 5)));
                acidTextArea.setText("");
                acidTextField.setText("");
            } else if (swing.equalsIgnoreCase("NUCLEIC")) {
                // Nucleic allows selection of nucleic acids for the nucleic
                // acid builder
                optionValuesPanel.setLayout(new BoxLayout(optionValuesPanel, BoxLayout.Y_AXIS));
                optionValuesPanel.add(Box.createRigidArea(new Dimension(0, 5)));
                optionValuesPanel.add(getNucleicAcidPanel());
                optionValuesPanel.add(Box.createRigidArea(new Dimension(0, 5)));
                acidComboBox.removeAllItems();
                JButton add = new JButton("Edit");
                add.setActionCommand("NUCLEIC");
                add.addActionListener(this);
                add.setAlignmentX(Button.CENTER_ALIGNMENT);
                JPanel comboPanel = new JPanel(new FlowLayout(FlowLayout.CENTER));
                comboPanel.add(acidTextField);
                comboPanel.add(add);
                optionValuesPanel.add(comboPanel);
                optionValuesPanel.add(Box.createRigidArea(new Dimension(0, 5)));
                JButton remove = new JButton("Remove");
                add.setMinimumSize(remove.getPreferredSize());
                add.setPreferredSize(remove.getPreferredSize());
                remove.setActionCommand("NUCLEIC");
                remove.addActionListener(this);
                remove.setAlignmentX(Button.CENTER_ALIGNMENT);
                comboPanel = new JPanel(new FlowLayout(FlowLayout.CENTER));
                comboPanel.add(acidComboBox);
                comboPanel.add(remove);
                optionValuesPanel.add(comboPanel);
                optionValuesPanel.add(Box.createRigidArea(new Dimension(0, 5)));
                optionValuesPanel.add(acidScrollPane);
                optionValuesPanel.add(Box.createRigidArea(new Dimension(0, 5)));
                JButton button = new JButton("Reset");
                button.setActionCommand("NUCLEIC");
                button.addActionListener(this);
                button.setAlignmentX(Button.CENTER_ALIGNMENT);
                optionValuesPanel.add(button);
                optionValuesPanel.add(Box.createRigidArea(new Dimension(0, 5)));
                acidTextArea.setText("");
                acidTextField.setText("");
            } else if (swing.equalsIgnoreCase("SYSTEMS")) {
                // SYSTEMS allows selection of an open system
                JComboBox<FFXSystem> jcb = new JComboBox<>(mainPanel.getHierarchy().getNonActiveSystems());
                jcb.setSize(jcb.getMaximumSize());
                jcb.addActionListener(this);
                optionValuesPanel.add(jcb);
            }
            // Set up a Conditional for this Option
            if (conditional != null) {
                isEnabled = false;
                String conditionalName = conditional.getAttribute("name");
                String conditionalValues = conditional.getAttribute("value");
                String cDescription = conditional.getAttribute("description");
                String cpostProcess = conditional.getAttribute("postProcess");
                if (conditionalName.toUpperCase().startsWith("KEYWORD")) {
                    optionPanel.setName(conditionalName);
                    String keywords[] = conditionalValues.split(" +");
                    if (activeSystem != null) {
                        Hashtable<String, Keyword> systemKeywords = activeSystem.getKeywords();
                        for (String key : keywords) {
                            if (systemKeywords.containsKey(key.toUpperCase())) {
                                isEnabled = true;
                            }
                        }
                    }
                } else if (conditionalName.toUpperCase().startsWith("VALUE")) {
                    isEnabled = true;
                    // Add listeners to the values of this option so
                    // the conditional options can be disabled/enabled.
                    for (int j = 0; j < optionValuesPanel.getComponentCount(); j++) {
                        JToggleButton jtb = (JToggleButton) optionValuesPanel.getComponent(j);
                        jtb.addActionListener(this);
                        jtb.setActionCommand("Conditional");
                    }
                    JPanel condpanel = new JPanel();
                    condpanel.setBorder(etchedBorder);
                    JLabel condlabel = new JLabel(cDescription);
                    condlabel.setEnabled(false);
                    condlabel.setName(conditionalValues);
                    JTextField condtext = new JTextField(10);
                    condlabel.setLabelFor(condtext);
                    if (cpostProcess != null) {
                        condtext.setName(cpostProcess);
                    }
                    condtext.setEnabled(false);
                    condpanel.add(condlabel);
                    condpanel.add(condtext);
                    conditionals.add(condlabel);
                    optionPanel.add(condpanel, BorderLayout.SOUTH);
                } else if (conditionalName.toUpperCase().startsWith("REFLECTION")) {
                    String[] condModifiers;
                    if (conditionalValues.equalsIgnoreCase("AltLoc")) {
                        condModifiers = activeSystem.getAltLocations();
                        if (condModifiers != null && condModifiers.length > 1) {
                            isEnabled = true;
                            bg = new ButtonGroup();
                            for (int j = 0; j < condModifiers.length; j++) {
                                JRadioButton jrbmi = new JRadioButton(condModifiers[j]);
                                jrbmi.addMouseListener(this);
                                bg.add(jrbmi);
                                optionValuesPanel.add(jrbmi);
                                if (j == 0) {
                                    jrbmi.setSelected(true);
                                }
                            }
                        }
                    } else if (conditionalValues.equalsIgnoreCase("Chains")) {
                        condModifiers = activeSystem.getChainNames();
                        if (condModifiers != null && condModifiers.length > 0) {
                            isEnabled = true;
                            for (int j = 0; j < condModifiers.length; j++) {
                                JRadioButton jrbmi = new JRadioButton(condModifiers[j]);
                                jrbmi.addMouseListener(this);
                                bg.add(jrbmi);
                                optionValuesPanel.add(jrbmi, j);
                            }
                        }
                    }
                }
            }
            optionPanel.add(optionValuesPanel, BorderLayout.CENTER);
            optionPanel.setPreferredSize(optionPanel.getPreferredSize());
            optionsTabbedPane.addTab(option.getAttribute("name"), optionPanel);
            optionsTabbedPane.setEnabledAt(optionsTabbedPane.getTabCount() - 1, isEnabled);
        }
    }
    optionsTabbedPane.setPreferredSize(optionsTabbedPane.getPreferredSize());
    commandPanel.setLayout(borderLayout);
    commandPanel.add(optionsTabbedPane, BorderLayout.CENTER);
    commandPanel.validate();
    commandPanel.repaint();
    loadLogSettings();
    statusLabel.setText("  " + createCommandInput());
}

From source file:org.jas.dnd.DragTooltipDialog.java

private JPanel getDynamicIcon(IconType type) {
    JPanel dynamicIcon = null;
    dynamicIcon = new JPanel();
    dynamicIcon.setMaximumSize(new Dimension(type.width, type.height));
    dynamicIcon.setPreferredSize(new Dimension(type.width, type.height));
    dynamicIcon.setName(type.synthName);
    dynamicIcon.setMinimumSize(new Dimension(type.width, type.height));
    return dynamicIcon;
}