Example usage for java.awt GridBagConstraints NORTHEAST

List of usage examples for java.awt GridBagConstraints NORTHEAST

Introduction

In this page you can find the example usage for java.awt GridBagConstraints NORTHEAST.

Prototype

int NORTHEAST

To view the source code for java.awt GridBagConstraints NORTHEAST.

Click Source Link

Document

Put the component at the top-right corner of its display area.

Usage

From source file:base.BasePlayer.AddGenome.java

public AddGenome() {
    super(new BorderLayout());

    makeGenomes();/*from w  ww.j  a  va2 s .c o m*/
    tree = new JTree(root);
    tree.getSelectionModel().setSelectionMode(TreeSelectionModel.DISCONTIGUOUS_TREE_SELECTION);
    sizeError.setForeground(Draw.redColor);
    sizeError.setVisible(true);
    treemodel = (DefaultTreeModel) tree.getModel();
    remscroll = new JScrollPane(remtable);
    tree.setCellRenderer(new DefaultTreeCellRenderer() {
        private static final long serialVersionUID = 1L;
        private Icon collapsedIcon = UIManager.getIcon("Tree.collapsedIcon");
        private Icon expandedIcon = UIManager.getIcon("Tree.expandedIcon");
        //   private Icon leafIcon = UIManager.getIcon("Tree.leafIcon");
        private Icon addIcon = UIManager.getIcon("Tree.closedIcon");

        //        private Icon saveIcon = UIManager.getIcon("OptionPane.informationIcon");
        @Override
        public Component getTreeCellRendererComponent(JTree tree, Object value, boolean selected,
                boolean expanded, boolean isLeaf, int row, boolean focused) {
            Component c = super.getTreeCellRendererComponent(tree, value, selected, expanded, isLeaf, row,
                    focused);

            if (!isLeaf) {

                //setFont(getFont().deriveFont(Font.PLAIN));
                if (expanded) {
                    setIcon(expandedIcon);
                } else {
                    setIcon(collapsedIcon);
                }

                /*   if(((DefaultMutableTreeNode) value).getUserObject().toString().equals("Annotations")) {
                      this.setFocusable(false);
                      setFont(getFont().deriveFont(Font.BOLD));
                      setIcon(null);
                   }
                */
            } else {
                if (((DefaultMutableTreeNode) value).getUserObject().toString().equals("Annotations")) {

                    //      setFont(getFont().deriveFont(Font.PLAIN));
                    setIcon(null);
                } else if (((DefaultMutableTreeNode) value).getUserObject().toString().startsWith("Add new")) {

                    //       setFont(getFont().deriveFont(Font.PLAIN));

                    setIcon(addIcon);
                } else {
                    //      setFont(getFont().deriveFont(Font.ITALIC));
                    setIcon(null);
                    //   setIcon(leafIcon);
                }

            }

            return c;
        }
    });
    tree.addMouseListener(this);
    tree.addTreeSelectionListener(new TreeSelectionListener() {

        public void valueChanged(TreeSelectionEvent e) {
            try {
                DefaultMutableTreeNode node = (DefaultMutableTreeNode) tree.getLastSelectedPathComponent();

                if (node == null)
                    return;

                selectedNode = node;

                if (node.isLeaf()) {
                    checkUpdates.setEnabled(false);
                } else {
                    checkUpdates.setEnabled(true);
                }
                if (node.toString().startsWith("Add new") || node.toString().equals("Annotations")) {
                    remove.setEnabled(false);
                } else {
                    remove.setEnabled(true);
                }
                genometable.clearSelection();
                download.setEnabled(false);
            } catch (Exception ex) {
                ex.printStackTrace();
            }
        }
    });
    tree.setToggleClickCount(1);
    tree.setRootVisible(false);
    treescroll = new JScrollPane(tree);
    checkGenomes();
    genomeFileText = new JLabel("Select reference fasta-file");
    annotationFileText = new JLabel("Select annotation gff3-file");
    genomeName = new JTextField("Give name of the genome");
    openRef = new JButton("Browse");
    openAnno = new JButton("Browse");
    add = new JButton("Add");
    download = new JButton("Download");
    checkEnsembl = new JButton("Ensembl fetch");
    checkEnsembl.setMinimumSize(Main.buttonDimension);
    checkEnsembl.addActionListener(this);
    getLinks = new JButton("Get file links.");
    remove = new JButton("Remove");
    checkUpdates = new JButton("Check updates");
    download.setEnabled(false);
    getLinks.setEnabled(false);
    getLinks.addActionListener(this);
    remove.setEnabled(false);
    download.addActionListener(this);
    remove.addActionListener(this);
    panel.setBackground(Draw.sidecolor);
    checkUpdates.addActionListener(this);
    this.setBackground(Draw.sidecolor);
    frame.getContentPane().setBackground(Draw.sidecolor);
    GridBagConstraints c = new GridBagConstraints();

    c.gridx = 0;
    c.gridy = 0;
    c.insets = new Insets(2, 4, 2, 4);
    c.gridwidth = 2;
    genometable.setSelectionMode(0);
    genometable.setShowGrid(false);
    remtable.setSelectionMode(0);
    remtable.setShowGrid(false);
    JScrollPane scroll = new JScrollPane();
    scroll.getViewport().setBackground(Color.white);
    scroll.getViewport().add(genometable);

    remscroll.getViewport().setBackground(Color.white);

    genometable.addMouseListener(this);
    remtable.addMouseListener(this);
    //   panel.add(welcomeLabel,c);
    //   c.gridy++;
    c.anchor = GridBagConstraints.NORTHWEST;
    panel.add(new JLabel("Download genome reference and annotation"), c);
    c.gridx++;
    c.anchor = GridBagConstraints.NORTHEAST;
    panel.add(checkEnsembl, c);
    c.anchor = GridBagConstraints.NORTHWEST;
    c.weightx = 1;
    c.weighty = 1;
    c.fill = GridBagConstraints.BOTH;
    c.gridx = 0;
    c.gridy++;
    //c.fill = GridBagConstraints.NONE;
    panel.add(scroll, c);
    c.gridy++;
    c.fill = GridBagConstraints.NONE;
    panel.add(download, c);
    c.gridx = 1;
    panel.add(sizeError, c);
    c.gridx = 1;
    panel.add(getLinks, c);
    c.gridy++;
    c.gridx = 0;
    c.fill = GridBagConstraints.BOTH;
    panel.add(new JLabel("Add/Remove installed genomes manually"), c);
    c.gridy++;
    panel.add(treescroll, c);
    c.gridy++;

    c.fill = GridBagConstraints.NONE;
    c.gridwidth = 1;
    remove.setMinimumSize(Main.buttonDimension);
    panel.add(remove, c);
    c.gridx = 1;
    panel.add(checkUpdates, c);
    checkUpdates.setMinimumSize(Main.buttonDimension);
    checkUpdates.setEnabled(false);
    c.gridwidth = 2;
    c.gridx = 0;
    c.gridy++;
    try {
        if (Main.genomeDir != null) {
            genomedirectory.setText(Main.genomeDir.getCanonicalPath());
        }

        genomedirectory.setEditable(false);
        genomedirectory.setBackground(Color.white);
        genomedirectory.setForeground(Color.black);
    } catch (IOException e1) {
        e1.printStackTrace();
    }
    panel.add(new JLabel("Genome directory:"), c);
    c.gridy++;
    panel.add(genomedirectory, c);
    /*   c.fill = GridBagConstraints.BOTH;
       c.gridy++;
       panel.add(new JLabel("Add genome manually"),c);
       c.gridy++;   
       c.gridwidth = 2;      
       panel.add(new JSeparator(),c);
       c.gridwidth = 1;
       c.gridy++;
       panel.add(genomeFileText, c);
       c.fill = GridBagConstraints.NONE;
       c.gridx = 1;
       panel.add(openRef, c);      
               
       c.gridx = 0;
       openRef.addActionListener(this);
       c.gridy++;
       panel.add(annotationFileText,c);
       c.gridx=1;
       panel.add(openAnno, c);
       c.gridy++;
               
       panel.add(add,c);
            
       openAnno.addActionListener(this);
       add.addActionListener(this);
       add.setEnabled(false);
       */
    add(panel, BorderLayout.NORTH);
    if (Main.drawCanvas != null) {
        setFonts(Main.menuFont);
    }
    /*   html.append("<a href=http:Homo_sapiens_GRCh37:Ensembl_genes> Homo sapiens GRCh37 with Ensembl</a> or <a href=http:Homo_sapiens_GRCh37:RefSeq_genes>RefSeq</a> gene annotations<br>");
       html.append("<a href=http:Homo_sapiens_GRCh38:Ensembl_genes> Homo sapiens GRCh38 with Ensembl</a> or <a href=http:Homo_sapiens_GRCh38:RefSeq_genes>RefSeq</a> gene annotations<br><br>");
               
       html.append("<a href=http:Mus_musculus_GRCm38:Ensembl_genes> Mus musculus GRCm38 with Ensembl</a> or <a href=http:Mus_musculus_GRCm38:RefSeq_genes>RefSeq</a> gene annotations<br>");
       html.append("<a href=http:Rattus_norvegicus:Ensembl_genes> Rattus norvegicus with Ensembl gene annotations</a><br>");
       html.append("<a href=http:Saccharomyces_cerevisiae:Ensembl_genes> Saccharomyces cerevisiae with Ensembl gene annotation</a><br>");               
       html.append("<a href=http:Ciona_intestinalis:Ensembl_genes> Ciona intestinalis with Ensembl gene annotation</a><br>");
       Object[] row = {"Homo_sapiens_GRCh37"};
       Object[] row = {"Homo_sapiens_GRCh38"};
               
       model.addRow(row);
       /*   genomeName.setPreferredSize(new Dimension(300,20));
       this.add(genomeName);
       this.add(new JSeparator());
               
       this.add(openRef);
       openRef.addActionListener(this);
       this.add(genomeFileText);
       this.add(openAnno);
       openAnno.addActionListener(this);
       this.add(annotationFileText);
       this.add(add);
       add.addActionListener(this);
       if(annotation) {
          openRef.setVisible(false);
          genomeFileText.setVisible(false);
          genomeName.setEditable(false);
       }
       genomeFileText.setEditable(false);
       annotationFileText.setEditable(false);*/
}

From source file:com.microsoft.azure.hdinsight.spark.ui.SparkSubmissionContentPanel.java

private void addConfigurationLineItem() {
    JLabel jobConfigurationLabel = new JLabel("Job configurations");

    add(jobConfigurationLabel, new GridBagConstraints(0, ++displayLayoutCurrentRow, 1, 1, 1, 0,
            GridBagConstraints.NORTHWEST, GridBagConstraints.NONE, new Insets(margin, margin, 0, 0), 0, 0));

    String[] columns = { "Key", "Value", "" };

    jobConfigurationTable = new JBTable();
    Dimension jobConfigurationTableSize = new Dimension(320, 100);
    jobConfigurationTable.setPreferredScrollableViewportSize(jobConfigurationTableSize);

    jobConfigurationTable.setSurrendersFocusOnKeystroke(true);
    jobConfigurationTable.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
    jobConfigurationTable.setColumnSelectionAllowed(true);
    JBScrollPane scrollPane = new JBScrollPane(jobConfigurationTable);
    jobConfigurationTable.setFillsViewportHeight(true);
    scrollPane.setMinimumSize(jobConfigurationTableSize);

    jobConfigurationTable.addPropertyChangeListener((evt) -> {
        if ((evt.getPropertyName().equals("tableCellEditor") || evt.getPropertyName().equals("model"))
                && jobConfigurationTable.getModel() instanceof SubmissionTableModel) {
            SubmissionTableModel model = (SubmissionTableModel) jobConfigurationTable.getModel();
            setVisibleForFixedErrorMessageLabel(ErrorMessageLabelTag.JobConfiguration.ordinal(), false);

            SparkSubmissionJobConfigCheckResult result = model.getFirstCheckResults();
            if (result != null) {
                setStatusForMessageLabel(ErrorMessageLabelTag.JobConfiguration.ordinal(), true,
                        result.getMessaqge(),
                        result.getStatus() == SparkSubmissionJobConfigCheckStatus.Warning);
            }/*from ww  w . ja v a 2  s.c o m*/
        }
    });

    add(scrollPane, new GridBagConstraints(1, displayLayoutCurrentRow, 1, 1, 1, 0, GridBagConstraints.NORTHWEST,
            GridBagConstraints.HORIZONTAL, new Insets(margin, margin, 0, 0), 0, 0));

    JButton loadJobConfigurationButton = new JButton("...");
    loadJobConfigurationButton.setPreferredSize(selectedArtifactTextField.getButton().getPreferredSize());
    FixedSizeButton loadJobConfigurationFixedSizeButton = new FixedSizeButton(loadJobConfigurationButton);

    add(loadJobConfigurationFixedSizeButton,
            new GridBagConstraints(2, displayLayoutCurrentRow, 0, 1, 0, 0, GridBagConstraints.NORTHEAST,
                    GridBagConstraints.NONE, new Insets(margin, margin / 2, 0, margin), 0, 0));
    loadJobConfigurationFixedSizeButton.setToolTipText("Load Spark config from property file");

    loadJobConfigurationFixedSizeButton.addActionListener(new ActionListener() {
        @Override
        public void actionPerformed(ActionEvent e) {
            FileChooserDescriptor fileChooserDescriptor = new FileChooserDescriptor(true, false, false, false,
                    false, false);

            fileChooserDescriptor.setTitle("Select Spark property file");

            VirtualFile chooseFile = FileChooser.chooseFile(fileChooserDescriptor, null, null);
            if (chooseFile != null) {
                submitModel.loadJobConfigMapFromPropertyFile(chooseFile.getCanonicalPath());
            }
        }
    });

    errorMessageLabels[ErrorMessageLabelTag.JobConfiguration.ordinal()] = new JLabel();
    errorMessageLabels[ErrorMessageLabelTag.JobConfiguration.ordinal()]
            .setForeground(DarkThemeManager.getInstance().getErrorMessageColor());
    errorMessageLabels[ErrorMessageLabelTag.JobConfiguration.ordinal()].setVisible(false);

    add(errorMessageLabels[ErrorMessageLabelTag.JobConfiguration.ordinal()],
            new GridBagConstraints(1, ++displayLayoutCurrentRow, 0, 1, 1, 0, GridBagConstraints.NORTHWEST,
                    GridBagConstraints.HORIZONTAL, new Insets(0, margin, 0, margin), 0, 0));

}

From source file:edu.harvard.mcz.imagecapture.VerbatimClassifyDialog.java

