Example usage for javax.swing JLabel setName

List of usage examples for javax.swing JLabel setName

Introduction

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

Prototype

public void setName(String name) 

Source Link

Document

Sets the name of the component to the specified string.

Usage

From source file:ffx.ui.ModelingPanel.java

private void loadCommand() {
    synchronized (this) {
        // Force Field X Command
        Element command;/*from  ww w . ja v  a  2  s .co  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:it.imtech.metadata.MetaUtility.java

/**
 * Aggiunge il pannello delle classificazioni all'interfaccia dei metadati
 *
 * @param innerPanel Pannello sul quale aggiungere i metadati
 * @param kv Valori dei metadati/*  w ww .jav a2s. c  om*/
 */
private void addClassification(JPanel innerPanel, Integer kv, final String sequence, final String panelname)
        throws Exception {
    try {
        ResourceBundle bundle = ResourceBundle.getBundle(Globals.RESOURCES, Globals.CURRENT_LOCALE,
                Globals.loader);

        DefaultMutableTreeNode hierarchy = new DefaultMutableTreeNode("root");
        selected = null;
        String selectedPath = "";

        String link = selectedClassificationList.get(panelname + "---" + sequence);

        recursiveOefosTreeviewBuild(hierarchy, oefos.get(link), sequence, panelname);
        DefaultTreeModel model = new DefaultTreeModel(hierarchy);

        final JTree tree = new JTree(model);
        tree.setRootVisible(false);

        if (selected != null) {
            TreePath selpath = new TreePath(selected.getPath());
            tree.setSelectionPath(selpath);

            Object[] nodes = selpath.getPath();

            for (int i = 1; i < nodes.length; i++) {
                selectedPath += nodes[i].toString();
                selectedPath += (i != nodes.length - 1) ? "/" : "";
            }
        }

        tree.setName("MID_" + Integer.toString(kv) + "---" + sequence);
        tree.getSelectionModel().setSelectionMode(TreeSelectionModel.SINGLE_TREE_SELECTION);

        tree.addTreeSelectionListener(new TreeSelectionListener() {

            public void valueChanged(TreeSelectionEvent e) {
                try {
                    setOEFOS(tree, sequence, panelname);
                } catch (Exception ex) {
                    logger.error(ex.getMessage());
                }
            }
        });

        javax.swing.JScrollPane tree_scroller = new javax.swing.JScrollPane();
        tree_scroller
                .setHorizontalScrollBarPolicy(javax.swing.ScrollPaneConstants.HORIZONTAL_SCROLLBAR_AS_NEEDED);
        tree_scroller.setVerticalScrollBarPolicy(javax.swing.ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED);
        tree_scroller.setViewportView(tree);
        tree_scroller.setBorder(null);

        innerPanel.add(tree_scroller, "wrap, width 100:800:800");

        JPanel iPanel = new JPanel(new MigLayout());
        iPanel.setBorder(BorderFactory.createTitledBorder(BorderFactory.createEtchedBorder(),
                Utility.getBundleString("choose2", bundle), TitledBorder.LEFT, TitledBorder.TOP));
        JLabel label = new JLabel();
        label.setName("classification_path" + "---" + sequence);
        label.setText(selectedPath);
        iPanel.add(label, "wrap, growx, height 30:30:30");

        innerPanel.add(iPanel, "wrap, width 100:800:800");

        findLastClassification(panelname);

    } catch (Exception ex) {
        logger.error(ex.getMessage());
        throw new Exception("Exception in addClassification: " + ex.getStackTrace() + "\n");
    }
}

From source file:de.cismet.cids.custom.objecteditors.wunda_blau.WebDavPicturePanel.java

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

    final RoundedPanel pnlFotos = new RoundedPanel();
    final SemiRoundedPanel pnlHeaderFotos = new SemiRoundedPanel();
    final JLabel lblHeaderFotos = new JLabel();
    final JPanel jPanel2 = new JPanel();
    final JPanel jPanel1 = new JPanel();
    final JScrollPane jspFotoList = new JScrollPane();
    lstFotos = new JList();
    final JPanel pnlCtrlButtons = new JPanel();
    btnAddImg = new JButton();
    btnRemoveImg = new JButton();
    final JPanel pnlMap = new JPanel();
    final RoundedPanel pnlVorschau = new RoundedPanel();
    final SemiRoundedPanel semiRoundedPanel2 = new SemiRoundedPanel();
    final JLabel lblVorschau = new JLabel();
    final JPanel jPanel3 = new JPanel();
    pnlFoto = new JPanel();
    lblPicture = new JLabel();
    lblBusy = new JXBusyLabel(new Dimension(75, 75));
    final JPanel pnlCtrlBtn = new JPanel();
    btnPrevImg = new JButton();
    btnNextImg = new JButton();

    final FormListener formListener = new FormListener();

    setName("Form"); // NOI18N
    setOpaque(false);
    setLayout(new GridBagLayout());

    pnlFotos.setMinimumSize(new Dimension(400, 200));
    pnlFotos.setName("pnlFotos"); // NOI18N
    pnlFotos.setPreferredSize(new Dimension(400, 200));
    pnlFotos.setLayout(new GridBagLayout());

    pnlHeaderFotos.setBackground(new Color(51, 51, 51));
    pnlHeaderFotos.setForeground(new Color(51, 51, 51));
    pnlHeaderFotos.setName("pnlHeaderFotos"); // NOI18N
    pnlHeaderFotos.setLayout(new FlowLayout());

    lblHeaderFotos.setForeground(new Color(255, 255, 255));
    Mnemonics.setLocalizedText(lblHeaderFotos,
            NbBundle.getMessage(WebDavPicturePanel.class, "WebDavPicturePanel.lblHeaderFotos.text")); // NOI18N
    lblHeaderFotos.setName("lblHeaderFotos"); // NOI18N
    pnlHeaderFotos.add(lblHeaderFotos);

    gridBagConstraints = new GridBagConstraints();
    gridBagConstraints.gridx = 0;
    gridBagConstraints.gridy = 0;
    gridBagConstraints.fill = GridBagConstraints.HORIZONTAL;
    pnlFotos.add(pnlHeaderFotos, gridBagConstraints);

    jPanel2.setName("jPanel2"); // NOI18N
    jPanel2.setOpaque(false);
    jPanel2.setLayout(new GridBagLayout());

    jPanel1.setName("jPanel1"); // NOI18N
    jPanel1.setOpaque(false);
    jPanel1.setLayout(new GridBagLayout());

    jspFotoList.setMinimumSize(new Dimension(250, 130));
    jspFotoList.setName("jspFotoList"); // NOI18N

    lstFotos.setMinimumSize(new Dimension(250, 130));
    lstFotos.setName("lstFotos"); // NOI18N
    lstFotos.setPreferredSize(new Dimension(250, 130));

    final ELProperty eLProperty = ELProperty.create("${cidsBean." + beanCollProp + "}");
    final JListBinding jListBinding = SwingBindings.createJListBinding(AutoBinding.UpdateStrategy.READ_WRITE,
            this, eLProperty, lstFotos);
    bindingGroup.addBinding(jListBinding);

    lstFotos.addListSelectionListener(formListener);
    jspFotoList.setViewportView(lstFotos);

    gridBagConstraints = new GridBagConstraints();
    gridBagConstraints.gridx = 0;
    gridBagConstraints.gridy = 0;
    gridBagConstraints.gridheight = 2;
    gridBagConstraints.fill = GridBagConstraints.BOTH;
    gridBagConstraints.anchor = GridBagConstraints.NORTHWEST;
    gridBagConstraints.weightx = 1.0;
    gridBagConstraints.weighty = 1.0;
    jPanel1.add(jspFotoList, gridBagConstraints);

    pnlCtrlButtons.setName("pnlCtrlButtons"); // NOI18N
    pnlCtrlButtons.setOpaque(false);
    pnlCtrlButtons.setLayout(new GridBagLayout());

    btnAddImg.setIcon(new ImageIcon(
            getClass().getResource("/de/cismet/cids/custom/objecteditors/wunda_blau/edit_add_mini.png"))); // NOI18N
    Mnemonics.setLocalizedText(btnAddImg,
            NbBundle.getMessage(WebDavPicturePanel.class, "WebDavPicturePanel.btnAddImg.text")); // NOI18N
    btnAddImg.setBorderPainted(false);
    btnAddImg.setContentAreaFilled(false);
    btnAddImg.setName("btnAddImg"); // NOI18N
    btnAddImg.addActionListener(formListener);
    gridBagConstraints = new GridBagConstraints();
    gridBagConstraints.insets = new Insets(0, 0, 5, 0);
    pnlCtrlButtons.add(btnAddImg, gridBagConstraints);

    btnRemoveImg.setIcon(new ImageIcon(
            getClass().getResource("/de/cismet/cids/custom/objecteditors/wunda_blau/edit_remove_mini.png"))); // NOI18N
    Mnemonics.setLocalizedText(btnRemoveImg,
            NbBundle.getMessage(WebDavPicturePanel.class, "WebDavPicturePanel.btnRemoveImg.text")); // NOI18N
    btnRemoveImg.setBorderPainted(false);
    btnRemoveImg.setContentAreaFilled(false);
    btnRemoveImg.setName("btnRemoveImg"); // NOI18N
    btnRemoveImg.addActionListener(formListener);
    gridBagConstraints = new GridBagConstraints();
    gridBagConstraints.gridy = 1;
    gridBagConstraints.insets = new Insets(5, 0, 0, 0);
    pnlCtrlButtons.add(btnRemoveImg, gridBagConstraints);

    gridBagConstraints = new GridBagConstraints();
    gridBagConstraints.gridx = 1;
    gridBagConstraints.gridy = 0;
    gridBagConstraints.fill = GridBagConstraints.BOTH;
    gridBagConstraints.anchor = GridBagConstraints.NORTH;
    gridBagConstraints.insets = new Insets(0, 5, 0, 0);
    jPanel1.add(pnlCtrlButtons, gridBagConstraints);

    gridBagConstraints = new GridBagConstraints();
    gridBagConstraints.gridx = 0;
    gridBagConstraints.gridy = 0;
    gridBagConstraints.fill = GridBagConstraints.BOTH;
    gridBagConstraints.weightx = 1.0;
    gridBagConstraints.weighty = 1.0;
    gridBagConstraints.insets = new Insets(10, 10, 10, 0);
    jPanel2.add(jPanel1, gridBagConstraints);

    gridBagConstraints = new GridBagConstraints();
    gridBagConstraints.gridx = 0;
    gridBagConstraints.gridy = 1;
    gridBagConstraints.fill = GridBagConstraints.BOTH;
    gridBagConstraints.weightx = 1.0;
    gridBagConstraints.weighty = 1.0;
    gridBagConstraints.insets = new Insets(0, 0, 2, 0);
    pnlFotos.add(jPanel2, gridBagConstraints);

    gridBagConstraints = new GridBagConstraints();
    gridBagConstraints.fill = GridBagConstraints.BOTH;
    gridBagConstraints.anchor = GridBagConstraints.NORTH;
    gridBagConstraints.insets = new Insets(0, 0, 5, 5);
    add(pnlFotos, gridBagConstraints);

    pnlMap.setBorder(BorderFactory.createEtchedBorder());
    pnlMap.setMinimumSize(new Dimension(400, 200));
    pnlMap.setName("pnlMap"); // NOI18N
    pnlMap.setPreferredSize(new Dimension(400, 200));
    pnlMap.setLayout(new BorderLayout());
    gridBagConstraints = new GridBagConstraints();
    gridBagConstraints.gridx = 0;
    gridBagConstraints.gridy = 1;
    gridBagConstraints.fill = GridBagConstraints.VERTICAL;
    gridBagConstraints.weighty = 1.0;
    gridBagConstraints.insets = new Insets(5, 0, 0, 5);
    add(pnlMap, gridBagConstraints);
    pnlMap.add(map, BorderLayout.CENTER);

    pnlVorschau.setName("pnlVorschau"); // NOI18N
    pnlVorschau.setLayout(new GridBagLayout());

    semiRoundedPanel2.setBackground(new Color(51, 51, 51));
    semiRoundedPanel2.setName("semiRoundedPanel2"); // NOI18N
    semiRoundedPanel2.setLayout(new FlowLayout());

    lblVorschau.setForeground(new Color(255, 255, 255));
    Mnemonics.setLocalizedText(lblVorschau,
            NbBundle.getMessage(WebDavPicturePanel.class, "WebDavPicturePanel.lblVorschau.text")); // NOI18N
    lblVorschau.setName("lblVorschau"); // NOI18N
    semiRoundedPanel2.add(lblVorschau);

    gridBagConstraints = new GridBagConstraints();
    gridBagConstraints.fill = GridBagConstraints.HORIZONTAL;
    pnlVorschau.add(semiRoundedPanel2, gridBagConstraints);

    jPanel3.setName("jPanel3"); // NOI18N
    jPanel3.setOpaque(false);
    jPanel3.setLayout(new GridBagLayout());

    pnlFoto.setName("pnlFoto"); // NOI18N
    pnlFoto.setOpaque(false);
    pnlFoto.setLayout(new GridBagLayout());

    lblPicture.setHorizontalAlignment(SwingConstants.CENTER);
    Mnemonics.setLocalizedText(lblPicture,
            NbBundle.getMessage(WebDavPicturePanel.class, "WebDavPicturePanel.lblPicture.text")); // NOI18N
    lblPicture.setName("lblPicture"); // NOI18N
    gridBagConstraints = new GridBagConstraints();
    gridBagConstraints.fill = GridBagConstraints.BOTH;
    gridBagConstraints.weightx = 1.0;
    gridBagConstraints.weighty = 1.0;
    pnlFoto.add(lblPicture, gridBagConstraints);

    lblBusy.setHorizontalAlignment(SwingConstants.CENTER);
    lblBusy.setMaximumSize(new Dimension(140, 40));
    lblBusy.setMinimumSize(new Dimension(140, 60));
    lblBusy.setName("lblBusy"); // NOI18N
    lblBusy.setPreferredSize(new Dimension(140, 60));
    gridBagConstraints = new GridBagConstraints();
    gridBagConstraints.gridx = 0;
    gridBagConstraints.gridy = 0;
    gridBagConstraints.fill = GridBagConstraints.BOTH;
    gridBagConstraints.weightx = 1.0;
    gridBagConstraints.weighty = 1.0;
    pnlFoto.add(lblBusy, gridBagConstraints);

    gridBagConstraints = new GridBagConstraints();
    gridBagConstraints.gridx = 0;
    gridBagConstraints.gridy = 0;
    gridBagConstraints.fill = GridBagConstraints.BOTH;
    gridBagConstraints.weightx = 1.0;
    gridBagConstraints.weighty = 1.0;
    gridBagConstraints.insets = new Insets(10, 10, 0, 10);
    jPanel3.add(pnlFoto, gridBagConstraints);

    pnlCtrlBtn.setName("pnlCtrlBtn"); // NOI18N
    pnlCtrlBtn.setOpaque(false);
    pnlCtrlBtn.setPreferredSize(new Dimension(100, 50));
    pnlCtrlBtn.setLayout(new GridBagLayout());

    btnPrevImg.setIcon(new ImageIcon(getClass().getResource("/res/arrow-left.png"))); // NOI18N
    Mnemonics.setLocalizedText(btnPrevImg,
            NbBundle.getMessage(WebDavPicturePanel.class, "WebDavPicturePanel.btnPrevImg.text")); // NOI18N
    btnPrevImg.setBorderPainted(false);
    btnPrevImg.setFocusPainted(false);
    btnPrevImg.setName("btnPrevImg"); // NOI18N
    btnPrevImg.addActionListener(formListener);
    gridBagConstraints = new GridBagConstraints();
    gridBagConstraints.gridx = 0;
    gridBagConstraints.gridy = 0;
    gridBagConstraints.fill = GridBagConstraints.BOTH;
    gridBagConstraints.weightx = 1.0;
    gridBagConstraints.weighty = 1.0;
    pnlCtrlBtn.add(btnPrevImg, gridBagConstraints);

    btnNextImg.setIcon(new ImageIcon(getClass().getResource("/res/arrow-right.png"))); // NOI18N
    Mnemonics.setLocalizedText(btnNextImg,
            NbBundle.getMessage(WebDavPicturePanel.class, "WebDavPicturePanel.btnNextImg.text")); // NOI18N
    btnNextImg.setBorderPainted(false);
    btnNextImg.setFocusPainted(false);
    btnNextImg.setName("btnNextImg"); // NOI18N
    btnNextImg.addActionListener(formListener);
    gridBagConstraints = new GridBagConstraints();
    gridBagConstraints.gridx = 1;
    gridBagConstraints.gridy = 0;
    gridBagConstraints.fill = GridBagConstraints.BOTH;
    gridBagConstraints.weightx = 1.0;
    gridBagConstraints.weighty = 1.0;
    pnlCtrlBtn.add(btnNextImg, gridBagConstraints);

    gridBagConstraints = new GridBagConstraints();
    gridBagConstraints.gridx = 0;
    gridBagConstraints.gridy = 1;
    gridBagConstraints.fill = GridBagConstraints.BOTH;
    gridBagConstraints.insets = new Insets(0, 10, 10, 10);
    jPanel3.add(pnlCtrlBtn, gridBagConstraints);

    gridBagConstraints = new GridBagConstraints();
    gridBagConstraints.gridx = 0;
    gridBagConstraints.gridy = 1;
    gridBagConstraints.fill = GridBagConstraints.BOTH;
    gridBagConstraints.weightx = 1.0;
    gridBagConstraints.weighty = 1.0;
    pnlVorschau.add(jPanel3, gridBagConstraints);

    gridBagConstraints = new GridBagConstraints();
    gridBagConstraints.gridx = 1;
    gridBagConstraints.gridy = 0;
    gridBagConstraints.gridheight = 2;
    gridBagConstraints.fill = GridBagConstraints.BOTH;
    gridBagConstraints.weightx = 1.0;
    gridBagConstraints.insets = new Insets(0, 5, 0, 0);
    add(pnlVorschau, gridBagConstraints);

    bindingGroup.bind();
}

From source file:base.BasePlayer.Main.java

void setButtons() {
    try {/*from  w w w.jav a 2s  .  co  m*/

        //      filemenu.setFont(font);
        GridBagConstraints c = new GridBagConstraints();

        c.anchor = GridBagConstraints.NORTHWEST;
        c.insets = new Insets(1, 4, 4, 2);
        //c.insets = new Insets(5, 5, 2, 5);
        c.gridx = 0;
        c.gridy = 0;
        c.gridwidth = 1;
        /*   opensamples.setMargin(new Insets(0, 0, 0,0));
                   
           opensamples.setPreferredSize(buttonDimension);
           addtracks.setMargin(new Insets(0, 0, 0, 0));
           addtracks.setPreferredSize(buttonDimension);
           addcontrols.setMargin(new Insets(0, 0, 0, 0));
           addcontrols.setPreferredSize(buttonDimension);
           */

        menubar.setOpaque(true);
        panel.add(menubar, c);
        c.gridx = 1;

        setbut = new JButton("", settingsIcon);
        setbut.setToolTipText("Settings");

        setbut.setOpaque(false);
        setbut.setContentAreaFilled(false);
        setbut.setBackground(Main.panel.getBackground());
        setbut.addMouseListener(new MouseListener() {

            @Override
            public void mouseClicked(MouseEvent e) {

            }

            @Override
            public void mousePressed(MouseEvent e) {
                Settings.frame.setLocation(
                        frame.getLocationOnScreen().x + frame.getWidth() / 2 - Settings.frame.getWidth() / 2,
                        frame.getLocationOnScreen().y + frame.getHeight() / 6);
                Settings.frame.setState(JFrame.NORMAL);
                Settings.frame.setVisible(true);
            }

            @Override
            public void mouseReleased(MouseEvent e) {

            }

            @Override
            public void mouseEntered(MouseEvent e) {
                setbut.setOpaque(true);
                Main.setbut.setBackground(Color.white);
                Main.setbut.revalidate();
            }

            @Override
            public void mouseExited(MouseEvent e) {
                setbut.setOpaque(false);
                Main.setbut.revalidate();
            }

        });
        setbut.setBorder(null);
        c.insets = new Insets(0, 2, 0, 0);
        menubar.add(setbut, c);
        //   c.gridx = 1;
        //   c.gridx = 2;      
        //   c.gridx = 3;      

        //      zoomout.setMargin(new Insets(0, 0, 0, 0));
        //   panel.add(zoomout, c);      

        /*   JMenuItem empty2 = new JMenuItem("");
           empty2.setEnabled(false);      
           menubar.add(empty2);
                  
            c.gridx = 4;*/
        //  chromosomeDropdown.setPreferredSize(buttonDimension);

        // panel.add(chromosomeDropdown, c);
        //       c.gridx = 5;

        //  back.setMargin(new Insets(0, 0, 0, 0));
        // forward.setMargin(new Insets(0, 0, 0, 0));
        // back.setPreferredSize(new Dimension(back.getFontMetrics(back.getFont()).stringWidth("<")+10,(int)fieldDimension.getHeight()));
        //    forward.setPreferredSize(new Dimension(forward.getFontMetrics(forward.getFont()).stringWidth("<")+10,(int)fieldDimension.getHeight()));
        //back.setMinimumSize(new Dimension(back.getFontMetrics(back.getFont()).stringWidth("<")+10,(int)fieldDimension.getHeight()));
        //    forward.setMinimumSize(new Dimension(forward.getFontMetrics(forward.getFont()).stringWidth("<")+10,(int)fieldDimension.getHeight()));
        //    panel.add(back, c);
        //       c.gridx = 7;
        //   panel.add(forward, c);

        chromosomeDropdown.setMaximumRowCount(25);
        chromosomeDropdown.setEnabled(true);
        chromosomeDropdown.addActionListener(ChromoDropActionListener);
        chromosomeDropdown.addMouseListener(this);

        c.gridwidth = 10;
        c.gridx = 0;
        c.gridy = 1;
        bedScroll = new JScrollPane(JScrollPane.VERTICAL_SCROLLBAR_ALWAYS,
                JScrollPane.HORIZONTAL_SCROLLBAR_NEVER);
        bedScroll.getViewport().setPreferredSize(bedDimensions);

        drawScroll = new JScrollPane(JScrollPane.VERTICAL_SCROLLBAR_ALWAYS,
                JScrollPane.HORIZONTAL_SCROLLBAR_NEVER);
        drawScroll.getViewport().setPreferredSize(drawDimensions);

        chromScroll = new JScrollPane(JScrollPane.VERTICAL_SCROLLBAR_ALWAYS,
                JScrollPane.HORIZONTAL_SCROLLBAR_NEVER);
        chromScroll.getViewport().setPreferredSize(chromDimensions);

        drawScroll.getVerticalScrollBar().setAutoscrolls(false);
        //       chromScroll.getViewport().setPreferredSize(new Dimension(drawWidth,chromHeight-20));

        //    drawScroll.setBorder(BorderFactory.createEmptyBorder());
        //chromScroll.setBorder(BorderFactory.createLoweredBevelBorder());
        //    drawScroll.setBorder(BorderFactory.createLoweredBevelBorder());
        //    bedScroll.setBorder(BorderFactory.createLoweredBevelBorder());

        //   chromScroll.setBorder(BorderFactory.createEmptyBorder());

        //       bedScroll.setBorder(BorderFactory.createEmptyBorder());

        controlScroll = new JScrollPane(JScrollPane.VERTICAL_SCROLLBAR_ALWAYS,
                JScrollPane.HORIZONTAL_SCROLLBAR_NEVER);
        controlScroll.getViewport().setPreferredSize(bedDimensions);
        controlScroll.getViewport().add(controlDraw);
        controlDraw.setVisible(false);
        controlScroll.setVisible(false);

        chromScroll.setBorder(BorderFactory.createEmptyBorder());
        drawScroll.setBorder(BorderFactory.createEmptyBorder());
        bedScroll.setBorder(BorderFactory.createLoweredBevelBorder());
        controlScroll.setBorder(BorderFactory.createLoweredBevelBorder());

        addSplit(chromosomeDropdown.getItemAt(0));

        chromScroll.getViewport().add(chromDraw);
        drawScroll.getViewport().add(drawCanvas);
        drawScroll.addMouseListener(this);
        bedCanvas = new BedCanvas(drawWidth, 200);

        bedScroll.getViewport().add(bedCanvas);

        frame.setExtendedState(frame.getExtendedState() | JFrame.MAXIMIZED_BOTH);

        c.weightx = 1.0;
        c.weighty = 1.0;
        c.fill = GridBagConstraints.BOTH;

        trackPane = new JSplitPane(JSplitPane.VERTICAL_SPLIT, bedScroll, controlScroll);
        trackPane.setUI(new BasicSplitPaneUI() {
            public BasicSplitPaneDivider createDefaultDivider() {
                return new BasicSplitPaneDivider(this) {

                    private static final long serialVersionUID = 1L;

                    public void setBorder(Border b) {
                    }

                    @Override
                    public void paint(Graphics g) {
                        g.setColor(Color.lightGray);
                        g.fillRect(0, 0, getSize().width, getSize().height);
                        super.paint(g);
                    }
                };
            }
        });
        trackPane.setBorder(null);

        trackPane.setDividerSize(0);
        trackPane.setPreferredSize(drawDimensions);
        trackPane.setResizeWeight(0.0);
        trackPane.setContinuousLayout(true);
        trackPane.setVisible(false);

        varpane = new JSplitPane(JSplitPane.VERTICAL_SPLIT, trackPane, drawScroll);
        varpane.setUI(new BasicSplitPaneUI() {
            public BasicSplitPaneDivider createDefaultDivider() {
                return new BasicSplitPaneDivider(this) {

                    private static final long serialVersionUID = 1L;

                    public void setBorder(Border b) {
                    }

                    @Override
                    public void paint(Graphics g) {
                        g.setColor(Color.lightGray);
                        g.fillRect(0, 0, getSize().width, getSize().height);
                        super.paint(g);
                    }
                };
            }
        });
        varpane.setBorder(null);

        varpane.setDividerSize(0);
        varpane.setPreferredSize(drawDimensions);
        varpane.setResizeWeight(0.0);
        varpane.setContinuousLayout(true);
        bedScroll.setVisible(false);

        controlScroll.setVisible(false);

        chrompan = new JPanel() {
            private static final long serialVersionUID = 1L;

            protected void paintComponent(Graphics g) {

                super.paintComponent(g);
                g.setColor(Draw.sidecolor);
                g.fillRect(0, 0, this.getWidth(), this.getHeight());

                g.setColor(Color.gray);
                g.fillRect(0, 0, 3, this.getHeight());
                g.setColor(Color.lightGray);
                g.fillRect(2, 0, 2, this.getHeight());

            }

        };
        chrompan.setLayout(new GridBagLayout());
        GridBagConstraints gb = new GridBagConstraints();
        gb.anchor = GridBagConstraints.NORTHWEST;

        gb.insets = new Insets(2, 10, 2, 2);
        gb.gridx = 0;
        gb.gridy = 0;
        gb.gridwidth = 1;
        gb.fill = GridBagConstraints.HORIZONTAL;
        refDropdown.setBackground(Color.white);
        refDropdown.setBorder(BorderFactory.createMatteBorder(1, 1, 1, 1, Color.lightGray));
        refDropdown.setBorder(BorderFactory.createCompoundBorder(refDropdown.getBorder(),
                BorderFactory.createEmptyBorder(0, 0, 0, 0)));
        geneDropdown.setBackground(Color.white);
        geneDropdown.setBorder(BorderFactory.createMatteBorder(1, 1, 1, 1, Color.lightGray));
        geneDropdown.setBorder(BorderFactory.createCompoundBorder(geneDropdown.getBorder(),
                BorderFactory.createEmptyBorder(0, 0, 0, 0)));
        geneDropdown.addActionListener(annoDropActionListener);
        JLabel refLabel = new JLabel("Reference genome:");

        JLabel geneLabel = new JLabel("Gene annotation:");
        chromLabel.setName("header");
        chrompan.add(chromLabel, gb);
        gb.gridy++;
        chrompan.add(new JSeparator(), gb);
        gb.gridy++;
        gb.insets = new Insets(0, 10, 0, 2);
        chrompan.add(refLabel, gb);
        gb.gridy++;
        chrompan.add(refDropdown, gb);
        gb.gridy++;
        chrompan.add(geneLabel, gb);
        gb.gridy++;
        chrompan.add(geneDropdown, gb);
        gb.gridy++;
        gb.insets = new Insets(20, 10, 0, 2);
        JLabel memory = new JLabel("Memory usage:");
        memory.setName("header");
        chrompan.add(memory, gb);
        gb.insets = new Insets(0, 10, 0, 2);
        gb.gridy++;
        chrompan.add(memLabel, gb);
        gb.weightx = 1;
        gb.weighty = 1;
        gb.gridwidth = GridBagConstraints.REMAINDER;
        chrompan.add(new JLabel(), gb);
        chrompan.setMinimumSize(new Dimension(1, 1));
        chrompan.addComponentListener(this);
        upPanel = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT, chrompan, chromScroll);
        drawScroll.addComponentListener(this);
        //upPanel.setBorder(BorderFactory.createLoweredBevelBorder());
        upPanel.setBorder(BorderFactory.createMatteBorder(0, 0, 1, 0, Color.white));
        upPanel.setDividerLocation(Main.sidebarWidth - 2);
        chrompan.setBackground(Draw.sidecolor);
        BasicSplitPaneUI chromPaneUI = (BasicSplitPaneUI) upPanel.getUI();
        chromPaneDivider = chromPaneUI.getDivider();
        chromPaneDivider.addMouseListener(this);

        upPanel.setDividerSize(3);

        upPanel.setUI(new BasicSplitPaneUI() {
            public BasicSplitPaneDivider createDefaultDivider() {
                return new BasicSplitPaneDivider(this) {

                    private static final long serialVersionUID = 1L;

                    public void setBorder(Border b) {
                    }

                    @Override
                    public void paint(Graphics g) {
                        g.setColor(Color.lightGray);
                        g.fillRect(0, 0, getSize().width, getSize().height);

                        super.paint(g);
                    }
                };
            }
        });

        splitPane = new JSplitPane(JSplitPane.VERTICAL_SPLIT, upPanel, varpane);

        splitPane.setUI(new BasicSplitPaneUI() {
            public BasicSplitPaneDivider createDefaultDivider() {
                return new BasicSplitPaneDivider(this) {

                    private static final long serialVersionUID = 1L;

                    public void setBorder(Border b) {
                    }

                    @Override
                    public void paint(Graphics g) {
                        g.setColor(Color.lightGray);
                        g.fillRect(0, 0, getSize().width, getSize().height);

                        super.paint(g);
                    }
                };
            }
        });

        BasicSplitPaneUI basicSplitPaneUI = (BasicSplitPaneUI) splitPane.getUI();
        splitPaneDivider = basicSplitPaneUI.getDivider();
        //    splitPaneDivider.addMouseListener(this);
        basicSplitPaneUI = (BasicSplitPaneUI) trackPane.getUI();
        trackPaneDivider = basicSplitPaneUI.getDivider();
        //    trackPaneDivider.addMouseListener(this);
        BasicSplitPaneUI splitPaneUI = (BasicSplitPaneUI) varpane.getUI();
        varPaneDivider = splitPaneUI.getDivider();
        //   varPaneDivider.addMouseListener(this);
        splitPane.setDividerSize(3);

        splitPane.setPreferredSize(drawDimensions);
        splitPane.setContinuousLayout(true);

        panel.add(splitPane, c);
        add(panel, c);

        openvcfs.addActionListener(this);
        openbams.addActionListener(this);
        addtracks.addActionListener(this);
        addcontrols.addActionListener(this);

        openProject.addActionListener(this);
        saveProject.addActionListener(this);
        saveProjectAs.addActionListener(this);
        dosomething.addActionListener(this);
        clear.addActionListener(this);
        //    drawScroll.getVerticalScrollBar().addMouseMotionListener(this);
        drawScroll.getVerticalScrollBar().addMouseListener(this);
        drawScroll.getVerticalScrollBar().addMouseMotionListener(this);
        drawScroll.getVerticalScrollBar().addMouseWheelListener(new MouseWheelListener() {
            @Override
            public void mouseWheelMoved(MouseWheelEvent e) {
                Draw.setGlasspane(true);
                if (e.getWheelRotation() < 0) {
                    if (drawCanvas.drawVariables.visiblestart > 0) {
                        drawCanvas.drawVariables.visiblestart--;

                    }
                    Draw.setScrollbar((int) (drawCanvas.drawVariables.visiblestart
                            * drawCanvas.drawVariables.sampleHeight));
                } else {
                    if (drawCanvas.drawVariables.visiblestart
                            + drawCanvas.drawVariables.visiblesamples < Main.samples) {
                        drawCanvas.drawVariables.visiblestart++;

                    }
                    Draw.setScrollbar((int) (drawCanvas.drawVariables.visiblestart
                            * drawCanvas.drawVariables.sampleHeight));
                }

            }

        }

        );
        drawScroll.getVerticalScrollBar().addAdjustmentListener(new AdjustmentListener() {

            @Override
            public void adjustmentValueChanged(AdjustmentEvent event) {

                //System.out.println(drawCanvas.drawVariables.visiblestart +" " +(short)(Main.drawScroll.getVerticalScrollBar().getValue()/drawCanvas.drawVariables.sampleHeight));
                if (drawCanvas.drawVariables.visiblestart != (short) (Main.drawScroll.getVerticalScrollBar()
                        .getValue() / drawCanvas.drawVariables.sampleHeight)) {
                    if (!drawCanvas.sidebar) {
                        drawCanvas.drawVariables.visiblestart = (short) (Main.drawScroll.getVerticalScrollBar()
                                .getValue() / drawCanvas.drawVariables.sampleHeight);
                    }
                    if (drawCanvas.splits.size() > 1) {
                        for (int i = 0; i < drawCanvas.splits.size(); i++) {
                            drawCanvas.splits.get(i).updateReads = true;
                        }
                    } else {
                        Draw.updateReads = true;
                        Draw.updatevars = true;
                    }

                    Draw.updatevars = true;
                    Main.drawCanvas.repaint();
                }

            }

        });

        zoomout.addActionListener(this);

        FileRead.head = new VarNode(0, (byte) 0, "N", (short) 0, (short) 0, false, (float) 0, (float) 0, null,
                null, new Sample("", (short) 1, null), null, null);
        drawCanvas.current = FileRead.head;

        frame.addComponentListener(this);
        frame.addMouseListener(this);
        frame.setGlassPane(glassPane);
        glassPane.setOpaque(false);
        glassPane.setVisible(false);

        positionField.setText("chr1:1-" + MethodLibrary.formatNumber(drawCanvas.splits.get(0).chromEnd));
        positionField.setToolTipText("Current chromosomal region");
        widthLabel.setText(MethodLibrary.formatNumber(drawCanvas.splits.get(0).chromEnd) + "bp");
        widthLabel.setToolTipText("Current region width in base pairs");
    } catch (Exception e) {
        e.printStackTrace();
    }
}

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 v a 2s  .  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:org.jas.dnd.DragTooltipDialog.java