protected void init() {
    setTitle("Interpret verbatim data into fields.");
    setBounds(100, 100, 1203, 899);/*w w  w  . ja va 2s.  c o  m*/
    getContentPane().setLayout(new BorderLayout());
    contentPanel.setBorder(new EmptyBorder(5, 5, 5, 5));
    getContentPane().add(contentPanel, BorderLayout.CENTER);
    contentPanel.setLayout(new BoxLayout(contentPanel, BoxLayout.Y_AXIS));
    {
        JPanel panelVerbatimValues = new JPanel();
        contentPanel.add(panelVerbatimValues);
        GridBagLayout gbl_panelVerbatimValues = new GridBagLayout();
        gbl_panelVerbatimValues.columnWidths = new int[] { 70, 0, 0, 0, 35, 0, 58, 0, 0, 0 };
        gbl_panelVerbatimValues.rowHeights = new int[] { 15, 0, 0, 0, 0, 50, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
                83, 0 };
        gbl_panelVerbatimValues.columnWeights = new double[] { 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0,
                1.0 };
        gbl_panelVerbatimValues.rowWeights = new double[] { 1.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0,
                0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1.0, Double.MIN_VALUE };
        panelVerbatimValues.setLayout(gbl_panelVerbatimValues);
        {
            lblCount = new JLabel("New label");
            GridBagConstraints gbc_lblNewLabel = new GridBagConstraints();
            gbc_lblNewLabel.gridwidth = 2;
            gbc_lblNewLabel.insets = new Insets(0, 0, 5, 5);
            gbc_lblNewLabel.anchor = GridBagConstraints.SOUTHWEST;
            gbc_lblNewLabel.gridx = 0;
            gbc_lblNewLabel.gridy = 0;
            panelVerbatimValues.add(lblCount, gbc_lblNewLabel);
        }

        JButton buttonFillFromLast = new JButton("Fill From Last");
        GridBagConstraints gbc_buttonFillFromLast = new GridBagConstraints();
        gbc_buttonFillFromLast.anchor = GridBagConstraints.SOUTH;
        gbc_buttonFillFromLast.insets = new Insets(0, 0, 5, 5);
        gbc_buttonFillFromLast.gridx = 3;
        gbc_buttonFillFromLast.gridy = 0;
        panelVerbatimValues.add(buttonFillFromLast, gbc_buttonFillFromLast);
        {
            JLabel lblNewLabel_1 = new JLabel("Field values to apply to all records.");
            GridBagConstraints gbc_lblNewLabel_1 = new GridBagConstraints();
            gbc_lblNewLabel_1.anchor = GridBagConstraints.SOUTHEAST;
            gbc_lblNewLabel_1.gridwidth = 4;
            gbc_lblNewLabel_1.insets = new Insets(0, 0, 5, 5);
            gbc_lblNewLabel_1.gridx = 4;
            gbc_lblNewLabel_1.gridy = 0;
            panelVerbatimValues.add(lblNewLabel_1, gbc_lblNewLabel_1);
        }
        {
            JLabel lblNewLabel_2 = new JLabel("Verbatim Locality");
            GridBagConstraints gbc_lblNewLabel_2 = new GridBagConstraints();
            gbc_lblNewLabel_2.anchor = GridBagConstraints.EAST;
            gbc_lblNewLabel_2.insets = new Insets(0, 0, 5, 5);
            gbc_lblNewLabel_2.gridx = 0;
            gbc_lblNewLabel_2.gridy = 1;
            panelVerbatimValues.add(lblNewLabel_2, gbc_lblNewLabel_2);
        }
        {
            textFieldVerbLocality = new JTextArea();
            textFieldVerbLocality.setEditable(false);
            textFieldVerbLocality.setRows(5);
            GridBagConstraints gbc_textField = new GridBagConstraints();
            gbc_textField.gridheight = 3;
            gbc_textField.insets = new Insets(0, 0, 5, 5);
            gbc_textField.fill = GridBagConstraints.BOTH;
            gbc_textField.gridx = 1;
            gbc_textField.gridy = 1;
            panelVerbatimValues.add(textFieldVerbLocality, gbc_textField);
            textFieldVerbLocality.setColumns(30);
        }

        JLabel lblNewLabel = new JLabel("HigherGeography");
        GridBagConstraints gbc_lblNewLabel = new GridBagConstraints();
        gbc_lblNewLabel.anchor = GridBagConstraints.EAST;
        gbc_lblNewLabel.insets = new Insets(0, 0, 5, 5);
        gbc_lblNewLabel.gridx = 3;
        gbc_lblNewLabel.gridy = 1;
        panelVerbatimValues.add(lblNewLabel, gbc_lblNewLabel);

        GridBagConstraints gbc_textFieldHigherGeography = new GridBagConstraints();
        gbc_textFieldHigherGeography.fill = GridBagConstraints.HORIZONTAL;
        gbc_textFieldHigherGeography.gridwidth = 5;
        gbc_textFieldHigherGeography.insets = new Insets(0, 0, 5, 5);
        gbc_textFieldHigherGeography.gridx = 4;
        gbc_textFieldHigherGeography.gridy = 1;
        panelVerbatimValues.add(getComboBoxHighGeog(), gbc_textFieldHigherGeography);

        JButton btnCopyLocality = new JButton(">");
        btnCopyLocality.addActionListener(new ActionListener() {
            @Override
            public void actionPerformed(ActionEvent e) {
                if (textFieldSpecificLocality.getText().isEmpty()) {
                    textFieldSpecificLocality.setText(textFieldVerbLocality.getText().replace("\n", "").trim());
                }
            }
        });
        GridBagConstraints gbc_btnCopyLocality = new GridBagConstraints();
        gbc_btnCopyLocality.insets = new Insets(0, 0, 5, 5);
        gbc_btnCopyLocality.gridx = 2;
        gbc_btnCopyLocality.gridy = 2;
        panelVerbatimValues.add(btnCopyLocality, gbc_btnCopyLocality);

        JLabel lblSpecificLocality = new JLabel("Specific Locality");
        GridBagConstraints gbc_lblSpecificLocality = new GridBagConstraints();
        gbc_lblSpecificLocality.anchor = GridBagConstraints.EAST;
        gbc_lblSpecificLocality.insets = new Insets(0, 0, 5, 5);
        gbc_lblSpecificLocality.gridx = 3;
        gbc_lblSpecificLocality.gridy = 2;
        panelVerbatimValues.add(lblSpecificLocality, gbc_lblSpecificLocality);

        JLabel lblElevation = new JLabel("Elevation");
        GridBagConstraints gbc_lblElevation = new GridBagConstraints();
        gbc_lblElevation.anchor = GridBagConstraints.EAST;
        gbc_lblElevation.insets = new Insets(0, 0, 5, 5);
        gbc_lblElevation.gridx = 3;
        gbc_lblElevation.gridy = 3;
        panelVerbatimValues.add(lblElevation, gbc_lblElevation);

        textFieldMinElevation = new JTextField();
        textFieldMinElevation.setMinimumSize(new Dimension(60, 19));
        GridBagConstraints gbc_textFieldMinElevation = new GridBagConstraints();
        gbc_textFieldMinElevation.insets = new Insets(0, 0, 5, 5);
        gbc_textFieldMinElevation.fill = GridBagConstraints.HORIZONTAL;
        gbc_textFieldMinElevation.gridx = 4;
        gbc_textFieldMinElevation.gridy = 3;
        panelVerbatimValues.add(textFieldMinElevation, gbc_textFieldMinElevation);
        textFieldMinElevation.setColumns(4);

        JLabel lblTo = new JLabel("to");
        GridBagConstraints gbc_lblTo = new GridBagConstraints();
        gbc_lblTo.anchor = GridBagConstraints.EAST;
        gbc_lblTo.insets = new Insets(0, 0, 5, 5);
        gbc_lblTo.gridx = 5;
        gbc_lblTo.gridy = 3;
        panelVerbatimValues.add(lblTo, gbc_lblTo);

        textFieldMaxElevation = new JTextField();
        textFieldMaxElevation.setMinimumSize(new Dimension(60, 19));
        GridBagConstraints gbc_textFieldMaxElevation = new GridBagConstraints();
        gbc_textFieldMaxElevation.anchor = GridBagConstraints.WEST;
        gbc_textFieldMaxElevation.insets = new Insets(0, 0, 5, 5);
        gbc_textFieldMaxElevation.gridx = 6;
        gbc_textFieldMaxElevation.gridy = 3;
        panelVerbatimValues.add(textFieldMaxElevation, gbc_textFieldMaxElevation);
        textFieldMaxElevation.setColumns(5);

        comboBoxElevUnits = new JComboBox();
        GridBagConstraints gbc_comboBoxElevUnits = new GridBagConstraints();
        gbc_comboBoxElevUnits.insets = new Insets(0, 0, 5, 5);
        gbc_comboBoxElevUnits.fill = GridBagConstraints.HORIZONTAL;
        gbc_comboBoxElevUnits.gridx = 7;
        gbc_comboBoxElevUnits.gridy = 3;
        panelVerbatimValues.add(comboBoxElevUnits, gbc_comboBoxElevUnits);
        {
            JLabel lblVerbatimdate = new JLabel("VerbatimDate");
            GridBagConstraints gbc_lblVerbatimdate = new GridBagConstraints();
            gbc_lblVerbatimdate.anchor = GridBagConstraints.EAST;
            gbc_lblVerbatimdate.insets = new Insets(0, 0, 5, 5);
            gbc_lblVerbatimdate.gridx = 0;
            gbc_lblVerbatimdate.gridy = 4;
            panelVerbatimValues.add(lblVerbatimdate, gbc_lblVerbatimdate);
        }

        textFieldVerbDate = new JTextField();
        GridBagConstraints gbc_textFieldVerbDate = new GridBagConstraints();
        gbc_textFieldVerbDate.insets = new Insets(0, 0, 5, 5);
        gbc_textFieldVerbDate.fill = GridBagConstraints.HORIZONTAL;
        gbc_textFieldVerbDate.gridx = 1;
        gbc_textFieldVerbDate.gridy = 4;
        panelVerbatimValues.add(textFieldVerbDate, gbc_textFieldVerbDate);
        textFieldVerbDate.setColumns(30);

        JButton btnCopyDate = new JButton(">");
        btnCopyDate.addActionListener(new ActionListener() {
            @Override
            public void actionPerformed(ActionEvent e) {
                if (textFieldISODate.getText().isEmpty()) {
                    Map<String, String> extractResult = DateUtils
                            .extractDateFromVerbatim(textFieldVerbDate.getText().trim());
                    if (extractResult.containsKey("result")) {
                        textFieldISODate.setText(extractResult.get("result"));
                    }
                    if (extractResult.containsKey("resultState")) {
                        // TODO: Report suspect etc
                    }
                }
            }
        });
        GridBagConstraints gbc_btnCopyDate = new GridBagConstraints();
        gbc_btnCopyDate.insets = new Insets(0, 0, 5, 5);
        gbc_btnCopyDate.gridx = 2;
        gbc_btnCopyDate.gridy = 4;
        panelVerbatimValues.add(btnCopyDate, gbc_btnCopyDate);

        JLabel lblNewLabel_3 = new JLabel("ISO Date");
        GridBagConstraints gbc_lblNewLabel_3 = new GridBagConstraints();
        gbc_lblNewLabel_3.anchor = GridBagConstraints.EAST;
        gbc_lblNewLabel_3.insets = new Insets(0, 0, 5, 5);
        gbc_lblNewLabel_3.gridx = 3;
        gbc_lblNewLabel_3.gridy = 4;
        panelVerbatimValues.add(lblNewLabel_3, gbc_lblNewLabel_3);

        textFieldISODate = new JTextField();
        textFieldISODate.setInputVerifier(
                MetadataRetriever.getInputVerifier(Specimen.class, "ISODate", textFieldISODate));
        textFieldISODate.setToolTipText(MetadataRetriever.getFieldHelp(Specimen.class, "ISODate"));
        GridBagConstraints gbc_textFieldISODate = new GridBagConstraints();
        gbc_textFieldISODate.fill = GridBagConstraints.HORIZONTAL;
        gbc_textFieldISODate.gridwidth = 5;
        gbc_textFieldISODate.insets = new Insets(0, 0, 5, 5);
        gbc_textFieldISODate.gridx = 4;
        gbc_textFieldISODate.gridy = 4;
        panelVerbatimValues.add(textFieldISODate, gbc_textFieldISODate);
        textFieldISODate.setColumns(10);

        textFieldSpecificLocality = new JTextField();
        GridBagConstraints gbc_textFieldSpecificLocality = new GridBagConstraints();
        gbc_textFieldSpecificLocality.gridwidth = 5;
        gbc_textFieldSpecificLocality.fill = GridBagConstraints.HORIZONTAL;
        gbc_textFieldSpecificLocality.insets = new Insets(0, 0, 5, 5);
        gbc_textFieldSpecificLocality.gridx = 4;
        gbc_textFieldSpecificLocality.gridy = 2;
        panelVerbatimValues.add(textFieldSpecificLocality, gbc_textFieldSpecificLocality);
        textFieldSpecificLocality.setColumns(25);
        {
            JLabel lblVerbatimCollector = new JLabel("Verbatim Collector");
            GridBagConstraints gbc_lblVerbatimCollector = new GridBagConstraints();
            gbc_lblVerbatimCollector.anchor = GridBagConstraints.EAST;
            gbc_lblVerbatimCollector.insets = new Insets(0, 0, 5, 5);
            gbc_lblVerbatimCollector.gridx = 0;
            gbc_lblVerbatimCollector.gridy = 6;
            panelVerbatimValues.add(lblVerbatimCollector, gbc_lblVerbatimCollector);
        }

        textFieldVerbCollector = new JTextArea();
        textFieldVerbCollector.setEditable(false);
        textFieldVerbCollector.setRows(3);
        GridBagConstraints gbc_textFieldVerbCollector = new GridBagConstraints();
        gbc_textFieldVerbCollector.gridheight = 2;
        gbc_textFieldVerbCollector.insets = new Insets(0, 0, 5, 5);
        gbc_textFieldVerbCollector.fill = GridBagConstraints.BOTH;
        gbc_textFieldVerbCollector.gridx = 1;
        gbc_textFieldVerbCollector.gridy = 6;
        panelVerbatimValues.add(textFieldVerbCollector, gbc_textFieldVerbCollector);
        textFieldVerbCollector.setColumns(30);

        JLabel lblCollectors = new JLabel("Collector(s)");
        GridBagConstraints gbc_lblCollectors = new GridBagConstraints();
        gbc_lblCollectors.anchor = GridBagConstraints.EAST;
        gbc_lblCollectors.insets = new Insets(0, 0, 5, 5);
        gbc_lblCollectors.gridx = 3;
        gbc_lblCollectors.gridy = 6;
        panelVerbatimValues.add(lblCollectors, gbc_lblCollectors);

        JButton btnAddCollector = new JButton("+");
        btnAddCollector.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent e) {
                ((CollectorTableModel) jTableCollectors.getModel()).addCollector(new Collector(null, ""));
            }
        });
        GridBagConstraints gbc_btnAddCollector = new GridBagConstraints();
        gbc_btnAddCollector.anchor = GridBagConstraints.EAST;
        gbc_btnAddCollector.insets = new Insets(0, 0, 5, 5);
        gbc_btnAddCollector.gridx = 3;
        gbc_btnAddCollector.gridy = 7;
        panelVerbatimValues.add(btnAddCollector, gbc_btnAddCollector);

        GridBagConstraints gbc_collectorTable = new GridBagConstraints();
        gbc_collectorTable.insets = new Insets(0, 0, 5, 5);
        gbc_collectorTable.fill = GridBagConstraints.BOTH;
        gbc_collectorTable.gridx = 4;
        gbc_collectorTable.gridy = 6;
        gbc_collectorTable.gridheight = 2;
        gbc_collectorTable.gridwidth = 5;
        panelVerbatimValues.add(getJScrollPaneCollectors(), gbc_collectorTable);

        JLabel lblVerbatimCollection = new JLabel("Verbatim Collection");
        GridBagConstraints gbc_lblVerbatimCollection = new GridBagConstraints();
        gbc_lblVerbatimCollection.anchor = GridBagConstraints.EAST;
        gbc_lblVerbatimCollection.insets = new Insets(0, 0, 5, 5);
        gbc_lblVerbatimCollection.gridx = 0;
        gbc_lblVerbatimCollection.gridy = 8;
        panelVerbatimValues.add(lblVerbatimCollection, gbc_lblVerbatimCollection);

        textFieldVerbCollection = new JTextArea();
        textFieldVerbCollection.setEditable(false);
        textFieldVerbCollection.setRows(3);
        GridBagConstraints gbc_textFieldVerbCollection = new GridBagConstraints();
        gbc_textFieldVerbCollection.gridheight = 2;
        gbc_textFieldVerbCollection.insets = new Insets(0, 0, 5, 5);
        gbc_textFieldVerbCollection.fill = GridBagConstraints.BOTH;
        gbc_textFieldVerbCollection.gridx = 1;
        gbc_textFieldVerbCollection.gridy = 8;
        panelVerbatimValues.add(textFieldVerbCollection, gbc_textFieldVerbCollection);
        textFieldVerbCollection.setColumns(30);

        JLabel lblCollection = new JLabel("Collection");
        GridBagConstraints gbc_lblCollection = new GridBagConstraints();
        gbc_lblCollection.anchor = GridBagConstraints.EAST;
        gbc_lblCollection.insets = new Insets(0, 0, 5, 5);
        gbc_lblCollection.gridx = 3;
        gbc_lblCollection.gridy = 8;
        panelVerbatimValues.add(lblCollection, gbc_lblCollection);

        GridBagConstraints gbc_textFieldCollection = new GridBagConstraints();
        gbc_textFieldCollection.fill = GridBagConstraints.HORIZONTAL;
        gbc_textFieldCollection.gridwidth = 5;
        gbc_textFieldCollection.insets = new Insets(0, 0, 5, 5);
        gbc_textFieldCollection.gridx = 4;
        gbc_textFieldCollection.gridy = 8;
        panelVerbatimValues.add(getJComboBoxCollection(), gbc_textFieldCollection);

        JLabel lblVerbatimNumbers = new JLabel("Verbatim Numbers");
        GridBagConstraints gbc_lblVerbatimNumbers = new GridBagConstraints();
        gbc_lblVerbatimNumbers.anchor = GridBagConstraints.EAST;
        gbc_lblVerbatimNumbers.insets = new Insets(0, 0, 5, 5);
        gbc_lblVerbatimNumbers.gridx = 0;
        gbc_lblVerbatimNumbers.gridy = 10;
        panelVerbatimValues.add(lblVerbatimNumbers, gbc_lblVerbatimNumbers);

        textFieldVerbNumbers = new JTextArea();
        textFieldVerbNumbers.setRows(3);
        textFieldVerbNumbers.setEditable(false);
        GridBagConstraints gbc_textFieldVerbNumbers = new GridBagConstraints();
        gbc_textFieldVerbNumbers.gridheight = 2;
        gbc_textFieldVerbNumbers.insets = new Insets(0, 0, 5, 5);
        gbc_textFieldVerbNumbers.fill = GridBagConstraints.BOTH;
        gbc_textFieldVerbNumbers.gridx = 1;
        gbc_textFieldVerbNumbers.gridy = 10;
        panelVerbatimValues.add(textFieldVerbNumbers, gbc_textFieldVerbNumbers);
        textFieldVerbNumbers.setColumns(30);

        JLabel lblNumbers = new JLabel("Numbers");
        GridBagConstraints gbc_lblNumbers = new GridBagConstraints();
        gbc_lblNumbers.anchor = GridBagConstraints.EAST;
        gbc_lblNumbers.insets = new Insets(0, 0, 5, 5);
        gbc_lblNumbers.gridx = 3;
        gbc_lblNumbers.gridy = 10;
        panelVerbatimValues.add(lblNumbers, gbc_lblNumbers);

        JButton btnAddNumber = new JButton("+");
        btnAddNumber.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent e) {
                ((NumberTableModel) jTableNumbers.getModel())
                        .addNumber(new edu.harvard.mcz.imagecapture.data.Number(null, "", ""));
            }
        });
        GridBagConstraints gbc_btnAddNumber = new GridBagConstraints();
        gbc_btnAddNumber.anchor = GridBagConstraints.EAST;
        gbc_btnAddNumber.insets = new Insets(0, 0, 5, 5);
        gbc_btnAddNumber.gridx = 3;
        gbc_btnAddNumber.gridy = 11;
        panelVerbatimValues.add(btnAddNumber, gbc_btnAddNumber);

        GridBagConstraints gbc_numberTable = new GridBagConstraints();
        gbc_numberTable.insets = new Insets(0, 0, 5, 5);
        gbc_numberTable.fill = GridBagConstraints.BOTH;
        gbc_numberTable.gridx = 4;
        gbc_numberTable.gridy = 10;
        gbc_numberTable.gridheight = 2;
        gbc_numberTable.gridwidth = 5;
        panelVerbatimValues.add(this.getJScrollPaneNumbers(), gbc_numberTable);

        JLabel lblVerbatimOtherText = new JLabel("Verbatim Other Text");
        GridBagConstraints gbc_lblVerbatimOtherText = new GridBagConstraints();
        gbc_lblVerbatimOtherText.anchor = GridBagConstraints.EAST;
        gbc_lblVerbatimOtherText.insets = new Insets(0, 0, 5, 5);
        gbc_lblVerbatimOtherText.gridx = 0;
        gbc_lblVerbatimOtherText.gridy = 12;
        panelVerbatimValues.add(lblVerbatimOtherText, gbc_lblVerbatimOtherText);

        textFieldVerbUnclassifiedText = new JTextArea();
        textFieldVerbUnclassifiedText.setEditable(false);
        textFieldVerbUnclassifiedText.setRows(5);
        GridBagConstraints gbc_textFieldVerbUnclassifiedText = new GridBagConstraints();
        gbc_textFieldVerbUnclassifiedText.gridheight = 3;
        gbc_textFieldVerbUnclassifiedText.insets = new Insets(0, 0, 5, 5);
        gbc_textFieldVerbUnclassifiedText.fill = GridBagConstraints.BOTH;
        gbc_textFieldVerbUnclassifiedText.gridx = 1;
        gbc_textFieldVerbUnclassifiedText.gridy = 12;
        panelVerbatimValues.add(textFieldVerbUnclassifiedText, gbc_textFieldVerbUnclassifiedText);
        textFieldVerbUnclassifiedText.setColumns(30);

        JLabel lblHabitat = new JLabel("Habitat");
        GridBagConstraints gbc_lblHabitat = new GridBagConstraints();
        gbc_lblHabitat.anchor = GridBagConstraints.EAST;
        gbc_lblHabitat.insets = new Insets(0, 0, 5, 5);
        gbc_lblHabitat.gridx = 3;
        gbc_lblHabitat.gridy = 12;
        panelVerbatimValues.add(lblHabitat, gbc_lblHabitat);

        textFieldHabitat = new JTextField();
        GridBagConstraints gbc_textFieldHabitat = new GridBagConstraints();
        gbc_textFieldHabitat.fill = GridBagConstraints.HORIZONTAL;
        gbc_textFieldHabitat.gridwidth = 4;
        gbc_textFieldHabitat.insets = new Insets(0, 0, 5, 5);
        gbc_textFieldHabitat.gridx = 4;
        gbc_textFieldHabitat.gridy = 12;
        panelVerbatimValues.add(textFieldHabitat, gbc_textFieldHabitat);
        textFieldHabitat.setColumns(10);

        JLabel lblMicrohabitat = new JLabel("Microhabitat");
        GridBagConstraints gbc_lblMicrohabitat = new GridBagConstraints();
        gbc_lblMicrohabitat.anchor = GridBagConstraints.EAST;
        gbc_lblMicrohabitat.insets = new Insets(0, 0, 5, 5);
        gbc_lblMicrohabitat.gridx = 3;
        gbc_lblMicrohabitat.gridy = 13;
        panelVerbatimValues.add(lblMicrohabitat, gbc_lblMicrohabitat);

        textFieldMicrohabitat = new JTextField();
        GridBagConstraints gbc_textFieldMicrohabitat = new GridBagConstraints();
        gbc_textFieldMicrohabitat.fill = GridBagConstraints.HORIZONTAL;
        gbc_textFieldMicrohabitat.gridwidth = 4;
        gbc_textFieldMicrohabitat.insets = new Insets(0, 0, 5, 5);
        gbc_textFieldMicrohabitat.gridx = 4;
        gbc_textFieldMicrohabitat.gridy = 13;
        panelVerbatimValues.add(textFieldMicrohabitat, gbc_textFieldMicrohabitat);
        textFieldMicrohabitat.setColumns(10);

        JLabel lblNewLabel_4 = new JLabel("Workflow Status");
        GridBagConstraints gbc_lblNewLabel_4 = new GridBagConstraints();
        gbc_lblNewLabel_4.insets = new Insets(0, 0, 5, 5);
        gbc_lblNewLabel_4.gridx = 3;
        gbc_lblNewLabel_4.gridy = 15;
        panelVerbatimValues.add(lblNewLabel_4, gbc_lblNewLabel_4);

        comboBoxWorkflowStatus = new JComboBox(WorkFlowStatus.getVerbatimClassifiedWorkFlowStatusValues());
        comboBoxWorkflowStatus.setSelectedItem(WorkFlowStatus.STAGE_CLASSIFIED);
        GridBagConstraints gbc_comboBoxWorkflowStatus = new GridBagConstraints();
        gbc_comboBoxWorkflowStatus.gridwidth = 4;
        gbc_comboBoxWorkflowStatus.fill = GridBagConstraints.HORIZONTAL;
        gbc_comboBoxWorkflowStatus.insets = new Insets(0, 0, 5, 5);
        gbc_comboBoxWorkflowStatus.gridx = 4;
        gbc_comboBoxWorkflowStatus.gridy = 15;
        panelVerbatimValues.add(comboBoxWorkflowStatus, gbc_comboBoxWorkflowStatus);

        JButton btnApplyToAll = new JButton("Apply To All Records");
        GridBagConstraints gbc_btnApplyToAll = new GridBagConstraints();
        gbc_btnApplyToAll.gridwidth = 4;
        gbc_btnApplyToAll.insets = new Insets(0, 0, 5, 5);
        gbc_btnApplyToAll.gridx = 4;
        gbc_btnApplyToAll.gridy = 16;
        panelVerbatimValues.add(btnApplyToAll, gbc_btnApplyToAll);
        btnApplyToAll.addActionListener(new ActionListener() {
            @Override
            public void actionPerformed(ActionEvent e) {
                saveChanges();
            }
        });
    }
    {
        JPanel panelRelatedData = new JPanel();
        contentPanel.add(panelRelatedData);
        GridBagLayout gbl_panelRelatedData = new GridBagLayout();
        gbl_panelRelatedData.maximumLayoutSize(panelRelatedData);
        gbl_panelRelatedData.columnWidths = new int[] { 20, 33, 1, 0 };
        gbl_panelRelatedData.rowHeights = new int[] { 25, 0 };
        gbl_panelRelatedData.columnWeights = new double[] { 0.0, 1.0, 0.0, Double.MIN_VALUE };
        gbl_panelRelatedData.rowWeights = new double[] { 1.0, Double.MIN_VALUE };
        panelRelatedData.setLayout(gbl_panelRelatedData);
        {
            JLabel lblTaxa = new JLabel("Taxa");
            GridBagConstraints gbc_lblTaxa = new GridBagConstraints();
            gbc_lblTaxa.anchor = GridBagConstraints.NORTHEAST;
            gbc_lblTaxa.insets = new Insets(0, 0, 0, 5);
            gbc_lblTaxa.gridx = 0;
            gbc_lblTaxa.gridy = 0;
            panelRelatedData.add(lblTaxa, gbc_lblTaxa);
        }

        JScrollPane scrollPane = new JScrollPane();
        // scrollPane.setPreferredSize(new Dimension(1000,100));
        GridBagConstraints gbc_scrollPane = new GridBagConstraints();
        gbc_scrollPane.anchor = GridBagConstraints.NORTH;
        gbc_scrollPane.insets = new Insets(0, 0, 0, 5);
        gbc_scrollPane.fill = GridBagConstraints.BOTH;
        gbc_scrollPane.gridx = 1;
        gbc_scrollPane.gridy = 0;
        panelRelatedData.add(scrollPane, gbc_scrollPane);

        tableTaxa = new JTable();
        SpecimenLifeCycle sls = new SpecimenLifeCycle();
        tableTaxa.setModel(new CountValueTableModel(sls.findTaxaFromVerbatim(this.verbatimData),
                "Current Idenfifications for these verbatim values."));
        scrollPane.setViewportView(tableTaxa);
    }
    {
        JPanel buttonPane = new JPanel();
        buttonPane.setLayout(new FlowLayout(FlowLayout.RIGHT));
        getContentPane().add(buttonPane, BorderLayout.SOUTH);
        {
            JButton cancelButton = new JButton("Close");
            cancelButton.setActionCommand("Close");
            cancelButton.addActionListener(new ActionListener() {
                @Override
                public void actionPerformed(ActionEvent e) {
                    setVisible(false);
                }
            });
            buttonPane.add(cancelButton);
        }
    }
}

From source file:net.java.sip.communicator.impl.gui.main.chat.ChatWritePanel.java

/**
 *
 * @param isVisible//from ww w. jav a2  s.  com
 */
public void setTransportSelectorBoxVisible(boolean isVisible) {
    if (isVisible) {
        if (transportSelectorBox == null) {
            createChatTransportSelectorBox();

            if (!transportSelectorBox.getMenu().isEnabled()) {
                // Show a message to the user that IM is not possible.
                chatPanel.getChatConversationPanel()
                        .appendMessageToEnd(
                                "<h5>" + StringEscapeUtils.escapeHtml4(GuiActivator.getResources()
                                        .getI18NString("service.gui.MSG_NOT_POSSIBLE")) + "</h5>",
                                ChatHtmlUtils.HTML_CONTENT_TYPE);
            } else {
                GridBagConstraints constraints = new GridBagConstraints();
                constraints.anchor = GridBagConstraints.NORTHEAST;
                constraints.fill = GridBagConstraints.NONE;
                constraints.gridx = 0;
                constraints.gridy = 0;
                constraints.weightx = 0f;
                constraints.weighty = 0f;
                constraints.gridheight = 1;
                constraints.gridwidth = 1;

                centerPanel.add(transportSelectorBox, constraints, 0);
            }
        } else {
            if (ConfigurationUtils.isHideAccountSelectionWhenPossibleEnabled()
                    && transportSelectorBox.getMenu().getItemCount() <= 1) {
                transportSelectorBox.setVisible(false);
            }
            {
                transportSelectorBox.setVisible(true);
            }
            centerPanel.repaint();
        }
    } else if (transportSelectorBox != null) {
        transportSelectorBox.setVisible(false);
        centerPanel.repaint();
    }
}

From source file:net.sf.jabref.gui.FindUnlinkedFilesDialog.java

/**
 * Initializes the layout for the visible components in this menu. A
 * {@link GridBagLayout} is used.// w ww.j  av a2 s .com
 */
private void initLayout() {

    GridBagLayout gbl = new GridBagLayout();

    panelDirectory.setBorder(BorderFactory.createTitledBorder(BorderFactory.createEtchedBorder(),
            Localization.lang("Select directory")));
    panelFiles.setBorder(BorderFactory.createTitledBorder(BorderFactory.createEtchedBorder(),
            Localization.lang("Select files")));
    panelEntryTypesSelection.setBorder(BorderFactory.createTitledBorder(BorderFactory.createEtchedBorder(),
            Localization.lang("BibTeX entry creation")));

    Insets basicInsets = new Insets(6, 6, 6, 6);
    Insets smallInsets = new Insets(3, 2, 3, 1);
    Insets noInsets = new Insets(0, 0, 0, 0);

    //       x, y, w, h, wx,wy,ix,iy
    FindUnlinkedFilesDialog.addComponent(gbl, panelSearchArea, buttonScan, GridBagConstraints.HORIZONTAL,
            GridBagConstraints.EAST, noInsets, 0, 1, 1, 1, 1, 1, 40, 10);
    FindUnlinkedFilesDialog.addComponent(gbl, panelSearchArea, labelSearchingDirectoryInfo,
            GridBagConstraints.HORIZONTAL, GridBagConstraints.EAST, noInsets, 0, 2, 1, 1, 0, 0, 0, 0);
    FindUnlinkedFilesDialog.addComponent(gbl, panelSearchArea, progressBarSearching,
            GridBagConstraints.HORIZONTAL, GridBagConstraints.EAST, noInsets, 0, 3, 1, 1, 0, 0, 0, 0);

    FindUnlinkedFilesDialog.addComponent(gbl, panelDirectory, labelDirectoryDescription, null,
            GridBagConstraints.WEST, new Insets(6, 6, 0, 6), 0, 0, 3, 1, 0, 0, 0, 0);
    FindUnlinkedFilesDialog.addComponent(gbl, panelDirectory, textfieldDirectoryPath,
            GridBagConstraints.HORIZONTAL, null, basicInsets, 0, 1, 2, 1, 1, 1, 0, 0);
    FindUnlinkedFilesDialog.addComponent(gbl, panelDirectory, buttonBrowse, GridBagConstraints.HORIZONTAL,
            GridBagConstraints.EAST, basicInsets, 2, 1, 1, 1, 0, 0, 0, 0);
    FindUnlinkedFilesDialog.addComponent(gbl, panelDirectory, labelFileTypesDescription,
            GridBagConstraints.NONE, GridBagConstraints.WEST, new Insets(18, 6, 18, 3), 0, 3, 1, 1, 0, 0, 0, 0);
    FindUnlinkedFilesDialog.addComponent(gbl, panelDirectory, comboBoxFileTypeSelection,
            GridBagConstraints.HORIZONTAL, GridBagConstraints.WEST, new Insets(18, 3, 18, 6), 1, 3, 1, 1, 1, 0,
            0, 0);
    FindUnlinkedFilesDialog.addComponent(gbl, panelDirectory, panelSearchArea, GridBagConstraints.HORIZONTAL,
            GridBagConstraints.EAST, new Insets(18, 6, 18, 6), 2, 3, 1, 1, 0, 0, 0, 0);

    FindUnlinkedFilesDialog.addComponent(gbl, panelFiles, labelFilesDescription, GridBagConstraints.HORIZONTAL,
            GridBagConstraints.WEST, new Insets(6, 6, 0, 6), 0, 0, 1, 1, 0, 0, 0, 0);
    FindUnlinkedFilesDialog.addComponent(gbl, panelFiles, scrollpaneTree, GridBagConstraints.BOTH,
            GridBagConstraints.CENTER, basicInsets, 0, 1, 1, 1, 1, 1, 0, 0);
    FindUnlinkedFilesDialog.addComponent(gbl, panelFiles, panelOptions, GridBagConstraints.NONE,
            GridBagConstraints.NORTHEAST, basicInsets, 1, 1, 1, 1, 0, 0, 0, 0);
    FindUnlinkedFilesDialog.addComponent(gbl, panelOptions, buttonOptionSelectAll,
            GridBagConstraints.HORIZONTAL, GridBagConstraints.NORTH, noInsets, 0, 0, 1, 1, 1, 0, 0, 0);
    FindUnlinkedFilesDialog.addComponent(gbl, panelOptions, buttonOptionUnselectAll,
            GridBagConstraints.HORIZONTAL, GridBagConstraints.NORTH, noInsets, 0, 1, 1, 1, 0, 0, 0, 0);
    FindUnlinkedFilesDialog.addComponent(gbl, panelOptions, buttonOptionExpandAll,
            GridBagConstraints.HORIZONTAL, GridBagConstraints.NORTH, new Insets(6, 0, 0, 0), 0, 2, 1, 1, 0, 0,
            0, 0);
    FindUnlinkedFilesDialog.addComponent(gbl, panelOptions, buttonOptionCollapseAll,
            GridBagConstraints.HORIZONTAL, GridBagConstraints.NORTH, noInsets, 0, 3, 1, 1, 0, 0, 0, 0);

    FindUnlinkedFilesDialog.addComponent(gbl, panelEntryTypesSelection, labelEntryTypeDescription,
            GridBagConstraints.NONE, GridBagConstraints.WEST, basicInsets, 0, 0, 1, 1, 0, 0, 0, 0);
    FindUnlinkedFilesDialog.addComponent(gbl, panelEntryTypesSelection, comboBoxEntryTypeSelection,
            GridBagConstraints.NONE, GridBagConstraints.WEST, basicInsets, 1, 0, 1, 1, 1, 0, 0, 0);
    FindUnlinkedFilesDialog.addComponent(gbl, panelEntryTypesSelection, checkboxCreateKeywords,
            GridBagConstraints.HORIZONTAL, GridBagConstraints.WEST, basicInsets, 0, 1, 2, 1, 0, 0, 0, 0);
    FindUnlinkedFilesDialog.addComponent(gbl, panelImportArea, labelImportingInfo,
            GridBagConstraints.HORIZONTAL, GridBagConstraints.CENTER, new Insets(6, 6, 0, 6), 0, 1, 1, 1, 1, 0,
            0, 0);
    FindUnlinkedFilesDialog.addComponent(gbl, panelImportArea, progressBarImporting,
            GridBagConstraints.HORIZONTAL, GridBagConstraints.CENTER, new Insets(0, 6, 6, 6), 0, 2, 1, 1, 1, 0,
            0, 0);
    FindUnlinkedFilesDialog.addComponent(gbl, panelButtons, panelImportArea, GridBagConstraints.NONE,
            GridBagConstraints.EAST, smallInsets, 1, 0, 1, 1, 0, 0, 0, 0);

    FindUnlinkedFilesDialog.addComponent(gbl, getContentPane(), panelDirectory, GridBagConstraints.HORIZONTAL,
            GridBagConstraints.CENTER, basicInsets, 0, 0, 1, 1, 0, 0, 0, 0);
    FindUnlinkedFilesDialog.addComponent(gbl, getContentPane(), panelFiles, GridBagConstraints.BOTH,
            GridBagConstraints.NORTHWEST, new Insets(12, 6, 2, 2), 0, 1, 1, 1, 1, 1, 0, 0);
    FindUnlinkedFilesDialog.addComponent(gbl, getContentPane(), panelEntryTypesSelection,
            GridBagConstraints.HORIZONTAL, GridBagConstraints.SOUTHWEST, new Insets(12, 6, 2, 2), 0, 2, 1, 1, 0,
            0, 0, 0);
    FindUnlinkedFilesDialog.addComponent(gbl, getContentPane(), panelButtons, GridBagConstraints.HORIZONTAL,
            GridBagConstraints.CENTER, new Insets(10, 6, 10, 6), 0, 3, 1, 1, 0, 0, 0, 0);

    ButtonBarBuilder bb = new ButtonBarBuilder();
    bb.addGlue();
    bb.addButton(buttonApply);
    bb.addButton(buttonClose);
    bb.addGlue();

    bb.getPanel().setBorder(BorderFactory.createEmptyBorder(5, 5, 5, 5));
    panelImportArea.add(bb.getPanel(), GridBagConstraints.NONE);
    pack();

}