private JPanel getDragAcceptedPanel() {
    if (dragAcceptedPanel == null) {
        dragAcceptedPanel = new JPanel(new BorderLayout());
        dragAcceptedPanel.setName("transparent");
        JLabel dragIconAccepted = new JLabel();
        dragIconAccepted.setName("dragPermittedPanel");
        dragAcceptedPanel.add(dragIconAccepted, BorderLayout.CENTER);
        dragAcceptedPanel.setSize(compactSize);
    }/*from  w  ww.j  a va2 s.c  o  m*/
    return dragAcceptedPanel;
}

From source file:org.rdv.ui.channel.LocalChannelDialog.java

/**
 * Initialize the UI components.//  w w w . j av a2 s. c  o m
 */
private void initComponents() {
    RDV rdv = RDV.getInstance(RDV.class);

    JPanel container = new JPanel();
    setContentPane(container);

    container.setLayout(new GridBagLayout());
    GridBagConstraints c = createDefaultGridBagConstraints();

    JLabel nameLabel = new JLabel();
    nameLabel.setName("nameLabel");
    nameLabel.setText(PROPERTY_REPO.getValue(NAME_KEY));

    c = createDefaultGridBagConstraints();
    c.fill = GridBagConstraints.NONE;
    c.gridx = 0;
    c.gridy = 1;
    c.gridwidth = 1;
    c.anchor = GridBagConstraints.NORTHWEST;
    c.insets = new java.awt.Insets(10, 10, 10, 5);
    container.add(nameLabel, c);

    c = createDefaultGridBagConstraints();
    c.fill = GridBagConstraints.HORIZONTAL;
    c.weightx = 1;
    c.gridx = 1;
    c.gridy = 1;
    c.gridwidth = GridBagConstraints.REMAINDER;
    c.anchor = GridBagConstraints.NORTHWEST;
    c.insets = new java.awt.Insets(10, 0, 10, 10);
    container.add(nameTextField, c);
    if (isChannelUpdateOperation()) {
        nameTextField.setEnabled(false);
    }
    JLabel unitLabel = new JLabel();
    unitLabel.setName("unitLabel");
    unitLabel.setText(PROPERTY_REPO.getValue(UNIT_KEY));
    c = createDefaultGridBagConstraints();
    c.fill = GridBagConstraints.NONE;
    c.weightx = 0;
    c.gridx = 0;
    c.gridy = 2;
    c.gridwidth = 1;
    c.anchor = GridBagConstraints.NORTHWEST;
    c.insets = new java.awt.Insets(0, 10, 10, 5);
    container.add(unitLabel, c);

    c = createDefaultGridBagConstraints();
    c.fill = GridBagConstraints.HORIZONTAL;
    c.weightx = 1;
    c.gridx = 1;
    c.gridy = 2;
    c.gridwidth = GridBagConstraints.REMAINDER;
    c.anchor = GridBagConstraints.NORTHWEST;
    c.insets = new java.awt.Insets(0, 0, 10, 10);
    container.add(unitTextField, c);

    JLabel variablesLabel = new JLabel();
    variablesLabel.setName("variablesLabel");
    variablesLabel.setText(PROPERTY_REPO.getValue(VARIABLES_KEY));
    c = createDefaultGridBagConstraints();
    c.fill = GridBagConstraints.NONE;
    c.weightx = 0;
    c.gridx = 0;
    c.gridy = 3;
    c.gridwidth = 1;
    c.anchor = GridBagConstraints.NORTHWEST;
    c.insets = new java.awt.Insets(0, 10, 10, 10);
    container.add(variablesLabel, c);

    JPanel variablesPanel = buildVariablesPanel();

    c = createDefaultGridBagConstraints();
    c.fill = GridBagConstraints.BOTH;
    c.weightx = 0;
    c.gridx = 0;
    c.gridy = 4;
    c.gridwidth = GridBagConstraints.REMAINDER;
    c.anchor = GridBagConstraints.NORTHWEST;
    c.insets = new java.awt.Insets(0, 10, 10, 10);
    c.weightx = 1;
    c.weighty = 1;
    container.add(variablesPanel, c);

    JLabel formulaLabel = new JLabel();
    formulaLabel.setName("formulaLabel");
    formulaLabel.setText(PROPERTY_REPO.getValue(FORMULA_KEY));
    c = createDefaultGridBagConstraints();
    c.fill = GridBagConstraints.BOTH;
    c.weightx = 0;
    c.gridx = 0;
    c.gridy = 5;
    c.gridwidth = GridBagConstraints.REMAINDER;
    c.anchor = GridBagConstraints.NORTHWEST;
    c.insets = new java.awt.Insets(0, 10, 10, 10);
    container.add(formulaLabel, c);

    JScrollPane formulaScrollPane = new JScrollPane(formulaTextArea);
    c = createDefaultGridBagConstraints();
    c.fill = GridBagConstraints.BOTH;
    c.weightx = 1;
    c.weighty = 1;
    c.gridx = 0;
    c.gridy = 6;
    c.gridwidth = GridBagConstraints.REMAINDER;
    c.anchor = GridBagConstraints.NORTHWEST;
    c.insets = new java.awt.Insets(0, 10, 10, 10);
    container.add(formulaScrollPane, c);

    JPanel footerPanel = buildFooterPanel();

    c = createDefaultGridBagConstraints();
    c.fill = GridBagConstraints.NONE;
    c.weightx = 0.5;
    c.weighty = 0;
    c.gridx = 0;
    c.gridy = 7;
    c.gridwidth = GridBagConstraints.REMAINDER;
    ;
    c.anchor = GridBagConstraints.LINE_END;
    c.insets = new java.awt.Insets(0, 0, 10, 5);
    container.add(footerPanel, c);

    // bind keystrokes
    InputMap inputMap = container.getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW);
    inputMap.put(KeyStroke.getKeyStroke("ENTER"), "addChannel");
    inputMap.put(KeyStroke.getKeyStroke("ESCAPE"), "cancel");

    // initially disable buttons
    removeVariableButton.setEnabled(false);

    pack();

    setLocationByPlatform(true);
    setVisible(true);
}

From source file:org.springframework.richclient.application.statusbar.support.DefaultStatusBar.java

/**
 * Create the <code>JLabel</code> used to render the messages.
 * <p>/*from   www .  j  a  v a  2 s.  c  o  m*/
 * Can safely be overridden to customize the label
 *
 * @return the <code>JLabel</code>
 */
protected JLabel createMessageLabel() {
    JLabel messageLabel = new JLabel(" ");
    messageLabel.setName("message");
    Border bevelBorder = BorderFactory.createBevelBorder(BevelBorder.LOWERED,
            UIManager.getColor("controlHighlight"), UIManager.getColor("controlShadow"));
    Border emptyBorder = BorderFactory.createEmptyBorder(1, 3, 1, 3);
    messageLabel.setBorder(BorderFactory.createCompoundBorder(bevelBorder, emptyBorder));

    return messageLabel;
}