From source file:lejos.pc.charting.LogChartFrame.java

/** All the setup of components, etc. What's scary is Swing is a "lightweight" GUI framework...
 * @throws Exception/* www. j  a v  a 2  s .c  o  m*/
 */
private void jbInit() throws Exception {
    this.setJMenuBar(menuBar);
    this.setSize(new Dimension(819, 613));
    this.setMinimumSize(new Dimension(819, 613));
    this.setTitle("NXT Charting Logger");
    this.setEnabled(true);
    // enforce minimum window size
    this.addComponentListener(new ComponentAdapter() {
        @Override
        public void componentResized(ComponentEvent e) {
            JFrame theFrame = (JFrame) e.getSource();
            Dimension d1 = theFrame.getMinimumSize();
            Dimension d2 = theFrame.getSize();
            boolean enforce = false;
            if (theFrame.getWidth() < d1.getWidth()) {
                d2.setSize(d1.getWidth(), d2.getHeight());
                enforce = true;
            }
            if (theFrame.getHeight() < d1.getHeight()) {
                d2.setSize(d2.getWidth(), d1.getHeight());
                enforce = true;
            }
            if (enforce)
                theFrame.setSize(d2);
        }
    });

    this.getContentPane().setLayout(gridBagLayout1);
    MenuActionListener menuItemActionListener = new MenuActionListener();
    MenuEventListener menuListener = new MenuEventListener();

    menu = new JMenu("Edit");
    menu.setMnemonic(KeyEvent.VK_E);
    menuBar.add(menu);
    menuItem = new JMenuItem("Copy Chart Image", KeyEvent.VK_I);
    menuItem.addActionListener(menuItemActionListener);
    menu.add(menuItem);
    menuItem = new JMenuItem("Copy Data Log", KeyEvent.VK_D);
    menuItem.addActionListener(menuItemActionListener);
    menu.add(menuItem);

    menu = new JMenu("View");
    menu.setMnemonic(KeyEvent.VK_V);
    menu.setActionCommand("VIEW_MENU");
    menu.addMenuListener(menuListener);
    menuBar.add(menu);
    menuItem = new JMenuItem("Expand Chart", KeyEvent.VK_F);
    menuItem.addActionListener(menuItemActionListener);
    menu.add(menuItem);
    menuItem = new JMenuItem("Chart in New Window", KeyEvent.VK_N);
    menuItem.addActionListener(menuItemActionListener);
    menu.add(menuItem);

    menu = new JMenu("Help");
    menu.setMnemonic(KeyEvent.VK_H);
    menuBar.add(menu);
    menuItem = new JMenuItem("Chart controls", KeyEvent.VK_C);
    menuItem.addActionListener(menuItemActionListener);
    menu.add(menuItem);
    menuItem = new JMenuItem("Generate sample data", KeyEvent.VK_G);
    menuItem.addActionListener(menuItemActionListener);
    menu.add(menuItem);
    menuItem = new JMenuItem("About", KeyEvent.VK_A);
    menuItem.addActionListener(menuItemActionListener);
    jTabbedPane1.setPreferredSize(new Dimension(621, 199));
    jTabbedPane1.setMinimumSize(new Dimension(621, 199));
    menu.add(menuItem);

    jButtonConnect.setText("Connect");
    jButtonConnect.setBounds(new Rectangle(25, 65, 115, 25));
    jButtonConnect.setToolTipText("Connect/disconnect toggle");
    jButtonConnect.setMnemonic('C');
    jButtonConnect.setSelected(true);
    jButtonConnect.addActionListener(new ActionListener() {
        public void actionPerformed(ActionEvent e) {
            jButtonConnect_actionPerformed(e);
        }
    });
    UIPanel.setSize(new Dimension(820, 200));
    UIPanel.setLayout(null);
    UIPanel.setPreferredSize(new Dimension(300, 200));
    UIPanel.setMinimumSize(new Dimension(300, 200));
    UIPanel.setBounds(new Rectangle(0, 350, 820, 200));
    UIPanel.setMaximumSize(new Dimension(300, 32767));
    connectionPanel.setBounds(new Rectangle(10, 10, 175, 100));
    connectionPanel.setBorder(BorderFactory.createTitledBorder("Connection"));
    connectionPanel.setLayout(null);
    connectionPanel.setFont(new Font("Tahoma", 0, 11));

    jLabel1logfilename.setText("Log File:");
    jLabel1logfilename.setBounds(new Rectangle(10, 125, 165, 20));
    jLabel1logfilename.setHorizontalTextPosition(SwingConstants.RIGHT);
    jLabel1logfilename.setHorizontalAlignment(SwingConstants.LEFT);
    jLabel1logfilename.setToolTipText("Specify the name of your log file here");

    jTextFieldNXTName.setBounds(new Rectangle(5, 40, 165, 20));
    jTextFieldNXTName.setToolTipText(
            "The name or Address of the NXT. Leave empty and the first one found will be used.");

    jTextFieldNXTName.requestFocus();

    jTextAreaStatus.setLineWrap(true);
    jTextAreaStatus.setFont(new Font("Tahoma", 0, 11));
    jTextAreaStatus.setWrapStyleWord(true);
    jTextAreaStatus.setBackground(SystemColor.window);

    dataLogTextArea.setLineWrap(false);
    dataLogTextArea.setFont(new Font("Tahoma", 0, 11));
    dataLogTextArea.setBackground(SystemColor.window);

    FQPathTextArea.setBounds(new Rectangle(5, 170, 185, 40));
    FQPathTextArea.setLineWrap(true);
    FQPathTextArea.setText(getCanonicalName(new File(".", "")));
    FQPathTextArea.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0));
    FQPathTextArea.setRows(2);

    FQPathTextArea.setFont(new Font("Tahoma", 0, 9));
    FQPathTextArea.setOpaque(false);
    FQPathTextArea.setEditable(false);

    selectFolderButton.setText("Folder...");
    selectFolderButton.setBounds(new Rectangle(120, 125, 70, 20));
    selectFolderButton.setMargin(new Insets(1, 1, 1, 1));
    selectFolderButton.setFocusable(false);
    selectFolderButton.setMnemonic('F');
    selectFolderButton.addActionListener(new ActionListener() {
        public void actionPerformed(ActionEvent e) {
            selectFolderButton_actionPerformed(e);
        }
    });

    // domain display limits GUI
    chartOptionsPanel.setLayout(null);
    chartDomLimitsPanel.setBounds(new Rectangle(5, 35, 180, 135));
    chartDomLimitsPanel.setLayout(gridLayout1);
    chartDomLimitsPanel.setBorder(BorderFactory.createTitledBorder("Domain Display Limiting"));
    domainDisplayLimitSlider.setEnabled(false);
    domainDisplayLimitSlider.setMaximum(MAXDOMAIN_DATAPOINT_LIMIT);
    domainDisplayLimitSlider.setMinimum(MINDOMAIN_LIMIT);
    domainDisplayLimitSlider.setValue(MAXDOMAIN_DATAPOINT_LIMIT);
    domainDisplayLimitSlider.addChangeListener(new ChangeListener() {
        public void stateChanged(ChangeEvent e) {
            domainDisplayLimitSlider_stateChanged(e);
        }
    });
    useTimeRadioButton.setText("By Time");
    useTimeRadioButton.setEnabled(false);
    useTimeRadioButton.setMnemonic('I');
    useTimeRadioButton.addActionListener(new ActionListener() {
        public void actionPerformed(ActionEvent e) {
            domainDisplayLimitRadioButton_actionPerformed(e);
        }
    });
    useDataPointsRadioButton.setText("By Data Points");
    ButtonGroup bg1 = new ButtonGroup();
    bg1.add(useTimeRadioButton);
    bg1.add(useDataPointsRadioButton);
    useDataPointsRadioButton.setSelected(true);
    useDataPointsRadioButton.setEnabled(false);
    useDataPointsRadioButton.setMnemonic('P');
    useDataPointsRadioButton.addActionListener(new ActionListener() {
        public void actionPerformed(ActionEvent e) {
            domainDisplayLimitRadioButton_actionPerformed(e);
        }
    });
    datasetLimitEnableCheckBox.setText("Enable");
    datasetLimitEnableCheckBox.setRolloverEnabled(true);
    datasetLimitEnableCheckBox.setMnemonic('A');
    datasetLimitEnableCheckBox.setToolTipText("Enable Domain Clipping");
    datasetLimitEnableCheckBox.addActionListener(new ActionListener() {
        public void actionPerformed(ActionEvent e) {
            datasetLimitEnableCheckBox_actionPerformed(e);
        }
    });
    domainLimitLabel.setText(String.format("%1$,d datapoints", MAXDOMAIN_DATAPOINT_LIMIT).toString());
    domainLimitLabel.setEnabled(false);
    gridLayout1.setRows(5);
    gridLayout1.setColumns(1);

    jLabel1.setText("Chart Title:");
    jLabel1.setBounds(new Rectangle(200, 10, 85, 20));
    jLabel1.setPreferredSize(new Dimension(115, 14));
    jLabel2.setText("Range Axis 1 Label:");
    jLabel2.setBounds(new Rectangle(200, 35, 115, 20));
    jLabel2.setSize(new Dimension(115, 20));
    jLabel3.setText("Range Axis 2 Label:");
    jLabel3.setBounds(new Rectangle(200, 60, 115, 20));
    jLabel3.setSize(new Dimension(115, 20));
    jLabel4.setText("Range Axis 3 Label:");
    jLabel4.setBounds(new Rectangle(200, 85, 115, 20));
    jLabel4.setSize(new Dimension(115, 20));
    jLabel6.setText("Range Axis 4 Label:");
    jLabel6.setBounds(new Rectangle(200, 110, 115, 20));
    jLabel6.setSize(new Dimension(115, 20));
    titleLabelChangeNotifier notifier = new titleLabelChangeNotifier();
    chartTitleTextField.setBounds(new Rectangle(315, 10, 290, 20));
    chartTitleTextField.getDocument().addDocumentListener(notifier);
    axis1LabelTextField.setBounds(new Rectangle(315, 35, 290, 20));
    axis1LabelTextField.getDocument().addDocumentListener(notifier);
    axis2LabelTextField.setBounds(new Rectangle(315, 60, 290, 20));
    axis2LabelTextField.getDocument().addDocumentListener(notifier);
    axis3LabelTextField.setBounds(new Rectangle(315, 85, 290, 20));
    axis3LabelTextField.getDocument().addDocumentListener(notifier);
    axis4LabelTextField.setBounds(new Rectangle(315, 110, 290, 20));
    showCommentsCheckBox.setText("Show Comment Markers");
    showCommentsCheckBox.setBounds(new Rectangle(200, 140, 185, 25));
    showCommentsCheckBox.setToolTipText("Show/Hide any comment markers on the chart");
    showCommentsCheckBox.setRolloverEnabled(true);
    showCommentsCheckBox.setSelected(true);
    showCommentsCheckBox.setMnemonic('M');
    showCommentsCheckBox.addItemListener(new ItemListener() {
        public void itemStateChanged(ItemEvent e) {
            customChartPanel.setCommentsVisible(e.getStateChange() == ItemEvent.SELECTED);
        }
    });
    scrollDomainCheckBox.setText("Scroll Domain");
    scrollDomainCheckBox.setBounds(new Rectangle(10, 5, 175, 20));
    scrollDomainCheckBox.setSize(new Dimension(175, 25));
    scrollDomainCheckBox.setSelected(true);
    scrollDomainCheckBox.setMnemonic('O');
    scrollDomainCheckBox.setToolTipText("Checked to scroll domain as new data is received");
    scrollDomainCheckBox.addActionListener(new ActionListener() {
        public void actionPerformed(ActionEvent e) {
            scrollDomainCheckBox_actionPerformed(e);
        }
    });
    axis4LabelTextField.getDocument().addDocumentListener(notifier);

    logFileTextField.setBounds(new Rectangle(10, 145, 180, 20));
    logFileTextField.setText("NXTData.txt");
    logFileTextField.setPreferredSize(new Dimension(180, 20));
    logFileTextField.setToolTipText("File name. Leave empty to not log to file.");
    statusScrollPane.setOpaque(false);
    dataLogScrollPane.setOpaque(false);

    customChartPanel.setMinimumSize(new Dimension(400, 300));
    customChartPanel.setPreferredSize(new Dimension(812, 400));

    jLabel5.setText("NXT Name/Address:");
    jLabel5.setBounds(new Rectangle(5, 20, 160, 20));
    jLabel5.setToolTipText(jTextFieldNXTName.getToolTipText());
    jLabel5.setHorizontalTextPosition(SwingConstants.RIGHT);
    jLabel5.setHorizontalAlignment(SwingConstants.LEFT);

    connectionPanel.add(jTextFieldNXTName, null);
    connectionPanel.add(jButtonConnect, null);
    connectionPanel.add(jLabel5, null);
    dataLogScrollPane.setViewportView(dataLogTextArea);
    jTabbedPane1.addTab("Data Log", dataLogScrollPane);
    statusScrollPane.setViewportView(jTextAreaStatus);
    jTabbedPane1.addTab("Status", statusScrollPane);
    jTabbedPane1.addTab("Chart", chartOptionsPanel);
    chartDomLimitsPanel.add(datasetLimitEnableCheckBox, null);
    chartDomLimitsPanel.add(useDataPointsRadioButton, null);
    chartDomLimitsPanel.add(useTimeRadioButton, null);
    chartDomLimitsPanel.add(domainDisplayLimitSlider, null);
    chartDomLimitsPanel.add(domainLimitLabel, null);
    chartOptionsPanel.add(scrollDomainCheckBox, null);
    chartOptionsPanel.add(showCommentsCheckBox, null);
    chartOptionsPanel.add(axis4LabelTextField, null);
    chartOptionsPanel.add(axis3LabelTextField, null);
    chartOptionsPanel.add(axis2LabelTextField, null);
    chartOptionsPanel.add(axis1LabelTextField, null);
    chartOptionsPanel.add(chartTitleTextField, null);
    chartOptionsPanel.add(jLabel6, null);
    chartOptionsPanel.add(jLabel4, null);
    chartOptionsPanel.add(jLabel3, null);
    chartOptionsPanel.add(jLabel2, null);
    chartOptionsPanel.add(jLabel1, null);
    chartOptionsPanel.add(chartDomLimitsPanel, null);

    tglbtnpauseplay = new JToggleButton("");
    tglbtnpauseplay.addItemListener(new ItemListener() {
        public void itemStateChanged(ItemEvent e) {
            if (lpm == null)
                return;
            boolean doPause = false;
            if (e.getStateChange() == ItemEvent.SELECTED) {
                doPause = true;
            }
            lpm.setReaderPaused(doPause);
        }
    });
    //        tglbtnpauseplay.addChangeListener(new ChangeListener() {
    //           public void stateChanged(ChangeEvent e) {
    //              System.out.println(e.toString());
    //              //lpm.setReaderPaused(doPause)
    //           }
    //        });
    tglbtnpauseplay
            .setSelectedIcon(new ImageIcon(LogChartFrame.class.getResource("/lejos/pc/charting/play.png")));
    tglbtnpauseplay.setIcon(new ImageIcon(LogChartFrame.class.getResource("/lejos/pc/charting/pause.png")));
    tglbtnpauseplay.setBounds(571, 135, 30, 30);
    chartOptionsPanel.add(tglbtnpauseplay);

    jTabbedPane1.setToolTipTextAt(0, "The tab-delimited log of the data sent from the NXT");
    jTabbedPane1.setToolTipTextAt(1, "Status output");
    jTabbedPane1.setToolTipTextAt(2, "Chart options");
    jTabbedPane1.setMnemonicAt(0, KeyEvent.VK_D);
    jTabbedPane1.setMnemonicAt(1, KeyEvent.VK_S);
    jTabbedPane1.setMnemonicAt(2, KeyEvent.VK_T);
    this.getContentPane().add(customChartPanel, new GridBagConstraints(0, 0, 2, 1, 1.0, 1.0,
            GridBagConstraints.WEST, GridBagConstraints.BOTH, new Insets(0, 0, 0, 0), 0, 0));
    this.getContentPane().add(UIPanel, new GridBagConstraints(0, 1, 1, 1, 0.0, 0.0, GridBagConstraints.WEST,
            GridBagConstraints.NONE, new Insets(0, 0, 0, 0), -107, 0));

    this.getContentPane().add(jTabbedPane1, new GridBagConstraints(1, 1, 1, 1, 0.0, 0.0,
            GridBagConstraints.NORTHEAST, GridBagConstraints.HORIZONTAL, new Insets(0, 0, 0, 0), 0, 0));
    UIPanel.add(connectionPanel, null);
    UIPanel.add(selectFolderButton, null);
    UIPanel.add(logFileTextField, null);
    UIPanel.add(jLabel1logfilename, null);
    UIPanel.add(FQPathTextArea, null);
    ActionListener taskPerformer = new ActionListener() {
        public void actionPerformed(ActionEvent evt) {
            String theData = null;
            for (;;) {
                theData = LogChartFrame.this.logDataQueue.poll();
                if (theData == null)
                    break;
                try {
                    dataLogTextArea.getDocument().insertString(dataLogTextArea.getDocument().getLength(),
                            theData, null);
                } catch (BadLocationException e) {
                    System.out.print(
                            "BadLocationException in datalog textarea updater thread:" + e.toString() + "\n");
                }
            }
        }
    };
    this.updateLogTextAreaTimer = new Timer(1000, taskPerformer);
    this.updateLogTextAreaTimer.start();
}

From source file:edu.harvard.mcz.imagecapture.PositionTemplateEditor.java

/**
 * This method initializes jPanel1   //ww w .  ja v a2 s  . co m
 *    
 * @return javax.swing.JPanel   
 */
private JPanel getJPanel1() {
    if (jPanel1 == null) {
        GridBagConstraints gridBagConstraints19 = new GridBagConstraints();
        gridBagConstraints19.fill = GridBagConstraints.BOTH;
        gridBagConstraints19.weighty = 1.0;
        gridBagConstraints19.gridx = 2;
        gridBagConstraints19.gridy = 1;
        gridBagConstraints19.weightx = 1.0;
        jPanel1 = new JPanel();
        jPanel1.setLayout(new GridBagLayout());
        GridBagConstraints g1 = new GridBagConstraints();
        g1.gridx = 1;
        g1.anchor = GridBagConstraints.NORTHEAST;
        g1.weightx = 0.1;
        g1.weighty = 0.75;
        g1.fill = GridBagConstraints.HORIZONTAL;
        g1.gridy = 1;
        GridBagConstraints g2 = new GridBagConstraints();
        g2.gridx = 1;
        g2.anchor = GridBagConstraints.NORTH;
        g2.fill = GridBagConstraints.BOTH;
        g2.gridwidth = 2;
        g2.weighty = 0.2;
        g2.weightx = 0.0;
        g2.gridy = 0;
        jPanel1.add(getJPanel(), g1);
        jPanel1.add(getJPanel2(), g2);
        jPanel1.add(getJScrollPane1(), gridBagConstraints19);

    }
    return jPanel1;
}

From source file:net.java.sip.communicator.impl.gui.main.chat.ChatWritePanel.java

/**
 * Initializes plug-in components for this container.
 *///from w w w .  j  av a  2 s.c  o  m
void initPluginComponents() {
    // Search for plugin components registered through the OSGI bundle
    // context.
    Collection<ServiceReference<PluginComponentFactory>> serRefs;
    String osgiFilter = "(" + net.java.sip.communicator.service.gui.Container.CONTAINER_ID + "="
            + net.java.sip.communicator.service.gui.Container.CONTAINER_CHAT_WRITE_PANEL.getID() + ")";

    try {
        serRefs = GuiActivator.bundleContext.getServiceReferences(PluginComponentFactory.class, osgiFilter);
    } catch (InvalidSyntaxException ex) {
        serRefs = null;
        logger.error("Could not obtain plugin reference.", ex);
    }
    if ((serRefs != null) && !serRefs.isEmpty()) {
        for (ServiceReference<PluginComponentFactory> serRef : serRefs) {
            PluginComponentFactory factory = GuiActivator.bundleContext.getService(serRef);
            PluginComponent component = factory.getPluginComponentInstance(this);
            this.pluginComponents.add(component);

            ChatSession chatSession = chatPanel.getChatSession();

            if (chatSession != null) {
                ChatTransport currentTransport = chatSession.getCurrentChatTransport();
                Object currentDescriptor = currentTransport.getDescriptor();

                if (currentDescriptor instanceof Contact) {
                    Contact contact = (Contact) currentDescriptor;

                    component.setCurrentContact(contact, currentTransport.getResourceName());
                }
            }

            Object c = component.getComponent();

            if (c == null)
                continue;

            GridBagConstraints constraints = new GridBagConstraints();

            constraints.anchor = GridBagConstraints.NORTHEAST;
            constraints.fill = GridBagConstraints.NONE;
            constraints.gridy = 0;
            constraints.gridheight = 1;
            constraints.weightx = 0f;
            constraints.weighty = 0f;
            constraints.insets = new Insets(0, 3, 0, 0);

            centerPanel.add((Component) c, constraints);
        }
    }
    GuiActivator.getUIService().addPluginComponentListener(this);
    this.centerPanel.repaint();
}

From source file:edu.harvard.mcz.imagecapture.SpecimenDetailsViewPane.java

/**
 * This method initializes jPanel, laying out the UI components.
 *    /*from  w w  w .  j ava 2s .c o m*/
 * @return javax.swing.JPanel   
 */
private JPanel getJPanel() {
    if (jPanel == null) {
        GridBagConstraints gridBagConstraintsImgCount = new GridBagConstraints();
        gridBagConstraintsImgCount.fill = GridBagConstraints.BOTH;
        gridBagConstraintsImgCount.gridy = 6;
        gridBagConstraintsImgCount.weightx = 1.0;
        gridBagConstraintsImgCount.anchor = GridBagConstraints.WEST;
        gridBagConstraintsImgCount.gridwidth = 4;
        gridBagConstraintsImgCount.insets = new Insets(0, 3, 5, 0);
        gridBagConstraintsImgCount.ipadx = 3;
        gridBagConstraintsImgCount.gridx = 4;
        GridBagConstraints gridBagConstraints124 = new GridBagConstraints();
        gridBagConstraints124.insets = new Insets(0, 0, 0, 5);
        gridBagConstraints124.gridx = 0;
        gridBagConstraints124.anchor = GridBagConstraints.EAST;
        gridBagConstraints124.gridy = 20;
        GridBagConstraints gridBagConstraints38 = new GridBagConstraints();
        gridBagConstraints38.insets = new Insets(0, 0, 0, 5);
        gridBagConstraints38.gridx = 0;
        gridBagConstraints38.anchor = GridBagConstraints.EAST;
        gridBagConstraints38.gridy = 27;
        GridBagConstraints gridBagConstraints215 = new GridBagConstraints();
        gridBagConstraints215.insets = new Insets(0, 0, 0, 5);
        gridBagConstraints215.gridx = 0;
        gridBagConstraints215.anchor = GridBagConstraints.EAST;
        gridBagConstraints215.gridy = 26;
        GridBagConstraints gridBagConstraints120 = new GridBagConstraints();
        gridBagConstraints120.insets = new Insets(0, 0, 0, 5);
        gridBagConstraints120.gridx = 3;
        gridBagConstraints120.weightx = 1.0;
        gridBagConstraints120.gridy = 25;
        jLabel44 = new JLabel();
        jLabel44.setText("yyyy/mm/dd");
        GridBagConstraints gridBagConstraints49 = new GridBagConstraints();
        gridBagConstraints49.insets = new Insets(0, 0, 0, 0);
        gridBagConstraints49.fill = GridBagConstraints.BOTH;
        gridBagConstraints49.weighty = 1.0;
        gridBagConstraints49.weightx = 1.0;
        gridBagConstraints49.gridx = 1;
        gridBagConstraints49.gridwidth = 7;
        gridBagConstraints49.gridy = 35;
        GridBagConstraints gridBagConstraints214 = new GridBagConstraints();
        gridBagConstraints214.gridwidth = 3;
        gridBagConstraints214.insets = new Insets(0, 0, 0, 5);
        gridBagConstraints214.anchor = GridBagConstraints.EAST;
        gridBagConstraints214.gridx = 4;
        gridBagConstraints214.gridy = 42;
        gridBagConstraints214.weightx = 0.0;
        gridBagConstraints214.weighty = 0.0;
        gridBagConstraints214.fill = GridBagConstraints.NONE;
        GridBagConstraints gridBagConstraints119 = new GridBagConstraints();
        gridBagConstraints119.insets = new Insets(0, 0, 0, 0);
        gridBagConstraints119.anchor = GridBagConstraints.WEST;
        gridBagConstraints119.gridx = 7;
        gridBagConstraints119.gridy = 42;
        gridBagConstraints119.weightx = 0.0;
        gridBagConstraints119.weighty = 0.0;
        gridBagConstraints119.fill = GridBagConstraints.NONE;
        GridBagConstraints gridBagConstraints213 = new GridBagConstraints();
        gridBagConstraints213.insets = new Insets(0, 0, 0, 0);
        gridBagConstraints213.fill = GridBagConstraints.BOTH;
        gridBagConstraints213.gridy = 31;
        gridBagConstraints213.weightx = 0.0;
        gridBagConstraints213.gridwidth = 7;
        gridBagConstraints213.anchor = GridBagConstraints.WEST;
        gridBagConstraints213.gridx = 1;
        GridBagConstraints gridBagConstraints118 = new GridBagConstraints();
        gridBagConstraints118.insets = new Insets(0, 0, 0, 5);
        gridBagConstraints118.gridx = 0;
        gridBagConstraints118.anchor = GridBagConstraints.EAST;
        gridBagConstraints118.gridwidth = 1;
        gridBagConstraints118.gridy = 31;
        jLabel31 = new JLabel();
        jLabel31.setText("Publications");
        GridBagConstraints gridBagConstraints212 = new GridBagConstraints();
        gridBagConstraints212.insets = new Insets(0, 0, 0, 5);
        gridBagConstraints212.gridx = 3;
        gridBagConstraints212.fill = GridBagConstraints.HORIZONTAL;
        gridBagConstraints212.gridwidth = 4;
        gridBagConstraints212.gridy = 15;
        GridBagConstraints gridBagConstraints117 = new GridBagConstraints();
        gridBagConstraints117.insets = new Insets(0, 0, 0, 0);
        gridBagConstraints117.fill = GridBagConstraints.BOTH;
        gridBagConstraints117.gridy = 25;
        gridBagConstraints117.weightx = 0.0;
        gridBagConstraints117.gridwidth = 4;
        gridBagConstraints117.anchor = GridBagConstraints.WEST;
        gridBagConstraints117.gridx = 4;
        GridBagConstraints gridBagConstraints211 = new GridBagConstraints();
        gridBagConstraints211.insets = new Insets(0, 0, 0, 5);
        gridBagConstraints211.gridx = 3;
        gridBagConstraints211.gridwidth = 4;
        gridBagConstraints211.weighty = 1.0;
        gridBagConstraints211.gridy = 44;
        GridBagConstraints gridBagConstraintsMS = new GridBagConstraints();
        gridBagConstraintsMS.fill = GridBagConstraints.BOTH;
        gridBagConstraintsMS.gridx = 0;
        gridBagConstraintsMS.gridwidth = 8;
        gridBagConstraintsMS.weighty = 1.0;
        gridBagConstraintsMS.gridy = 45;
        gridBagConstraintsMS.gridx = 0;

        GridBagConstraints gridBagConstraints116 = new GridBagConstraints();
        gridBagConstraints116.gridwidth = 3;
        gridBagConstraints116.insets = new Insets(0, 0, 0, 5);
        gridBagConstraints116.gridx = 4;
        gridBagConstraints116.anchor = GridBagConstraints.EAST;
        gridBagConstraints116.gridy = 41;
        GridBagConstraints gridBagConstraintsInfer = new GridBagConstraints();
        gridBagConstraintsInfer.insets = new Insets(0, 0, 0, 0);
        gridBagConstraintsInfer.fill = GridBagConstraints.BOTH;
        gridBagConstraintsInfer.gridy = 36;
        gridBagConstraintsInfer.weightx = 1.0;
        gridBagConstraintsInfer.anchor = GridBagConstraints.WEST;
        gridBagConstraintsInfer.gridwidth = 7;
        gridBagConstraintsInfer.gridx = 1;
        GridBagConstraints gridBagConstraints56 = new GridBagConstraints();
        gridBagConstraints56.insets = new Insets(0, 0, 0, 5);
        gridBagConstraints56.gridx = 0;
        gridBagConstraints56.anchor = GridBagConstraints.EAST;
        gridBagConstraints56.gridy = 36;
        jLabel43 = new JLabel();
        jLabel43.setText("Inferences");
        GridBagConstraints gridBagConstraints48 = new GridBagConstraints();
        gridBagConstraints48.insets = new Insets(0, 0, 0, 0);
        gridBagConstraints48.fill = GridBagConstraints.VERTICAL;
        gridBagConstraints48.gridy = 0;
        gridBagConstraints48.weightx = 1.0;
        gridBagConstraints48.anchor = GridBagConstraints.WEST;
        gridBagConstraints48.gridwidth = 4;
        gridBagConstraints48.gridx = 4;
        GridBagConstraints gridBagConstraints37 = new GridBagConstraints();
        gridBagConstraints37.insets = new Insets(0, 0, 0, 5);
        gridBagConstraints37.fill = GridBagConstraints.VERTICAL;
        gridBagConstraints37.gridx = 3;
        gridBagConstraints37.anchor = GridBagConstraints.EAST;
        gridBagConstraints37.gridy = 0;
        jLabel42 = new JLabel();
        jLabel42.setText("Collection");
        GridBagConstraints gridBagConstraints29 = new GridBagConstraints();
        gridBagConstraints29.insets = new Insets(0, 0, 0, 5);
        gridBagConstraints29.fill = GridBagConstraints.BOTH;
        gridBagConstraints29.gridy = 41;
        gridBagConstraints29.weightx = 1.0;
        gridBagConstraints29.anchor = GridBagConstraints.WEST;
        gridBagConstraints29.gridwidth = 3;
        gridBagConstraints29.gridx = 1;
        GridBagConstraints gridBagConstraints115 = new GridBagConstraints();
        gridBagConstraints115.insets = new Insets(0, 0, 0, 5);
        gridBagConstraints115.gridx = 0;
        gridBagConstraints115.gridy = 41;
        jLabel41 = new JLabel();
        jLabel41.setText("Workflow Status");
        GridBagConstraints gridBagConstraints172 = new GridBagConstraints();
        gridBagConstraints172.insets = new Insets(0, 0, 0, 0);
        gridBagConstraints172.fill = GridBagConstraints.BOTH;
        gridBagConstraints172.gridy = 33;
        gridBagConstraints172.weightx = 1.0;
        gridBagConstraints172.anchor = GridBagConstraints.WEST;
        gridBagConstraints172.gridwidth = 4;
        gridBagConstraints172.gridx = 4;
        GridBagConstraints gridBagConstraints162 = new GridBagConstraints();
        gridBagConstraints162.insets = new Insets(0, 0, 0, 5);
        gridBagConstraints162.fill = GridBagConstraints.BOTH;
        gridBagConstraints162.gridy = 33;
        gridBagConstraints162.weightx = 1.0;
        gridBagConstraints162.anchor = GridBagConstraints.WEST;
        gridBagConstraints162.gridwidth = 2;
        gridBagConstraints162.gridx = 1;
        GridBagConstraints gridBagConstraints142 = new GridBagConstraints();
        gridBagConstraints142.insets = new Insets(0, 0, 0, 5);
        gridBagConstraints142.fill = GridBagConstraints.HORIZONTAL;
        gridBagConstraints142.gridy = 42;
        gridBagConstraints142.weightx = 1.0;
        gridBagConstraints142.anchor = GridBagConstraints.NORTHWEST;
        gridBagConstraints142.gridwidth = 3;
        gridBagConstraints142.ipady = 2;
        gridBagConstraints142.gridx = 1;
        GridBagConstraints gridBagConstraints133 = new GridBagConstraints();
        gridBagConstraints133.insets = new Insets(0, 0, 0, 5);
        gridBagConstraints133.gridx = 0;
        gridBagConstraints133.anchor = GridBagConstraints.NORTHEAST;
        gridBagConstraints133.gridy = 42;
        jLabel40 = new JLabel();
        jLabel40.setText("Questions");
        GridBagConstraints gridBagConstraints123 = new GridBagConstraints();
        gridBagConstraints123.insets = new Insets(0, 0, 0, 5);
        gridBagConstraints123.gridx = 3;
        gridBagConstraints123.anchor = GridBagConstraints.EAST;
        gridBagConstraints123.gridy = 33;
        jLabel39 = new JLabel();
        jLabel39.setText("Habitat");
        GridBagConstraints gridBagConstraints114 = new GridBagConstraints();
        gridBagConstraints114.insets = new Insets(0, 0, 0, 5);
        gridBagConstraints114.gridx = 0;
        gridBagConstraints114.anchor = GridBagConstraints.EAST;
        gridBagConstraints114.gridy = 33;
        jLabel38 = new JLabel();
        jLabel38.setText("Associated Taxon");
        GridBagConstraints gridBagConstraints94 = new GridBagConstraints();
        gridBagConstraints94.gridwidth = 3;
        gridBagConstraints94.insets = new Insets(0, 0, 0, 5);
        gridBagConstraints94.gridx = 4;
        gridBagConstraints94.anchor = GridBagConstraints.WEST;
        gridBagConstraints94.gridy = 18;
        jLabel36 = new JLabel();
        jLabel36.setText("Valid Dist.");
        GridBagConstraints gridBagConstraints83 = new GridBagConstraints();
        gridBagConstraints83.gridx = 3;
        gridBagConstraints83.anchor = GridBagConstraints.EAST;
        gridBagConstraints83.insets = new Insets(0, 0, 0, 5);
        gridBagConstraints83.weightx = 1.0;
        gridBagConstraints83.gridy = 18;
        GridBagConstraints gridBagConstraints65 = new GridBagConstraints();
        gridBagConstraints65.insets = new Insets(0, 0, 0, 5);
        gridBagConstraints65.gridx = 0;
        gridBagConstraints65.anchor = GridBagConstraints.NORTHEAST;
        gridBagConstraints65.gridy = 35;
        jLabel35 = new JLabel();
        jLabel35.setText("Specimen Notes");
        GridBagConstraints gridBagConstraints47 = new GridBagConstraints();
        gridBagConstraints47.insets = new Insets(0, 0, 0, 5);
        gridBagConstraints47.gridx = 0;
        gridBagConstraints47.fill = GridBagConstraints.VERTICAL;
        gridBagConstraints47.ipady = 12;
        gridBagConstraints47.gridy = 5;
        jLabel34 = new JLabel();
        jLabel34.setText("     ");
        GridBagConstraints gridBagConstraints19 = new GridBagConstraints();
        gridBagConstraints19.insets = new Insets(0, 0, 0, 0);
        gridBagConstraints19.fill = GridBagConstraints.HORIZONTAL;
        gridBagConstraints19.gridy = 23;
        gridBagConstraints19.weightx = 1.0;
        gridBagConstraints19.anchor = GridBagConstraints.NORTH;
        gridBagConstraints19.gridwidth = 5;
        gridBagConstraints19.gridx = 3;

        GridBagConstraints gridBagConstraints18 = new GridBagConstraints();
        gridBagConstraints18.insets = new Insets(0, 0, 0, 5);
        gridBagConstraints18.fill = GridBagConstraints.BOTH;
        gridBagConstraints18.gridy = 19;
        gridBagConstraints18.weightx = 1.0;
        gridBagConstraints18.anchor = GridBagConstraints.WEST;
        gridBagConstraints18.gridx = 4;
        GridBagConstraints gbc_jLabelElevation = new GridBagConstraints();
        gbc_jLabelElevation.insets = new Insets(0, 0, 0, 5);
        gbc_jLabelElevation.gridx = 3;
        gbc_jLabelElevation.anchor = GridBagConstraints.EAST;
        gbc_jLabelElevation.gridy = 19;
        jLabelElevation = new JLabel();
        jLabelElevation.setText("Elevation");
        jLabel25 = new JLabel();
        jLabel25.setText("Text");
        jLabel26 = new JLabel();
        jLabel26.setText("Text");
        jLabel28 = new JLabel();
        jLabel28.setText("Rank");
        GridBagConstraints gridBagConstraints161 = new GridBagConstraints();
        gridBagConstraints161.gridx = 0;
        GridBagConstraints gridBagConstraints151 = new GridBagConstraints();
        gridBagConstraints151.insets = new Insets(0, 0, 0, 5);
        gridBagConstraints151.fill = GridBagConstraints.BOTH;
        gridBagConstraints151.gridy = 27;
        gridBagConstraints151.weightx = 1.0;
        gridBagConstraints151.gridx = 1;
        GridBagConstraints gridBagConstraints141 = new GridBagConstraints();
        gridBagConstraints141.insets = new Insets(0, 0, 0, 5);
        gridBagConstraints141.fill = GridBagConstraints.BOTH;
        gridBagConstraints141.gridy = 26;
        gridBagConstraints141.weightx = 1.0;
        gridBagConstraints141.gridx = 1;
        GridBagConstraints gridBagConstraints132 = new GridBagConstraints();
        gridBagConstraints132.gridwidth = 3;
        gridBagConstraints132.insets = new Insets(0, 0, 0, 5);
        gridBagConstraints132.fill = GridBagConstraints.BOTH;
        gridBagConstraints132.gridy = 27;
        gridBagConstraints132.weightx = 1.0;
        gridBagConstraints132.gridx = 4;
        GridBagConstraints gridBagConstraints122 = new GridBagConstraints();
        gridBagConstraints122.gridwidth = 3;
        gridBagConstraints122.insets = new Insets(0, 0, 0, 5);
        gridBagConstraints122.fill = GridBagConstraints.BOTH;
        gridBagConstraints122.gridy = 26;
        gridBagConstraints122.weightx = 1.0;
        gridBagConstraints122.gridx = 4;
        GridBagConstraints gridBagConstraints113 = new GridBagConstraints();
        gridBagConstraints113.insets = new Insets(0, 0, 0, 5);
        gridBagConstraints113.gridx = 3;
        gridBagConstraints113.anchor = GridBagConstraints.EAST;
        gridBagConstraints113.gridy = 27;
        GridBagConstraints gridBagConstraints103 = new GridBagConstraints();
        gridBagConstraints103.insets = new Insets(0, 0, 0, 5);
        gridBagConstraints103.gridx = 3;
        gridBagConstraints103.anchor = GridBagConstraints.EAST;
        gridBagConstraints103.gridy = 26;
        GridBagConstraints gridBagConstraints93 = new GridBagConstraints();
        gridBagConstraints93.insets = new Insets(0, 0, 0, 5);
        gridBagConstraints93.fill = GridBagConstraints.BOTH;
        gridBagConstraints93.gridy = 12;
        gridBagConstraints93.weightx = 1.0;
        gridBagConstraints93.gridx = 1;
        GridBagConstraints gridBagConstraints84 = new GridBagConstraints();
        gridBagConstraints84.gridwidth = 3;
        gridBagConstraints84.fill = GridBagConstraints.BOTH;
        gridBagConstraints84.gridy = 12;
        gridBagConstraints84.weightx = 1.0;
        gridBagConstraints84.anchor = GridBagConstraints.WEST;
        gridBagConstraints84.insets = new Insets(0, 0, 0, 5);
        gridBagConstraints84.gridx = 4;
        GridBagConstraints gridBagConstraints74 = new GridBagConstraints();
        gridBagConstraints74.insets = new Insets(0, 0, 0, 5);
        gridBagConstraints74.gridx = 3;
        gridBagConstraints74.anchor = GridBagConstraints.EAST;
        gridBagConstraints74.weightx = 0.0;
        gridBagConstraints74.gridy = 12;
        //         GridBagConstraints gridBagConstraints64 = new GridBagConstraints();
        //         gridBagConstraints64.fill = GridBagConstraints.BOTH;
        //         gridBagConstraints64.gridy = 14;
        //         gridBagConstraints64.weightx = 1.0;
        //         gridBagConstraints64.gridx = 3;
        GridBagConstraints gridBagConstraints55 = new GridBagConstraints();
        gridBagConstraints55.gridx = 2;
        gridBagConstraints55.gridy = 14;
        //jLabel31 = new JLabel();
        //jLabel31.setText("Qual.");
        GridBagConstraints gridBagConstraints46 = new GridBagConstraints();
        gridBagConstraints46.insets = new Insets(0, 0, 0, 5);
        gridBagConstraints46.fill = GridBagConstraints.BOTH;
        gridBagConstraints46.gridy = 14;
        gridBagConstraints46.weightx = 1.0;
        gridBagConstraints46.anchor = GridBagConstraints.WEST;
        gridBagConstraints46.gridx = 1;
        gridBagConstraints46.gridwidth = 2;
        GridBagConstraints gridBagConstraints36 = new GridBagConstraints();
        gridBagConstraints36.insets = new Insets(0, 0, 0, 5);
        gridBagConstraints36.gridx = 0;
        gridBagConstraints36.anchor = GridBagConstraints.EAST;
        gridBagConstraints36.gridy = 14;
        jLabel30 = new JLabel();
        jLabel30.setText("Unnamed Form");
        GridBagConstraints gridBagConstraints210 = new GridBagConstraints();
        gridBagConstraints210.insets = new Insets(0, 0, 0, 5);
        gridBagConstraints210.fill = GridBagConstraints.BOTH;
        gridBagConstraints210.gridy = 13;
        gridBagConstraints210.weightx = 1.0;
        gridBagConstraints210.anchor = GridBagConstraints.WEST;
        gridBagConstraints210.gridwidth = 2;
        gridBagConstraints210.gridx = 1;
        GridBagConstraints gridBagConstraints112 = new GridBagConstraints();
        gridBagConstraints112.insets = new Insets(0, 0, 0, 5);
        gridBagConstraints112.gridx = 0;
        gridBagConstraints112.anchor = GridBagConstraints.EAST;
        gridBagConstraints112.gridy = 13;
        jLabel29 = new JLabel();
        jLabel29.setText("Author");
        GridBagConstraints gridBagConstraints110 = new GridBagConstraints();
        gridBagConstraints110.insets = new Insets(0, 0, 0, 5);
        gridBagConstraints110.gridx = 0;
        gridBagConstraints110.gridy = 12;
        jLabel27 = new JLabel();
        jLabel27.setText("Infrasubspecifc Name");
        GridBagConstraints gridBagConstraints63 = new GridBagConstraints();
        gridBagConstraints63.insets = new Insets(0, 0, 0, 5);
        gridBagConstraints63.fill = GridBagConstraints.BOTH;
        gridBagConstraints63.gridy = 25;
        gridBagConstraints63.weightx = 1.0;
        gridBagConstraints63.anchor = GridBagConstraints.WEST;
        gridBagConstraints63.gridx = 1;
        GridBagConstraints gridBagConstraints35 = new GridBagConstraints();
        gridBagConstraints35.insets = new Insets(0, 0, 0, 5);
        gridBagConstraints35.gridx = 0;
        gridBagConstraints35.anchor = GridBagConstraints.EAST;
        gridBagConstraints35.gridy = 25;
        jLabel22 = new JLabel();
        jLabel22.setText("Verbatim Date");
        GridBagConstraints gridBagConstraints27 = new GridBagConstraints();
        gridBagConstraints27.insets = new Insets(0, 0, 0, 5);
        gridBagConstraints27.fill = GridBagConstraints.BOTH;
        gridBagConstraints27.gridy = 30;
        gridBagConstraints27.weightx = 1.0;
        gridBagConstraints27.anchor = GridBagConstraints.WEST;
        gridBagConstraints27.gridx = 1;
        GridBagConstraints gridBagConstraints102 = new GridBagConstraints();
        gridBagConstraints102.insets = new Insets(0, 0, 0, 0);
        gridBagConstraints102.fill = GridBagConstraints.VERTICAL;
        gridBagConstraints102.gridy = 30;
        gridBagConstraints102.weightx = 1.0;
        gridBagConstraints102.anchor = GridBagConstraints.WEST;
        gridBagConstraints102.gridwidth = 4;
        gridBagConstraints102.gridx = 4;
        GridBagConstraints gridBagConstraints92 = new GridBagConstraints();
        gridBagConstraints92.insets = new Insets(0, 0, 0, 5);
        gridBagConstraints92.gridx = 3;
        gridBagConstraints92.anchor = GridBagConstraints.EAST;
        gridBagConstraints92.gridy = 30;
        jLabel21 = new JLabel();
        jLabel21.setText("Sex");
        GridBagConstraints gridBagConstraints82 = new GridBagConstraints();
        gridBagConstraints82.insets = new Insets(0, 0, 0, 5);
        gridBagConstraints82.gridx = 0;
        gridBagConstraints82.anchor = GridBagConstraints.EAST;
        gridBagConstraints82.gridy = 30;
        jLabel20 = new JLabel();
        jLabel20.setText("LifeStage");
        GridBagConstraints gridBagConstraints62 = new GridBagConstraints();
        gridBagConstraints62.insets = new Insets(0, 0, 0, 0);
        gridBagConstraints62.fill = GridBagConstraints.BOTH;
        gridBagConstraints62.gridy = 7;
        gridBagConstraints62.weightx = 1.0;
        gridBagConstraints62.anchor = GridBagConstraints.WEST;
        gridBagConstraints62.gridwidth = 4;
        gridBagConstraints62.gridx = 4;
        GridBagConstraints gridBagConstraints53 = new GridBagConstraints();
        gridBagConstraints53.insets = new Insets(0, 0, 0, 5);
        gridBagConstraints53.fill = GridBagConstraints.BOTH;
        gridBagConstraints53.gridy = 7;
        gridBagConstraints53.weightx = 1.0;
        gridBagConstraints53.anchor = GridBagConstraints.WEST;
        gridBagConstraints53.gridwidth = 1;
        gridBagConstraints53.gridx = 1;
        GridBagConstraints gridBagConstraints44 = new GridBagConstraints();
        gridBagConstraints44.insets = new Insets(0, 0, 0, 5);
        gridBagConstraints44.fill = GridBagConstraints.BOTH;
        gridBagConstraints44.gridy = 6;
        gridBagConstraints44.weightx = 1.0;
        gridBagConstraints44.anchor = GridBagConstraints.WEST;
        gridBagConstraints44.gridwidth = 3;
        gridBagConstraints44.gridx = 1;
        GridBagConstraints gbc_jLabelTribe = new GridBagConstraints();
        gbc_jLabelTribe.insets = new Insets(0, 0, 0, 5);
        gbc_jLabelTribe.gridx = 3;
        gbc_jLabelTribe.anchor = GridBagConstraints.EAST;
        gbc_jLabelTribe.gridy = 7;
        jLabelTribe = new JLabel();
        jLabelTribe.setText("Tribe");
        GridBagConstraints gridBagConstraints26 = new GridBagConstraints();
        gridBagConstraints26.insets = new Insets(0, 0, 0, 5);
        gridBagConstraints26.gridx = 0;
        gridBagConstraints26.anchor = GridBagConstraints.EAST;
        gridBagConstraints26.gridy = 7;
        jLabel17 = new JLabel();
        jLabel17.setText("Subfamily");
        GridBagConstraints gridBagConstraints16 = new GridBagConstraints();
        gridBagConstraints16.insets = new Insets(0, 0, 0, 5);
        gridBagConstraints16.gridx = 0;
        gridBagConstraints16.anchor = GridBagConstraints.EAST;
        gridBagConstraints16.gridy = 6;
        jLabel16 = new JLabel();
        jLabel16.setText("Family");
        GridBagConstraints gridBagConstraints131 = new GridBagConstraints();
        gridBagConstraints131.insets = new Insets(0, 0, 0, 5);
        gridBagConstraints131.fill = GridBagConstraints.BOTH;
        gridBagConstraints131.gridy = 19;
        gridBagConstraints131.weightx = 1.0;
        gridBagConstraints131.anchor = GridBagConstraints.WEST;
        gridBagConstraints131.gridwidth = 2;
        gridBagConstraints131.gridx = 1;
        GridBagConstraints gridBagConstraints121 = new GridBagConstraints();
        gridBagConstraints121.insets = new Insets(0, 0, 0, 5);
        gridBagConstraints121.fill = GridBagConstraints.BOTH;
        gridBagConstraints121.gridy = 18;
        gridBagConstraints121.weightx = 1.0;
        gridBagConstraints121.anchor = GridBagConstraints.WEST;
        gridBagConstraints121.gridwidth = 1;
        gridBagConstraints121.gridx = 1;
        GridBagConstraints gridBagConstraints111 = new GridBagConstraints();
        gridBagConstraints111.insets = new Insets(0, 0, 0, 0);
        gridBagConstraints111.fill = GridBagConstraints.BOTH;
        gridBagConstraints111.gridy = 16;
        gridBagConstraints111.weightx = 1.0;
        gridBagConstraints111.anchor = GridBagConstraints.WEST;
        gridBagConstraints111.gridwidth = 7;
        gridBagConstraints111.gridx = 1;
        GridBagConstraints gridBagConstraints101 = new GridBagConstraints();
        gridBagConstraints101.insets = new Insets(0, 0, 0, 5);
        gridBagConstraints101.gridx = 0;
        gridBagConstraints101.anchor = GridBagConstraints.EAST;
        gridBagConstraints101.gridy = 19;
        jLabel15 = new JLabel();
        jLabel15.setText("State/Province");
        GridBagConstraints gridBagConstraints91 = new GridBagConstraints();
        gridBagConstraints91.insets = new Insets(0, 0, 0, 5);
        gridBagConstraints91.gridx = 0;
        gridBagConstraints91.anchor = GridBagConstraints.EAST;
        gridBagConstraints91.gridy = 18;
        jLabel14 = new JLabel();
        jLabel14.setText("Country");
        GridBagConstraints gridBagConstraints81 = new GridBagConstraints();
        gridBagConstraints81.insets = new Insets(0, 0, 0, 5);
        gridBagConstraints81.gridx = 0;
        gridBagConstraints81.anchor = GridBagConstraints.EAST;
        gridBagConstraints81.gridy = 16;
        jLabel13 = new JLabel();
        jLabel13.setText("Verbatim Locality");
        GridBagConstraints gridBagConstraints71 = new GridBagConstraints();
        gridBagConstraints71.insets = new Insets(0, 0, 0, 5);
        gridBagConstraints71.fill = GridBagConstraints.BOTH;
        gridBagConstraints71.gridy = 15;
        gridBagConstraints71.weightx = 1.0;
        gridBagConstraints71.anchor = GridBagConstraints.WEST;
        gridBagConstraints71.gridx = 1;
        GridBagConstraints gridBagConstraints61 = new GridBagConstraints();
        gridBagConstraints61.insets = new Insets(0, 0, 0, 5);
        gridBagConstraints61.gridx = 0;
        gridBagConstraints61.anchor = GridBagConstraints.EAST;
        gridBagConstraints61.gridy = 15;
        jLabel12 = new JLabel();
        jLabel12.setText("DrawerNumber");
        GridBagConstraints gridBagConstraints52 = new GridBagConstraints();
        gridBagConstraints52.insets = new Insets(0, 0, 0, 0);
        gridBagConstraints52.fill = GridBagConstraints.BOTH;
        gridBagConstraints52.gridy = 43;
        gridBagConstraints52.weightx = 1.0;
        gridBagConstraints52.weighty = 1.0;
        gridBagConstraints52.gridwidth = 8;
        gridBagConstraints52.gridx = 0;
        GridBagConstraints gridBagConstraints43 = new GridBagConstraints();
        gridBagConstraints43.gridheight = 2;
        gridBagConstraints43.gridx = 0;
        gridBagConstraints43.anchor = GridBagConstraints.NORTHEAST;
        gridBagConstraints43.ipady = 0;
        gridBagConstraints43.insets = new Insets(0, 0, 0, 5);
        gridBagConstraints43.gridy = 23;
        GridBagConstraints gridBagConstraints33 = new GridBagConstraints();
        gridBagConstraints33.insets = new Insets(0, 0, 0, 5);
        gridBagConstraints33.gridx = 0;
        gridBagConstraints33.anchor = GridBagConstraints.NORTHEAST;
        gridBagConstraints33.gridy = 4;
        GridBagConstraints gridBagConstraints25 = new GridBagConstraints();
        gridBagConstraints25.insets = new Insets(0, 0, 0, 5);
        gridBagConstraints25.fill = GridBagConstraints.BOTH;
        gridBagConstraints25.gridy = 3;
        gridBagConstraints25.weightx = 1.0;
        gridBagConstraints25.weighty = 0.0;
        gridBagConstraints25.gridheight = 3;
        gridBagConstraints25.gridwidth = 6;
        gridBagConstraints25.gridx = 1;
        GridBagConstraints gridBagConstraints15 = new GridBagConstraints();
        gridBagConstraints15.insets = new Insets(0, 0, 0, 5);
        gridBagConstraints15.gridx = 0;
        gridBagConstraints15.anchor = GridBagConstraints.NORTHEAST;
        gridBagConstraints15.gridy = 3;
        jLabel11 = new JLabel();
        jLabel11.setText("Numbers");
        GridBagConstraints gridBagConstraints42 = new GridBagConstraints();
        gridBagConstraints42.insets = new Insets(0, 0, 0, 5);
        gridBagConstraints42.gridx = 3;
        gridBagConstraints42.anchor = GridBagConstraints.EAST;
        gridBagConstraints42.gridy = 37;
        jLabel10 = new JLabel();
        jLabel10.setText("Date Created");
        GridBagConstraints gridBagConstraints32 = new GridBagConstraints();
        gridBagConstraints32.insets = new Insets(0, 0, 0, 0);
        gridBagConstraints32.fill = GridBagConstraints.HORIZONTAL;
        gridBagConstraints32.gridy = 37;
        gridBagConstraints32.weightx = 1.0;
        gridBagConstraints32.anchor = GridBagConstraints.WEST;
        gridBagConstraints32.gridwidth = 4;
        gridBagConstraints32.gridx = 4;
        GridBagConstraints gridBagConstraints24 = new GridBagConstraints();
        gridBagConstraints24.insets = new Insets(0, 0, 0, 5);
        gridBagConstraints24.gridx = 0;
        gridBagConstraints24.anchor = GridBagConstraints.EAST;
        gridBagConstraints24.gridy = 37;
        jLabel9 = new JLabel();
        jLabel9.setText("CreatedBy");
        GridBagConstraints gridBagConstraints14 = new GridBagConstraints();
        gridBagConstraints14.insets = new Insets(0, 0, 0, 5);
        gridBagConstraints14.fill = GridBagConstraints.HORIZONTAL;
        gridBagConstraints14.gridy = 37;
        gridBagConstraints14.weightx = 1.0;
        gridBagConstraints14.anchor = GridBagConstraints.WEST;
        gridBagConstraints14.gridx = 1;
        GridBagConstraints gridBagConstraints23 = new GridBagConstraints();
        gridBagConstraints23.insets = new Insets(0, 0, 0, 0);
        gridBagConstraints23.fill = GridBagConstraints.HORIZONTAL;
        gridBagConstraints23.gridy = 39;
        gridBagConstraints23.weightx = 1.0;
        gridBagConstraints23.anchor = GridBagConstraints.WEST;
        gridBagConstraints23.gridwidth = 4;
        gridBagConstraints23.gridx = 4;
        GridBagConstraints gridBagConstraints13 = new GridBagConstraints();
        gridBagConstraints13.insets = new Insets(0, 0, 0, 5);
        gridBagConstraints13.gridx = 3;
        gridBagConstraints13.anchor = GridBagConstraints.EAST;
        gridBagConstraints13.gridy = 39;
        jLabel8 = new JLabel();
        jLabel8.setText("Last Updated");
        GridBagConstraints gridBagConstraints22 = new GridBagConstraints();
        gridBagConstraints22.insets = new Insets(0, 0, 0, 5);
        gridBagConstraints22.gridx = 0;
        gridBagConstraints22.anchor = GridBagConstraints.NORTHEAST;
        gridBagConstraints22.gridy = 22;
        jLabel7 = new JLabel();
        jLabel7.setText("Collectors");
        GridBagConstraints gridBagConstraints12 = new GridBagConstraints();
        gridBagConstraints12.insets = new Insets(0, 0, 0, 5);
        gridBagConstraints12.fill = GridBagConstraints.HORIZONTAL;
        gridBagConstraints12.gridy = 39;
        gridBagConstraints12.weightx = 1.0;
        gridBagConstraints12.anchor = GridBagConstraints.NORTHWEST;
        gridBagConstraints12.gridx = 1;
        GridBagConstraints gridBagConstraints51 = new GridBagConstraints();
        gridBagConstraints51.insets = new Insets(0, 0, 0, 5);
        gridBagConstraints51.fill = GridBagConstraints.BOTH;
        gridBagConstraints51.gridy = 22;
        gridBagConstraints51.weightx = 1.0;
        gridBagConstraints51.anchor = GridBagConstraints.WEST;
        gridBagConstraints51.gridheight = 3;
        gridBagConstraints51.gridwidth = 2;
        gridBagConstraints51.gridx = 1;
        GridBagConstraints gridBagConstraints41 = new GridBagConstraints();
        gridBagConstraints41.insets = new Insets(0, 0, 0, 5);
        gridBagConstraints41.gridx = 0;
        gridBagConstraints41.fill = GridBagConstraints.NONE;
        gridBagConstraints41.anchor = GridBagConstraints.NORTHEAST;
        gridBagConstraints41.gridy = 39;
        jLabel6 = new JLabel();
        jLabel6.setText("LastUpdatedBy");
        GridBagConstraints gridBagConstraints31 = new GridBagConstraints();
        gridBagConstraints31.insets = new Insets(0, 0, 0, 5);
        gridBagConstraints31.fill = GridBagConstraints.HORIZONTAL;
        gridBagConstraints31.gridy = 21;
        gridBagConstraints31.weightx = 1.0;
        gridBagConstraints31.anchor = GridBagConstraints.WEST;
        gridBagConstraints31.gridwidth = 6;
        gridBagConstraints31.gridx = 1;
        GridBagConstraints gridBagConstraints21 = new GridBagConstraints();
        gridBagConstraints21.insets = new Insets(0, 0, 0, 5);
        gridBagConstraints21.gridx = 0;
        gridBagConstraints21.anchor = GridBagConstraints.SOUTHEAST;
        gridBagConstraints21.gridy = 21;
        jLabel5 = new JLabel();
        jLabel5.setText("Collection");
        GridBagConstraints gridBagConstraints10 = new GridBagConstraints();
        gridBagConstraints10.insets = new Insets(0, 0, 0, 0);
        gridBagConstraints10.gridx = 7;
        gridBagConstraints10.anchor = GridBagConstraints.NORTHWEST;
        gridBagConstraints10.gridy = 41;
        gridBagConstraints10.weighty = 0.0;
        GridBagConstraints gridBagConstraints9 = new GridBagConstraints();
        gridBagConstraints9.insets = new Insets(0, 0, 0, 5);
        gridBagConstraints9.gridx = 0;
        gridBagConstraints9.anchor = GridBagConstraints.EAST;
        gridBagConstraints9.gridy = 11;
        jLabel4 = new JLabel();
        jLabel4.setText("Subspecies");
        GridBagConstraints gridBagConstraints8 = new GridBagConstraints();
        gridBagConstraints8.insets = new Insets(0, 0, 0, 5);
        gridBagConstraints8.gridx = 0;
        gridBagConstraints8.anchor = GridBagConstraints.EAST;
        gridBagConstraints8.gridy = 10;
        jLabel3 = new JLabel();
        jLabel3.setText("Species");
        GridBagConstraints gridBagConstraints7 = new GridBagConstraints();
        gridBagConstraints7.insets = new Insets(0, 0, 0, 0);
        gridBagConstraints7.fill = GridBagConstraints.BOTH;
        gridBagConstraints7.gridy = 20;
        gridBagConstraints7.weightx = 1.0;
        gridBagConstraints7.anchor = GridBagConstraints.WEST;
        gridBagConstraints7.gridwidth = 7;
        gridBagConstraints7.gridx = 1;
        GridBagConstraints gridBagConstraints5 = new GridBagConstraints();
        gridBagConstraints5.insets = new Insets(0, 0, 0, 5);
        gridBagConstraints5.fill = GridBagConstraints.BOTH;
        gridBagConstraints5.gridy = 11;
        gridBagConstraints5.weightx = 1.0;
        gridBagConstraints5.anchor = GridBagConstraints.WEST;
        gridBagConstraints5.gridwidth = 2;
        gridBagConstraints5.gridx = 1;
        GridBagConstraints gridBagConstraints4 = new GridBagConstraints();
        gridBagConstraints4.insets = new Insets(0, 0, 0, 5);
        gridBagConstraints4.fill = GridBagConstraints.BOTH;
        gridBagConstraints4.gridy = 10;
        gridBagConstraints4.weightx = 1.0;
        gridBagConstraints4.anchor = GridBagConstraints.WEST;
        gridBagConstraints4.gridwidth = 2;
        gridBagConstraints4.gridx = 1;
        GridBagConstraints gridBagConstraints3 = new GridBagConstraints();
        gridBagConstraints3.insets = new Insets(0, 0, 0, 5);
        gridBagConstraints3.fill = GridBagConstraints.BOTH;
        gridBagConstraints3.gridy = 9;
        gridBagConstraints3.weightx = 1.0;
        gridBagConstraints3.anchor = GridBagConstraints.WEST;
        gridBagConstraints3.gridwidth = 2;
        gridBagConstraints3.gridx = 1;
        GridBagConstraints gridBagConstraints2 = new GridBagConstraints();
        gridBagConstraints2.insets = new Insets(0, 0, 0, 5);
        gridBagConstraints2.gridx = 0;
        gridBagConstraints2.anchor = GridBagConstraints.EAST;
        gridBagConstraints2.gridy = 9;
        jLabel2 = new JLabel();
        jLabel2.setText("Genus");
        GridBagConstraints gridBagConstraints11 = new GridBagConstraints();
        gridBagConstraints11.gridx = 0;
        gridBagConstraints11.gridy = 1;
        GridBagConstraints gridBagConstraints1 = new GridBagConstraints();
        gridBagConstraints1.insets = new Insets(0, 0, 0, 5);
        gridBagConstraints1.fill = GridBagConstraints.BOTH;
        gridBagConstraints1.gridy = 0;
        gridBagConstraints1.weightx = 1.0;
        gridBagConstraints1.anchor = GridBagConstraints.WEST;
        gridBagConstraints1.gridx = 1;
        GridBagConstraints gridBagConstraints = new GridBagConstraints();
        gridBagConstraints.insets = new Insets(0, 0, 0, 5);
        gridBagConstraints.gridx = 0;
        gridBagConstraints.anchor = GridBagConstraints.EAST;
        gridBagConstraints.gridy = 0;
        jLabel = new JLabel();
        jLabel.setText("Barcode");
        jPanel = new JPanel();
        GridBagLayout gbl_jPanel = new GridBagLayout();
        gbl_jPanel.rowWeights = new double[] { 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0,
                0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0,
                0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 };
        gbl_jPanel.rowHeights = new int[] { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
                32, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
        gbl_jPanel.columnWidths = new int[] { 0, 0, 0, 0, 0, 0, 0, 0 };
        gbl_jPanel.columnWeights = new double[] { 0.0, 1.0, 0.0, 0.0, 1.0, 0.0, 1.0, 1.0 };
        jPanel.setLayout(gbl_jPanel);
        jPanel.add(jLabel, gridBagConstraints);
        jPanel.add(getJTextFieldBarcode(), gridBagConstraints1);
        jPanel.add(jLabel2, gridBagConstraints2);
        jPanel.add(getJTextField1(), gridBagConstraints3);
        GridBagConstraints gbc_lblNatureofid = new GridBagConstraints();
        gbc_lblNatureofid.anchor = GridBagConstraints.EAST;
        gbc_lblNatureofid.insets = new Insets(0, 0, 0, 5);
        gbc_lblNatureofid.gridx = 3;
        gbc_lblNatureofid.gridy = 9;
        jPanel.add(getLblNatureofid(), gbc_lblNatureofid);

        jComboBoxNatureOfId = getJComboBoxNatureOfId();
        GridBagConstraints gbc_jTextFieldNatureOfID = new GridBagConstraints();
        gbc_jTextFieldNatureOfID.gridwidth = 4;
        gbc_jTextFieldNatureOfID.insets = new Insets(0, 0, 0, 0);
        gbc_jTextFieldNatureOfID.fill = GridBagConstraints.HORIZONTAL;
        gbc_jTextFieldNatureOfID.gridx = 4;
        gbc_jTextFieldNatureOfID.gridy = 9;
        jPanel.add(jComboBoxNatureOfId, gbc_jTextFieldNatureOfID);
        jPanel.add(getJTextField12(), gridBagConstraints4);
        GridBagConstraints gbc_lblIdDate = new GridBagConstraints();
        gbc_lblIdDate.anchor = GridBagConstraints.EAST;
        gbc_lblIdDate.insets = new Insets(0, 0, 0, 5);
        gbc_lblIdDate.gridx = 3;
        gbc_lblIdDate.gridy = 10;
        jPanel.add(getLblIdDate(), gbc_lblIdDate);

        jTextFieldDateDetermined = getJTextFieldDateDetermined();
        GridBagConstraints gbc_jTextFieldDateDetermined = new GridBagConstraints();
        gbc_jTextFieldDateDetermined.gridwidth = 4;
        gbc_jTextFieldDateDetermined.insets = new Insets(0, 0, 0, 0);
        gbc_jTextFieldDateDetermined.fill = GridBagConstraints.HORIZONTAL;
        gbc_jTextFieldDateDetermined.gridx = 4;
        gbc_jTextFieldDateDetermined.gridy = 10;
        jPanel.add(jTextFieldDateDetermined, gbc_jTextFieldDateDetermined);
        jTextFieldDateDetermined.setColumns(10);
        jPanel.add(getJTextField2(), gridBagConstraints5);

        JLabel lblIdBy = new JLabel("Id By");
        GridBagConstraints gbc_lblIdBy = new GridBagConstraints();
        gbc_lblIdBy.anchor = GridBagConstraints.EAST;
        gbc_lblIdBy.insets = new Insets(0, 0, 0, 5);
        gbc_lblIdBy.gridx = 3;
        gbc_lblIdBy.gridy = 11;
        jPanel.add(lblIdBy, gbc_lblIdBy);

        jCBDeterminer = getJCBDeterminer();
        GridBagConstraints gbc_jTextFieldDeterminer = new GridBagConstraints();
        gbc_jTextFieldDeterminer.gridwidth = 4;
        gbc_jTextFieldDeterminer.insets = new Insets(0, 0, 0, 0);
        gbc_jTextFieldDeterminer.fill = GridBagConstraints.HORIZONTAL;
        gbc_jTextFieldDeterminer.gridx = 4;
        gbc_jTextFieldDeterminer.gridy = 11;
        jPanel.add(jCBDeterminer, gbc_jTextFieldDeterminer);

        GridBagConstraints gbc_lblIdRemarks = new GridBagConstraints();
        gbc_lblIdRemarks.anchor = GridBagConstraints.EAST;
        gbc_lblIdRemarks.insets = new Insets(0, 0, 0, 5);
        gbc_lblIdRemarks.gridx = 3;
        gbc_lblIdRemarks.gridy = 13;
        jPanel.add(getLblIdRemarks(), gbc_lblIdRemarks);

        jTextFieldIdRemarks = getJTextFieldIdRemarks();
        GridBagConstraints gbc_jTextFieldIdRemarks = new GridBagConstraints();
        gbc_jTextFieldIdRemarks.insets = new Insets(0, 0, 0, 0);
        gbc_jTextFieldIdRemarks.fill = GridBagConstraints.HORIZONTAL;
        gbc_jTextFieldIdRemarks.gridx = 4;
        gbc_jTextFieldIdRemarks.gridy = 13;
        gbc_jTextFieldIdRemarks.gridwidth = 4;
        jPanel.add(jTextFieldIdRemarks, gbc_jTextFieldIdRemarks);
        jTextFieldIdRemarks.setColumns(10);
        GridBagConstraints gbc_lblTypestatus = new GridBagConstraints();
        gbc_lblTypestatus.anchor = GridBagConstraints.EAST;
        gbc_lblTypestatus.insets = new Insets(0, 0, 0, 5);
        gbc_lblTypestatus.gridx = 3;
        gbc_lblTypestatus.gridy = 14;
        jPanel.add(getLblTypestatus(), gbc_lblTypestatus);
        cbTypeStatus = getCbTypeStatus();
        GridBagConstraints gbc_cbTypeStatus = new GridBagConstraints();
        gbc_cbTypeStatus.gridwidth = 4;
        gbc_cbTypeStatus.insets = new Insets(0, 0, 0, 5);
        gbc_cbTypeStatus.fill = GridBagConstraints.HORIZONTAL;
        gbc_cbTypeStatus.gridx = 4;
        gbc_cbTypeStatus.gridy = 14;
        jPanel.add(cbTypeStatus, gbc_cbTypeStatus);
        GridBagConstraints gbc_lblHigherGeography = new GridBagConstraints();
        gbc_lblHigherGeography.anchor = GridBagConstraints.EAST;
        gbc_lblHigherGeography.insets = new Insets(0, 0, 0, 5);
        gbc_lblHigherGeography.gridx = 0;
        gbc_lblHigherGeography.gridy = 17;
        jPanel.add(getLblHigherGeography(), gbc_lblHigherGeography);
        GridBagConstraints gbc_comboBoxElevUnits = new GridBagConstraints();
        gbc_comboBoxElevUnits.insets = new Insets(0, 0, 0, 0);
        gbc_comboBoxElevUnits.gridwidth = 7;
        gbc_comboBoxElevUnits.fill = GridBagConstraints.HORIZONTAL;
        gbc_comboBoxElevUnits.gridx = 1;
        gbc_comboBoxElevUnits.gridy = 17;
        jPanel.add(getComboBoxHighGeog(), gbc_comboBoxElevUnits);
        GridBagConstraints gbc_lblTo = new GridBagConstraints();
        gbc_lblTo.insets = new Insets(0, 0, 0, 5);
        gbc_lblTo.anchor = GridBagConstraints.EAST;
        gbc_lblTo.gridx = 5;
        gbc_lblTo.gridy = 19;
        jPanel.add(getLblTo(), gbc_lblTo);
        GridBagConstraints gbc_textFieldMaxElev = new GridBagConstraints();
        gbc_textFieldMaxElev.insets = new Insets(0, 0, 0, 5);
        gbc_textFieldMaxElev.fill = GridBagConstraints.BOTH;
        gbc_textFieldMaxElev.gridx = 6;
        gbc_textFieldMaxElev.gridy = 19;
        jPanel.add(getTextFieldMaxElev(), gbc_textFieldMaxElev);
        GridBagConstraints gbc_comboBoxMaxElev = new GridBagConstraints();
        gbc_comboBoxMaxElev.insets = new Insets(0, 0, 0, 0);
        gbc_comboBoxMaxElev.fill = GridBagConstraints.HORIZONTAL;
        gbc_comboBoxMaxElev.gridx = 7;
        gbc_comboBoxMaxElev.gridy = 19;
        jPanel.add(getComboBoxElevUnits(), gbc_comboBoxMaxElev);
        jPanel.add(getJTextField3(), gridBagConstraints7);
        jPanel.add(jLabel3, gridBagConstraints8);
        jPanel.add(jLabel4, gridBagConstraints9);
        GridBagConstraints gridBagConstraints28 = new GridBagConstraints();
        gridBagConstraints28.gridwidth = 4;
        gridBagConstraints28.insets = new Insets(0, 0, 0, 5);
        gridBagConstraints28.gridx = 3;
        gridBagConstraints28.anchor = GridBagConstraints.WEST;
        gridBagConstraints28.fill = GridBagConstraints.NONE;
        gridBagConstraints28.gridy = 22;
        jLabel33 = new JLabel();
        jLabel33.setText("Collecting Method");
        jPanel.add(jLabel33, gridBagConstraints28);
        GridBagConstraints gbc_georef = new GridBagConstraints();
        gbc_georef.insets = new Insets(0, 0, 0, 0);
        gbc_georef.gridwidth = 5;
        gbc_georef.fill = GridBagConstraints.HORIZONTAL;
        gbc_georef.gridx = 3;
        gbc_georef.gridy = 24;
        GridBagConstraints gridBagConstraints72 = new GridBagConstraints();
        gridBagConstraints72.insets = new Insets(0, 0, 0, 5);
        gridBagConstraints72.gridx = 0;
        gridBagConstraints72.anchor = GridBagConstraints.EAST;
        gridBagConstraints72.gridy = 28;
        jLabel19 = new JLabel();
        jLabel19.setText("Features");
        jPanel.add(jLabel19, gridBagConstraints72);
        GridBagConstraints gridBagConstraints17 = new GridBagConstraints();
        gridBagConstraints17.insets = new Insets(0, 0, 0, 5);
        gridBagConstraints17.fill = GridBagConstraints.VERTICAL;
        gridBagConstraints17.gridy = 28;
        gridBagConstraints17.weightx = 1.0;
        gridBagConstraints17.anchor = GridBagConstraints.WEST;
        gridBagConstraints17.gridx = 1;
        jPanel.add(getJComboBoxFeatures(), gridBagConstraints17);
        GridBagConstraints gridBagConstraints104 = new GridBagConstraints();
        gridBagConstraints104.insets = new Insets(0, 0, 0, 5);
        gridBagConstraints104.gridx = 3;
        gridBagConstraints104.anchor = GridBagConstraints.EAST;
        gridBagConstraints104.gridy = 28;
        jLabel37 = new JLabel();
        jLabel37.setText("Prep Type");
        jPanel.add(jLabel37, gridBagConstraints104);
        GridBagConstraints gridBagConstraints152 = new GridBagConstraints();
        gridBagConstraints152.insets = new Insets(0, 0, 0, 0);
        gridBagConstraints152.fill = GridBagConstraints.BOTH;
        gridBagConstraints152.gridy = 28;
        gridBagConstraints152.weightx = 1.0;
        gridBagConstraints152.anchor = GridBagConstraints.WEST;
        gridBagConstraints152.gridwidth = 4;
        gridBagConstraints152.gridx = 4;
        jPanel.add(getJTextFieldPrepType(), gridBagConstraints152);

        GridBagConstraints gridBagConstraintsPR = new GridBagConstraints();
        gridBagConstraintsPR.insets = new Insets(0, 0, 0, 0);
        gridBagConstraintsPR.gridx = 0;
        gridBagConstraintsPR.fill = GridBagConstraints.BOTH;
        gridBagConstraintsPR.gridwidth = 8;
        gridBagConstraintsPR.weighty = 1.0;
        gridBagConstraintsPR.gridy = 29;

        jPanel.add(getJScrollPaneSpecimenParts(), gridBagConstraintsPR);
        GridBagConstraints gbc_lblMicrohabitat = new GridBagConstraints();
        gbc_lblMicrohabitat.anchor = GridBagConstraints.EAST;
        gbc_lblMicrohabitat.insets = new Insets(0, 0, 0, 5);
        gbc_lblMicrohabitat.gridx = 0;
        gbc_lblMicrohabitat.gridy = 34;
        jPanel.add(getLblMicrohabitat(), gbc_lblMicrohabitat);
        GridBagConstraints gbc_textField = new GridBagConstraints();
        gbc_textField.insets = new Insets(0, 0, 0, 5);
        gbc_textField.fill = GridBagConstraints.HORIZONTAL;
        gbc_textField.gridx = 1;
        gbc_textField.gridy = 34;
        jPanel.add(getTextField(), gbc_textField);
        jPanel.add(getJButton(), gridBagConstraints10);
        jPanel.add(jLabel5, gridBagConstraints21);
        jPanel.add(getJTextFieldCollection(), gridBagConstraints31);
        jPanel.add(jLabel6, gridBagConstraints41);
        jPanel.add(getJTextField14(), gridBagConstraints12);
        jPanel.add(getJScrollPaneCollectors(), gridBagConstraints51);
        jPanel.add(jLabel7, gridBagConstraints22);
        jPanel.add(jLabel8, gridBagConstraints13);
        jPanel.add(getJTextFieldDateUpdated(), gridBagConstraints23);
        jPanel.add(getJTextField22(), gridBagConstraints14);
        jPanel.add(jLabel9, gridBagConstraints24);
        jPanel.add(getJTextField32(), gridBagConstraints32);
        jPanel.add(jLabel10, gridBagConstraints42);
        jPanel.add(jLabel11, gridBagConstraints15);
        jPanel.add(getJScrollPaneNumbers(), gridBagConstraints25);
        jPanel.add(getJButtonNumbersAdd(), gridBagConstraints33);
        jPanel.add(getJButtonCollsAdd(), gridBagConstraints43);
        jPanel.add(getJScrollPaneWarn(), gridBagConstraints52);
        jPanel.add(jLabel12, gridBagConstraints61);
        jPanel.add(getJTextField(), gridBagConstraints71);
        jPanel.add(jLabel13, gridBagConstraints81);
        jPanel.add(jLabel14, gridBagConstraints91);
        jPanel.add(jLabel15, gridBagConstraints101);
        jPanel.add(getJTextField4(), gridBagConstraints111);
        jPanel.add(getJTextField13(), gridBagConstraints121);
        jPanel.add(getJTextField23(), gridBagConstraints131);
        jPanel.add(jLabel16, gridBagConstraints16);
        jPanel.add(jLabel17, gridBagConstraints26);
        jPanel.add(jLabelTribe, gbc_jLabelTribe);
        jPanel.add(getJTextField5(), gridBagConstraints44);
        jPanel.add(getJTextFieldSubfamily(), gridBagConstraints53);
        jPanel.add(getJTextFieldTribe(), gridBagConstraints62);
        jPanel.add(jLabel20, gridBagConstraints82);
        jPanel.add(jLabel21, gridBagConstraints92);
        jPanel.add(getJComboBoxSex(), gridBagConstraints102);
        jPanel.add(getJComboBoxLifeStage(), gridBagConstraints27);
        jPanel.add(jLabel22, gridBagConstraints35);
        jPanel.add(getJTextFieldVerbatimDate(), gridBagConstraints63);
        jPanel.add(jLabel27, gridBagConstraints110);
        jPanel.add(jLabel29, gridBagConstraints112);
        jPanel.add(getJTextFieldAuthorship(), gridBagConstraints210);
        jPanel.add(jLabel30, gridBagConstraints36);
        jPanel.add(getJTextFieldUnnamedForm(), gridBagConstraints46);
        jPanel.add(jLabel28, gridBagConstraints74);
        jPanel.add(getJTextFieldInfraspecificRank(), gridBagConstraints84);
        jPanel.add(getJTextFieldInfraspecificName(), gridBagConstraints93);
        jPanel.add(jLabel25, gridBagConstraints103);
        jPanel.add(jLabel26, gridBagConstraints113);
        jPanel.add(getJTextFieldDateEmergedIndicator(), gridBagConstraints122);
        jPanel.add(getJTextFieldDateCollectedIndicator(), gridBagConstraints132);
        jPanel.add(getJTextFieldDateEmerged(), gridBagConstraints141);
        jPanel.add(getJTextFieldDateCollected(), gridBagConstraints151);
        jPanel.add(jLabelElevation, gbc_jLabelElevation);
        jPanel.add(getJTextField11(), gridBagConstraints18);
        jPanel.add(getJTextFieldCollectingMethod(), gridBagConstraints19);
        jPanel.add(getJButtonGeoreference(), gbc_georef);
        jPanel.add(jLabel34, gridBagConstraints47);
        jPanel.add(jLabel35, gridBagConstraints65);
        jPanel.add(getJCheckBox(), gridBagConstraints83);
        jPanel.add(jLabel36, gridBagConstraints94);
        jPanel.add(jLabel38, gridBagConstraints114);
        jPanel.add(jLabel39, gridBagConstraints123);
        jPanel.add(jLabel40, gridBagConstraints133);
        jPanel.add(getJTextField20(), gridBagConstraints142);
        jPanel.add(getJTextField26(), gridBagConstraints162);
        jPanel.add(getJTextFieldHabitat(), gridBagConstraints172);
        jPanel.add(jLabel41, gridBagConstraints115);
        jPanel.add(getJComboBoxWorkflowStatus(), gridBagConstraints29);
        jPanel.add(jLabel42, gridBagConstraints37);
        jPanel.add(getJComboBox2(), gridBagConstraints48);
        jPanel.add(jLabel43, gridBagConstraints56);
        jPanel.add(getJTextFieldInferences(), gridBagConstraintsInfer);
        jPanel.add(getJButton1(), gridBagConstraints116);
        jPanel.add(getJPanel1(), gridBagConstraints211);
        jPanel.add(getJTextFieldISODate(), gridBagConstraints117);
        jPanel.add(getJButtonDets(), gridBagConstraints212);
        jPanel.add(jLabel31, gridBagConstraints118);
        jPanel.add(getJTextField9(), gridBagConstraints213);
        jPanel.add(getJButtonNext(), gridBagConstraints119);
        jPanel.add(getJButtonPrevious(), gridBagConstraints214);
        jPanel.add(getJScrollPaneNotes(), gridBagConstraints49);
        jPanel.add(jLabel44, gridBagConstraints120);
        jPanel.add(getJButton13(), gridBagConstraints215);
        jPanel.add(getJButton2(), gridBagConstraints38);
        jPanel.add(getJButtonSpecificLocality(), gridBagConstraints124);
        jPanel.add(getJTextFieldImgCount(), gridBagConstraintsImgCount);
        jPanel.add(getJLabelMigrationStatus(), gridBagConstraintsMS);
    }
    return jPanel;
}

From source file:net.java.sip.communicator.impl.gui.main.chat.ChatWritePanel.java

/**
 * Indicates that a new plugin component has been added. Adds it to this
 * container if it belongs to it.//  w w  w .ja va  2s  .c om
 *
 * @param event the <tt>PluginComponentEvent</tt> that notified us
 */
public void pluginComponentAdded(PluginComponentEvent event) {
    PluginComponentFactory factory = event.getPluginComponentFactory();
    if (!factory.getContainer()
            .equals(net.java.sip.communicator.service.gui.Container.CONTAINER_CHAT_WRITE_PANEL))
        return;

    PluginComponent component = factory.getPluginComponentInstance(this);
    this.pluginComponents.add(component);

    ChatSession chatSession = chatPanel.getChatSession();
    if (chatSession != null) {
        ChatTransport currentTransport = chatSession.getCurrentChatTransport();
        Object currentDescriptor = currentTransport.getDescriptor();
        if (currentDescriptor instanceof Contact) {
            Contact contact = (Contact) currentDescriptor;

            component.setCurrentContact(contact, currentTransport.getResourceName());
        }
    }

    GridBagConstraints constraints = new GridBagConstraints();

    constraints.anchor = GridBagConstraints.NORTHEAST;
    constraints.fill = GridBagConstraints.NONE;
    constraints.gridy = 0;
    constraints.gridheight = 1;
    constraints.weightx = 0f;
    constraints.weighty = 0f;
    constraints.insets = new Insets(0, 3, 0, 0);
    centerPanel.add((Component) component.getComponent(), constraints);

    this.centerPanel.repaint();
}