Example usage for com.jgoodies.forms.layout FormLayout FormLayout

List of usage examples for com.jgoodies.forms.layout FormLayout FormLayout

Introduction

In this page you can find the example usage for com.jgoodies.forms.layout FormLayout FormLayout.

Prototype

public FormLayout(ColumnSpec[] colSpecs, RowSpec[] rowSpecs) 

Source Link

Document

Constructs a FormLayout using the given column and row specifications.

Usage

From source file:ambit2.ui.table.PageNavigator.java

License:Open Source License

public JComponent buildPanel(final IPageNavigator pageable) {
    FormLayout layout = new FormLayout(
            "pref, 1dlu,pref,1dlu, fill:25dlu:grow,1dlu,pref, 1dlu,fill:25dlu:grow,1dlu,pref, 1dlu,pref, 1dlu,fill:25dlu:grow",
            "pref");

    PresentationModel<IPageNavigator> presentationModel = new PresentationModel<IPageNavigator>(pageable);

    label = new JLabel("Page");
    currentPage = BasicComponentFactory/*from  w w w. j  a v a  2s. c o  m*/
            .createIntegerField(presentationModel.getModel(IPageNavigator.PROPERTY_PAGE));
    currentPage.setToolTipText("Current page");

    allPages = BasicComponentFactory
            .createIntegerField(presentationModel.getModel(IPageNavigator.PROPERTY_MAXPAGES));
    allPages.setToolTipText("All pages");
    allPages.setEditable(false);

    pageSize = BasicComponentFactory
            .createIntegerField(presentationModel.getModel(IPageNavigator.PROPERTY_PAGESIZE));
    pageSize.setToolTipText("Records per page");

    prevPage = new JButton(new AbstractAmbitAction("<", "images/resultset_previous.png", "Previous page") {
        public void actionPerformed(ActionEvent e) {
            pageable.previousPage();
        }
    });
    nextPage = new JButton(new AbstractAmbitAction("<", "images/resultset_next.png", "Next page") {
        public void actionPerformed(ActionEvent e) {
            pageable.nextPage();
        }
    });
    PanelBuilder panel = new PanelBuilder(layout);
    CellConstraints cc = new CellConstraints();
    //"pref, 1dlu,pref,1dlu,fill:25dlu:grow,1dlu,pref, 1dlu,fill:25dlu:grow, 1dlu,pref, 1dlu,fill:25dlu:grow",        
    panel.add(label, cc.xy(1, 1));
    panel.add(prevPage, cc.xy(3, 1));
    panel.add(currentPage, cc.xy(5, 1));
    panel.add(new JLabel("/"), cc.xy(7, 1));
    panel.add(allPages, cc.xy(9, 1));
    panel.add(nextPage, cc.xy(11, 1));
    panel.add(pageSize, cc.xy(13, 1));

    return panel.getPanel();
}

From source file:ambit2.ui.table.RecordNavigator.java

License:Open Source License

public JComponent buildPanel(final IRecordNavigator navigator) {
    FormLayout layout = new FormLayout(
            "pref, 1dlu,pref,1dlu,fill:25dlu:grow,1dlu,pref,1dlu,fill:25dlu:grow,1dlu,pref", "pref");

    PresentationModel<IRecordNavigator> presentationModel = new PresentationModel<IRecordNavigator>(navigator);

    label = new JLabel("Record");
    currentPage = BasicComponentFactory//ww  w.j  a v a  2 s.c  o m
            .createIntegerField(presentationModel.getModel(IRecordNavigator.PROPERTY_RECORD));
    currentPage.setToolTipText("Current record");
    allPages = BasicComponentFactory
            .createIntegerField(presentationModel.getModel(IRecordNavigator.PROPERTY_MAXRECORDS));
    allPages.setToolTipText("All pages");
    allPages.setEditable(false);
    prevPage = new JButton(new AbstractAmbitAction("<", "images/resultset_previous.png", "Previous record") {
        public void actionPerformed(ActionEvent e) {
            navigator.prev();
        }
    });
    nextPage = new JButton(new AbstractAmbitAction(">", "images/resultset_next.png", "Next record") {
        public void actionPerformed(ActionEvent e) {
            navigator.next();
        }
    });
    PanelBuilder panel = new PanelBuilder(layout);
    CellConstraints cc = new CellConstraints();
    panel.add(label, cc.xy(1, 1));
    panel.add(prevPage, cc.xy(3, 1));
    panel.add(currentPage, cc.xy(5, 1));
    panel.add(new JLabel("/"), cc.xy(7, 1));
    panel.add(allPages, cc.xy(9, 1));
    panel.add(nextPage, cc.xy(11, 1));

    return panel.getPanel();
}

From source file:anl.verdi.area.AreaFilePanel.java

private void initComponents() {
    Logger.debug("in AreaFilePanel.initComponents");
    // JFormDesigner - Component initialization - DO NOT MODIFY  //GEN-BEGIN:initComponents
    // Generated using JFormDesigner non-commercial license
    areaFilesPanel = new JPanel();
    areaFiles = new JPanel();
    btnAdd = new JButton();
    btnDelete = new JButton();
    scrollPaneAreaFiles = new JScrollPane();
    areaFileList = new JList();
    areasPanel = new JPanel();
    scrollPane6 = new JScrollPane();
    areaList = new JList();
    CellConstraints cc = new CellConstraints();

    //======== this ========
    setLayout(new FormLayout("pref:grow", "fill:default:grow"));

    //======== areaFilesPanel ========
    {/*w w w.  ja v  a  2 s  .  c o m*/
        areaFilesPanel.setBorder(null);
        // 2014 - underlying jgoodies class changed
        ColumnSpec[] aColumnSpec = ColumnSpec.decodeSpecs("pref:grow");
        RowSpec[] aRowSpec = RowSpec.decodeSpecs("fill:max(pref;125dlu):grow");
        areaFilesPanel.setLayout(new FormLayout(aColumnSpec,
                new RowSpec[] { new RowSpec(Sizes.dluY(108)), new RowSpec(Sizes.dluY(92)),
                        FormFactory.PREF_ROWSPEC, FormFactory.LINE_GAP_ROWSPEC, FormFactory.PREF_ROWSPEC,
                        FormFactory.LINE_GAP_ROWSPEC, aRowSpec[0] }));

        //         areaFilesPanel.setLayout(new FormLayout(
        //               ColumnSpec.decodeSpecs("pref:grow"),
        //               new RowSpec[] {
        //                  new RowSpec(Sizes.dluY(108)),
        //                  new RowSpec(Sizes.dluY(92)),
        //                  FormFactory.PREF_ROWSPEC,
        //                  FormFactory.LINE_GAP_ROWSPEC,
        //                  FormFactory.PREF_ROWSPEC,
        //                  FormFactory.LINE_GAP_ROWSPEC,
        //                  new RowSpec("fill:max(pref;125dlu):grow")
        //               }));

        //======== areaFiles ========
        {
            areaFiles.setBorder(new TitledBorder("Area Files"));
            // 2014
            ColumnSpec bColumnSpec = new ColumnSpec(ColumnSpec.FILL, Sizes.DEFAULT, FormSpec.DEFAULT_GROW);
            RowSpec bRowSpec = new RowSpec(RowSpec.FILL, Sizes.DEFAULT, FormSpec.DEFAULT_GROW);
            areaFiles.setLayout(new FormLayout(
                    new ColumnSpec[] { FormFactory.DEFAULT_COLSPEC, FormFactory.RELATED_GAP_COLSPEC,
                            FormFactory.DEFAULT_COLSPEC, bColumnSpec },
                    new RowSpec[] { FormFactory.DEFAULT_ROWSPEC, FormFactory.RELATED_GAP_ROWSPEC, bRowSpec }));
            //            areaFiles.setLayout(new FormLayout(
            //                  new ColumnSpec[] {
            //                        FormFactory.DEFAULT_COLSPEC,
            //                        FormFactory.RELATED_GAP_COLSPEC,
            //                        FormFactory.DEFAULT_COLSPEC,
            //                        new ColumnSpec(ColumnSpec.FILL, Sizes.DEFAULT, FormSpec.DEFAULT_GROW)
            //                  },
            //                  new RowSpec[] {
            //                        FormFactory.DEFAULT_ROWSPEC,
            //                        FormFactory.RELATED_GAP_ROWSPEC,
            //                        new RowSpec(RowSpec.FILL, Sizes.DEFAULT, FormSpec.DEFAULT_GROW)
            //                  }));

            // 2014 set up file names
            String verdiHome = Tools.getVerdiHome(); // 2014 new method for reading in an image file
            String separator = "/"; // use forward slash only for constructor ImageIcon(String filename);
            String pathName = verdiHome + separator + "plugins" + separator + "core" + separator + "icons"
                    + separator;

            //---- btnAdd ----
            String filePlus = new String(pathName + "plus.png");
            //            btnAdd.setIcon(new ImageIcon(getClass().getResource("/plus.png")));
            btnAdd.setIcon(new ImageIcon(filePlus));
            btnAdd.setToolTipText("Add Area File");
            areaFiles.add(btnAdd, cc.xy(1, 1));

            //---- btnDelete ----
            String fileMinus = new String(pathName + "Minus.png");
            //            btnDelete.setIcon(new ImageIcon(getClass().getResource("/minus.png")));
            btnDelete.setIcon(new ImageIcon(fileMinus));
            btnDelete.setToolTipText("Delete Area File");
            areaFiles.add(btnDelete, cc.xy(3, 1));

            //======== scrollPaneAreaFiles ========
            {

                //---- areaFileList ----
                areaFileList.setSelectedIndex(0);
                areaFileList.setMaximumSize(new Dimension(300, 100));
                areaFileList.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
                areaFileList.setPrototypeCellValue("RADM_CONC_!");
                scrollPaneAreaFiles.setViewportView(areaFileList);
            }
            areaFiles.add(scrollPaneAreaFiles, cc.xywh(1, 3, 4, 1));
        }
        areaFilesPanel.add(areaFiles, cc.xy(1, 1));

        //======== areasPanel ========
        {
            areasPanel.setBorder(new TitledBorder("Areas"));
            areasPanel.setLayout(new BorderLayout());

            //======== scrollPane6 ========
            {

                //---- areaList ----
                areaList.setPrototypeCellValue("O3[1]");
                scrollPane6.setViewportView(areaList);
            }
            areasPanel.add(scrollPane6, BorderLayout.CENTER);
        }
        areaFilesPanel.add(areasPanel, cc.xywh(1, 2, 1, 6));
    }
    add(areaFilesPanel, cc.xy(1, 1));
    // JFormDesigner - End of component initialization  //GEN-END:initComponents
}

From source file:anl.verdi.area.target.FormulaDialog.java

private void initComponents() {
    // JFormDesigner - Component initialization - DO NOT MODIFY  //GEN-BEGIN:initComponents
    // Generated using JFormDesigner non-commercial license
    DefaultComponentFactory compFactory = DefaultComponentFactory.getInstance();
    dialogPane = new JPanel();
    contentPanel = new JPanel();
    separator2 = compFactory.createSeparator("View Area Values for the Selected Formulas");
    label2 = new JLabel();
    radioButton1 = new JRadioButton();
    radioButton2 = new JRadioButton();
    label1 = new JLabel();
    scrollPane1 = new JScrollPane();
    formulaList = new JList();
    buttonBar = new JPanel();
    separator1 = new JSeparator();
    errorMessage = new JLabel();
    okButton = new JButton();
    cancelButton = new JButton();
    CellConstraints cc = new CellConstraints();

    //======== this ========
    setModal(true);/*w  ww  .j  a v  a 2  s. c om*/
    setTitle("Area Information");
    Container contentPane = getContentPane();
    contentPane.setLayout(new BorderLayout());

    //======== dialogPane ========
    {
        dialogPane.setBorder(Borders.DIALOG_BORDER);
        dialogPane.setMinimumSize(new Dimension(445, 400));
        dialogPane.setLayout(new BorderLayout());

        //======== contentPanel ========
        {
            contentPanel.setPreferredSize(new Dimension(400, 75));
            contentPanel.setMinimumSize(new Dimension(423, 75));

            // 2014 - underlyaing jgoodies class changed
            ColumnSpec[] aColumnSpec = ColumnSpec.decodeSpecs("min(min;5dlu):grow");
            ColumnSpec[] bColumnSpec = ColumnSpec.decodeSpecs("max(min;75dlu)");

            contentPanel.setLayout(new FormLayout(
                    new ColumnSpec[] { FormFactory.DEFAULT_COLSPEC, FormFactory.PREF_COLSPEC, aColumnSpec[0],
                            FormFactory.LABEL_COMPONENT_GAP_COLSPEC, FormFactory.LABEL_COMPONENT_GAP_COLSPEC,
                            FormFactory.DEFAULT_COLSPEC, FormFactory.LABEL_COMPONENT_GAP_COLSPEC,
                            FormFactory.LABEL_COMPONENT_GAP_COLSPEC, FormFactory.RELATED_GAP_COLSPEC,
                            FormFactory.LABEL_COMPONENT_GAP_COLSPEC, bColumnSpec[0],
                            FormFactory.LABEL_COMPONENT_GAP_COLSPEC, FormFactory.DEFAULT_COLSPEC },
                    new RowSpec[] { FormFactory.DEFAULT_ROWSPEC, FormFactory.LINE_GAP_ROWSPEC,
                            FormFactory.DEFAULT_ROWSPEC, FormFactory.LINE_GAP_ROWSPEC,
                            FormFactory.DEFAULT_ROWSPEC }));
            //            contentPanel.setLayout(new FormLayout(
            //                  new ColumnSpec[] {
            //                        FormFactory.DEFAULT_COLSPEC,
            //                        FormFactory.PREF_COLSPEC,
            //                        new ColumnSpec("min(min;5dlu):grow"),
            //                        FormFactory.LABEL_COMPONENT_GAP_COLSPEC,
            //                        FormFactory.LABEL_COMPONENT_GAP_COLSPEC,
            //                        FormFactory.DEFAULT_COLSPEC,
            //                        FormFactory.LABEL_COMPONENT_GAP_COLSPEC,
            //                        FormFactory.LABEL_COMPONENT_GAP_COLSPEC,
            //                        FormFactory.RELATED_GAP_COLSPEC,
            //                        FormFactory.LABEL_COMPONENT_GAP_COLSPEC,
            //                        new ColumnSpec("max(min;75dlu)"),
            //                        FormFactory.LABEL_COMPONENT_GAP_COLSPEC,
            //                        FormFactory.DEFAULT_COLSPEC
            //                  },
            //                  new RowSpec[] {
            //                        FormFactory.DEFAULT_ROWSPEC,
            //                        FormFactory.LINE_GAP_ROWSPEC,
            //                        FormFactory.DEFAULT_ROWSPEC,
            //                        FormFactory.LINE_GAP_ROWSPEC,
            //                        FormFactory.DEFAULT_ROWSPEC
            //                  }));
            contentPanel.add(separator2, cc.xywh(1, 1, 13, 1));

            //---- label2 ----
            label2.setText("Areas:");
            contentPanel.add(label2, cc.xy(1, 3));

            //---- radioButton1 ----
            radioButton1.setText("Selected");
            radioButton1.setSelected(true);
            contentPanel.add(radioButton1, cc.xy(2, 3));

            //---- radioButton2 ----
            radioButton2.setText("All");
            contentPanel.add(radioButton2, cc.xywh(3, 3, 9, 1));

            //---- label1 ----
            label1.setText("Formulas:");
            contentPanel.add(label1, cc.xy(1, 5));
        }
        dialogPane.add(contentPanel, BorderLayout.NORTH);

        //======== scrollPane1 ========
        {
            scrollPane1.setMinimumSize(new Dimension(300, 400));
            scrollPane1.setVerticalScrollBarPolicy(ScrollPaneConstants.VERTICAL_SCROLLBAR_ALWAYS);
            scrollPane1.setPreferredSize(new Dimension(350, 200));
            scrollPane1.setMaximumSize(new Dimension(1000, 1000));

            //---- formulaList ----
            formulaList.setMinimumSize(new Dimension(300, 200));
            formulaList.setMaximumSize(new Dimension(300, 500));
            formulaList.setPreferredSize(new Dimension(300, 200));
            scrollPane1.setViewportView(formulaList);
        }
        dialogPane.add(scrollPane1, BorderLayout.CENTER);

        //======== buttonBar ========
        {
            buttonBar.setBorder(Borders.BUTTON_BAR_GAP_BORDER);
            buttonBar.setPreferredSize(new Dimension(181, 60));
            buttonBar.setLayout(new FormLayout(
                    new ColumnSpec[] { FormFactory.LABEL_COMPONENT_GAP_COLSPEC, FormFactory.DEFAULT_COLSPEC,
                            FormFactory.LABEL_COMPONENT_GAP_COLSPEC, FormFactory.DEFAULT_COLSPEC,
                            FormFactory.LABEL_COMPONENT_GAP_COLSPEC, FormFactory.DEFAULT_COLSPEC,
                            FormFactory.GLUE_COLSPEC, FormFactory.BUTTON_COLSPEC,
                            FormFactory.RELATED_GAP_COLSPEC, FormFactory.BUTTON_COLSPEC },
                    new RowSpec[] { new RowSpec(Sizes.dluY(15)), FormFactory.PREF_ROWSPEC,
                            FormFactory.LINE_GAP_ROWSPEC, FormFactory.DEFAULT_ROWSPEC }));
            buttonBar.add(separator1, cc.xywh(2, 1, 9, 1));

            //---- errorMessage ----
            errorMessage
                    .setFont(errorMessage.getFont().deriveFont(errorMessage.getFont().getStyle() | Font.BOLD));
            buttonBar.add(errorMessage, cc.xywh(2, 2, 6, 1));

            //---- okButton ----
            okButton.setText("OK");
            buttonBar.add(okButton, cc.xy(8, 2));

            //---- cancelButton ----
            cancelButton.setText("Cancel");
            buttonBar.add(cancelButton, cc.xy(10, 2));
        }
        dialogPane.add(buttonBar, BorderLayout.SOUTH);
    }
    contentPane.add(dialogPane, BorderLayout.CENTER);
    setSize(375, 345);
    setLocationRelativeTo(getOwner());

    //---- buttonGroup1 ----
    ButtonGroup buttonGroup1 = new ButtonGroup();
    buttonGroup1.add(radioButton1);
    buttonGroup1.add(radioButton2);
    // JFormDesigner - End of component initialization  //GEN-END:initComponents
}

From source file:anl.verdi.gis.FastTileLayerEditor.java

private void initComponents() {
    // JFormDesigner - Component initialization - DO NOT MODIFY
    // //GEN-BEGIN:initComponents
    // Generated using JFormDesigner non-commercial license
    DefaultComponentFactory compFactory = DefaultComponentFactory.getInstance();
    dialogPane = new JPanel();
    contentPanel = new JPanel();
    separator1 = compFactory.createSeparator("Manage Layers");
    layerEditorPanel1 = new FastTileLayerPanel();
    buttonBar = new JPanel();
    okButton = new JButton();
    cancelButton = new JButton();
    CellConstraints cc = new CellConstraints();

    //======== this ========
    setModal(true);//  w  w w  .  j a  v a 2 s.  c  om
    setTitle("Manage Layers");
    Container contentPane = getContentPane();
    contentPane.setLayout(new BorderLayout());

    //======== dialogPane ========
    {
        dialogPane.setBorder(Borders.DIALOG_BORDER);
        dialogPane.setLayout(new BorderLayout());

        //======== contentPanel ========
        {
            // 2014
            ColumnSpec[] aColumnSpec = ColumnSpec.decodeSpecs("default:grow");
            RowSpec aRowSpec = new RowSpec(RowSpec.FILL, Sizes.DEFAULT, FormSpec.DEFAULT_GROW);
            contentPanel.setLayout(new FormLayout(aColumnSpec,
                    new RowSpec[] { FormFactory.DEFAULT_ROWSPEC, FormFactory.LINE_GAP_ROWSPEC, aRowSpec }));
            //            contentPanel.setLayout(new FormLayout(
            //                  ColumnSpec.decodeSpecs("default:grow"),
            //                  new RowSpec[] {
            //                     FormFactory.DEFAULT_ROWSPEC,
            //                     FormFactory.LINE_GAP_ROWSPEC,
            //                     new RowSpec(RowSpec.FILL, Sizes.DEFAULT, FormSpec.DEFAULT_GROW)
            //                  }));
            contentPanel.add(separator1, cc.xy(1, 1));
            contentPanel.add(layerEditorPanel1, cc.xy(1, 3));
        }
        dialogPane.add(contentPanel, BorderLayout.CENTER);

        //======== buttonBar ========
        {
            buttonBar.setBorder(Borders.BUTTON_BAR_GAP_BORDER);
            // 2014
            RowSpec[] bRowSpec = RowSpec.decodeSpecs("pref");
            buttonBar
                    .setLayout(
                            new FormLayout(
                                    new ColumnSpec[] { FormFactory.GLUE_COLSPEC, FormFactory.BUTTON_COLSPEC,
                                            FormFactory.RELATED_GAP_COLSPEC, FormFactory.BUTTON_COLSPEC },
                                    bRowSpec));
            //            buttonBar.setLayout(new FormLayout(
            //                  new ColumnSpec[] {
            //                     FormFactory.GLUE_COLSPEC,
            //                     FormFactory.BUTTON_COLSPEC,
            //                     FormFactory.RELATED_GAP_COLSPEC,
            //                     FormFactory.BUTTON_COLSPEC
            //                  },
            //                  RowSpec.decodeSpecs("pref")));

            //---- okButton ----
            okButton.setText("OK");
            okButton.addActionListener(new ActionListener() {
                public void actionPerformed(ActionEvent e) {
                    okButtonActionPerformed(e);
                }
            });
            buttonBar.add(okButton, cc.xy(2, 1));

            //---- cancelButton ----
            cancelButton.setText("Cancel");
            cancelButton.addActionListener(new ActionListener() {
                public void actionPerformed(ActionEvent e) {
                    cancelButtonActionPerformed(e);
                }
            });
            buttonBar.add(cancelButton, cc.xy(4, 1));
        }
        dialogPane.add(buttonBar, BorderLayout.SOUTH);
    }
    contentPane.add(dialogPane, BorderLayout.CENTER);
    pack();
    setLocationRelativeTo(getOwner());
    // //GEN-END:initComponents
}

From source file:anl.verdi.gis.FastTileLayerPanel.java

private void initComponents() {
    // JFormDesigner - Component initialization - DO NOT MODIFY
    // //GEN-BEGIN:initComponents
    // Generated using JFormDesigner non-commercial license
    scrollPane1 = new JScrollPane();
    layerList = new JList();
    //      addBtn = new JButton();
    moveUpButton = new JButton();
    moveDownButton = new JButton();
    removeLayerButton = new JButton();
    //      editLayerButton = new JButton();
    CellConstraints cc = new CellConstraints();

    //======== this ========
    // 2014/* w  w  w  . j  a va  2s .c  o  m*/
    ColumnSpec aColumnSpec = new ColumnSpec(ColumnSpec.FILL, Sizes.DEFAULT, FormSpec.DEFAULT_GROW);
    RowSpec aRowSpec = new RowSpec(RowSpec.FILL, Sizes.DEFAULT, FormSpec.DEFAULT_GROW);
    RowSpec bRowSpec = new RowSpec(RowSpec.FILL, Sizes.DEFAULT, FormSpec.DEFAULT_GROW);
    setLayout(new FormLayout(
            new ColumnSpec[] { aColumnSpec, FormFactory.LABEL_COMPONENT_GAP_COLSPEC,
                    FormFactory.DEFAULT_COLSPEC },
            new RowSpec[] { aRowSpec, FormFactory.LINE_GAP_ROWSPEC, FormFactory.DEFAULT_ROWSPEC,
                    FormFactory.LINE_GAP_ROWSPEC, FormFactory.DEFAULT_ROWSPEC, FormFactory.LINE_GAP_ROWSPEC,
                    FormFactory.DEFAULT_ROWSPEC, FormFactory.LINE_GAP_ROWSPEC, FormFactory.DEFAULT_ROWSPEC,
                    FormFactory.LINE_GAP_ROWSPEC, FormFactory.DEFAULT_ROWSPEC, FormFactory.LINE_GAP_ROWSPEC,
                    bRowSpec }));
    //      setLayout(new FormLayout(
    //            new ColumnSpec[]{
    //                        new ColumnSpec(ColumnSpec.FILL, Sizes.DEFAULT, FormSpec.DEFAULT_GROW),
    //                        FormFactory.LABEL_COMPONENT_GAP_COLSPEC,
    //                        FormFactory.DEFAULT_COLSPEC
    //            },
    //            new RowSpec[]{
    //                        new RowSpec(RowSpec.FILL, Sizes.DEFAULT, FormSpec.DEFAULT_GROW),
    //                        FormFactory.LINE_GAP_ROWSPEC,
    //                        FormFactory.DEFAULT_ROWSPEC,
    //                        FormFactory.LINE_GAP_ROWSPEC,
    //                        FormFactory.DEFAULT_ROWSPEC,
    //                        FormFactory.LINE_GAP_ROWSPEC,
    //                        FormFactory.DEFAULT_ROWSPEC,
    //                        FormFactory.LINE_GAP_ROWSPEC,
    //                        FormFactory.DEFAULT_ROWSPEC,
    //                        FormFactory.LINE_GAP_ROWSPEC,
    //                        FormFactory.DEFAULT_ROWSPEC,
    //                        FormFactory.LINE_GAP_ROWSPEC,
    //                        new RowSpec(RowSpec.FILL, Sizes.DEFAULT, FormSpec.DEFAULT_GROW)
    //            }));

    //======== scrollPane1 ========
    {

        //---- layerList ----
        layerList.addListSelectionListener(new ListSelectionListener() {
            public void valueChanged(ListSelectionEvent e) {
                layerListValueChanged(e);
            }
        });
        scrollPane1.setViewportView(layerList);
    }
    add(scrollPane1, cc.xywh(1, 1, 1, 13));

    //---- addBtn ----
    //      addBtn.setText("Add Layer");   // 2014 removed button to avoid problems with Simphony
    //      addBtn.addActionListener(new ActionListener() {
    //         public void actionPerformed(ActionEvent e) {
    //            addBtnActionPerformed(e);
    //         }
    //      });
    //      add(addBtn, cc.xy(3, 3));

    //---- moveUpButton ----
    moveUpButton.setText("Move Up");
    moveUpButton.addActionListener(new ActionListener() {
        public void actionPerformed(ActionEvent e) {
            moveUpButtonActionPerformed(e);
        }
    });
    add(moveUpButton, cc.xy(3, 5));

    //---- moveDownButton ----
    moveDownButton.setText("Move Down");
    moveDownButton.addActionListener(new ActionListener() {
        public void actionPerformed(ActionEvent e) {
            moveDownButtonActionPerformed(e);
        }
    });
    add(moveDownButton, cc.xy(3, 7));

    //---- removeLayerButton ----
    removeLayerButton.setText("Remove Layer");
    removeLayerButton.addActionListener(new ActionListener() {
        public void actionPerformed(ActionEvent e) {
            removeLayerButtonActionPerformed(e);
        }
    });
    add(removeLayerButton, cc.xy(3, 9));

    //---- editLayerButton ----      // 2014 removed Edit Layer button from interface - causes crash by Simphony 
    //      editLayerButton.setText("Edit Layer");
    //      editLayerButton.addActionListener(new ActionListener() {
    //         public void actionPerformed(ActionEvent e) {
    //            editLayerButtonPerformed(e);
    //         }
    //      });
    //      add(editLayerButton, cc.xy(3, 11));
    //      editLayerButton.setEnabled(false);

    // //GEN-END:initComponents
}

From source file:anl.verdi.gis.LayerEditor.java

private void initComponents() {
    // JFormDesigner - Component initialization - DO NOT MODIFY
    // //GEN-BEGIN:initComponents
    // Generated using JFormDesigner non-commercial license
    DefaultComponentFactory compFactory = DefaultComponentFactory.getInstance();
    dialogPane = new JPanel();
    contentPanel = new JPanel();
    separator1 = compFactory.createSeparator("Manage Layers");
    layerEditorPanel1 = new LayerEditorPanel();
    buttonBar = new JPanel();
    okButton = new JButton();
    cancelButton = new JButton();
    CellConstraints cc = new CellConstraints();

    //======== this ========
    setModal(true);/*from   w  ww. j  ava  2 s. co  m*/
    setTitle("Manage Layers");
    Container contentPane = getContentPane();
    contentPane.setLayout(new BorderLayout());

    //======== dialogPane ========
    {
        dialogPane.setBorder(Borders.DIALOG_BORDER);
        dialogPane.setLayout(new BorderLayout());

        //======== contentPanel ========
        {
            // 2014
            ColumnSpec[] aColumnSpec = ColumnSpec.decodeSpecs("default:grow");
            RowSpec aRowSpec = new RowSpec(RowSpec.FILL, Sizes.DEFAULT, FormSpec.DEFAULT_GROW);
            contentPanel.setLayout(new FormLayout(aColumnSpec,
                    new RowSpec[] { FormFactory.DEFAULT_ROWSPEC, FormFactory.LINE_GAP_ROWSPEC, aRowSpec }));
            //            contentPanel.setLayout(new FormLayout(
            //                  ColumnSpec.decodeSpecs("default:grow"),
            //                  new RowSpec[] {
            //                     FormFactory.DEFAULT_ROWSPEC,
            //                     FormFactory.LINE_GAP_ROWSPEC,
            //                     new RowSpec(RowSpec.FILL, Sizes.DEFAULT, FormSpec.DEFAULT_GROW)
            //                  }));
            contentPanel.add(separator1, cc.xy(1, 1));
            contentPanel.add(layerEditorPanel1, cc.xy(1, 3));
        }
        dialogPane.add(contentPanel, BorderLayout.CENTER);

        //======== buttonBar ========
        {
            buttonBar.setBorder(Borders.BUTTON_BAR_GAP_BORDER);
            // 2014
            RowSpec[] bRowSpec = RowSpec.decodeSpecs("pref");
            buttonBar
                    .setLayout(
                            new FormLayout(
                                    new ColumnSpec[] { FormFactory.GLUE_COLSPEC, FormFactory.BUTTON_COLSPEC,
                                            FormFactory.RELATED_GAP_COLSPEC, FormFactory.BUTTON_COLSPEC },
                                    bRowSpec));
            //            buttonBar.setLayout(new FormLayout(
            //                  new ColumnSpec[] {
            //                     FormFactory.GLUE_COLSPEC,
            //                     FormFactory.BUTTON_COLSPEC,
            //                     FormFactory.RELATED_GAP_COLSPEC,
            //                     FormFactory.BUTTON_COLSPEC
            //                  },
            //                  RowSpec.decodeSpecs("pref")));

            //---- okButton ----
            okButton.setText("OK");
            okButton.addActionListener(new ActionListener() {
                public void actionPerformed(ActionEvent e) {
                    okButtonActionPerformed(e);
                }
            });
            buttonBar.add(okButton, cc.xy(2, 1));

            //---- cancelButton ----
            cancelButton.setText("Cancel");
            cancelButton.addActionListener(new ActionListener() {
                public void actionPerformed(ActionEvent e) {
                    cancelButtonActionPerformed(e);
                }
            });
            buttonBar.add(cancelButton, cc.xy(4, 1));
        }
        dialogPane.add(buttonBar, BorderLayout.SOUTH);
    }
    contentPane.add(dialogPane, BorderLayout.CENTER);
    pack();
    setLocationRelativeTo(getOwner());
    // //GEN-END:initComponents
}

From source file:anl.verdi.gis.LayerEditorPanel.java

private void initComponents() {
    // JFormDesigner - Component initialization - DO NOT MODIFY
    // //GEN-BEGIN:initComponents
    // Generated using JFormDesigner non-commercial license
    scrollPane1 = new JScrollPane();
    layerList = new JList();
    addBtn = new JButton();
    moveUpButton = new JButton();
    moveDownButton = new JButton();
    removeLayerButton = new JButton();
    CellConstraints cc = new CellConstraints();

    //======== this ========
    // 2014//from w  w  w.  ja v a  2s  . c o m
    ColumnSpec aColumnSpec = new ColumnSpec(ColumnSpec.FILL, Sizes.DEFAULT, FormSpec.DEFAULT_GROW);
    RowSpec aRowSpec = new RowSpec(RowSpec.FILL, Sizes.DEFAULT, FormSpec.DEFAULT_GROW);
    RowSpec bRowSpec = new RowSpec(RowSpec.FILL, Sizes.DEFAULT, FormSpec.DEFAULT_GROW);
    setLayout(new FormLayout(
            new ColumnSpec[] { aColumnSpec, FormFactory.LABEL_COMPONENT_GAP_COLSPEC,
                    FormFactory.DEFAULT_COLSPEC },
            new RowSpec[] { aRowSpec, FormFactory.LINE_GAP_ROWSPEC, FormFactory.DEFAULT_ROWSPEC,
                    FormFactory.LINE_GAP_ROWSPEC, FormFactory.DEFAULT_ROWSPEC, FormFactory.LINE_GAP_ROWSPEC,
                    FormFactory.DEFAULT_ROWSPEC, FormFactory.LINE_GAP_ROWSPEC, FormFactory.DEFAULT_ROWSPEC,
                    FormFactory.LINE_GAP_ROWSPEC, bRowSpec }));
    //      setLayout(new FormLayout(
    //            new ColumnSpec[]{
    //                        new ColumnSpec(ColumnSpec.FILL, Sizes.DEFAULT, FormSpec.DEFAULT_GROW),
    //                        FormFactory.LABEL_COMPONENT_GAP_COLSPEC,
    //                        FormFactory.DEFAULT_COLSPEC
    //            },
    //            new RowSpec[]{
    //                        new RowSpec(RowSpec.FILL, Sizes.DEFAULT, FormSpec.DEFAULT_GROW),
    //                        FormFactory.LINE_GAP_ROWSPEC,
    //                        FormFactory.DEFAULT_ROWSPEC,
    //                        FormFactory.LINE_GAP_ROWSPEC,
    //                        FormFactory.DEFAULT_ROWSPEC,
    //                        FormFactory.LINE_GAP_ROWSPEC,
    //                        FormFactory.DEFAULT_ROWSPEC,
    //                        FormFactory.LINE_GAP_ROWSPEC,
    //                        FormFactory.DEFAULT_ROWSPEC,
    //                        FormFactory.LINE_GAP_ROWSPEC,
    //                        new RowSpec(RowSpec.FILL, Sizes.DEFAULT, FormSpec.DEFAULT_GROW)
    //            }));

    //======== scrollPane1 ========
    {

        //---- layerList ----
        layerList.addListSelectionListener(new ListSelectionListener() {
            public void valueChanged(ListSelectionEvent e) {
                layerListValueChanged(e);
            }
        });
        scrollPane1.setViewportView(layerList);
    }
    add(scrollPane1, cc.xywh(1, 1, 1, 11));

    //---- addBtn ----
    addBtn.setText("Add Layer");
    addBtn.addActionListener(new ActionListener() {
        public void actionPerformed(ActionEvent e) {
            addBtnActionPerformed(e);
        }
    });
    add(addBtn, cc.xy(3, 3));

    //---- moveUpButton ----
    moveUpButton.setText("Move Up");
    moveUpButton.addActionListener(new ActionListener() {
        public void actionPerformed(ActionEvent e) {
            moveUpButtonActionPerformed(e);
        }
    });
    add(moveUpButton, cc.xy(3, 5));

    //---- moveDownButton ----
    moveDownButton.setText("Move Down");
    moveDownButton.addActionListener(new ActionListener() {
        public void actionPerformed(ActionEvent e) {
            moveDownButtonActionPerformed(e);
        }
    });
    add(moveDownButton, cc.xy(3, 7));

    //---- removeLayerButton ----
    removeLayerButton.setText("Remove Layer");
    removeLayerButton.addActionListener(new ActionListener() {
        public void actionPerformed(ActionEvent e) {
            removeLayerButtonActionPerformed(e);
        }
    });
    add(removeLayerButton, cc.xy(3, 9));
    // //GEN-END:initComponents
}

From source file:anl.verdi.gui.AboutDialog.java

private void initComponents() {
    // JFormDesigner - Component initialization - DO NOT MODIFY  //GEN-BEGIN:initComponents
    // Generated using JFormDesigner non-commercial license
    dialogPane = new JPanel();
    contentPanel = new JPanel();
    scrollPane1 = new JScrollPane();
    xHeader1 = new JXHeader();
    buttonBar = new JPanel();
    okButton = new JButton();
    CellConstraints cc = new CellConstraints();

    //======== this ========
    setTitle("About VERDI");
    setResizable(false);//from  w  ww  .j  a v a 2s .c o m
    setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE);
    Container contentPane = getContentPane();
    contentPane.setLayout(new BorderLayout());

    //======== dialogPane ========
    {
        dialogPane.setBorder(Borders.DIALOG_BORDER);
        dialogPane.setLayout(new BorderLayout());

        //======== contentPanel ========
        {
            contentPanel.setLayout(new FormLayout("default:grow", "default"));

            //======== scrollPane1 ========
            {

                //---- xHeader1 ----
                xHeader1.setTitle("Visual Environment For Rich Data Interpretation (VERDI)");
                xHeader1.setDescription("Version 1.0 06062007\n");
                scrollPane1.setViewportView(xHeader1);
            }
            contentPanel.add(scrollPane1, cc.xy(1, 1));
        }
        dialogPane.add(contentPanel, BorderLayout.CENTER);

        //======== buttonBar ========
        {
            buttonBar.setBorder(Borders.BUTTON_BAR_GAP_BORDER);
            // 2014
            RowSpec[] aRowSpec = RowSpec.decodeSpecs("pref");
            buttonBar.setLayout(new FormLayout(
                    new ColumnSpec[] { FormFactory.GLUE_COLSPEC, FormFactory.BUTTON_COLSPEC }, aRowSpec));
            //            buttonBar.setLayout(new FormLayout(
            //                  new ColumnSpec[] {
            //                     FormFactory.GLUE_COLSPEC,
            //                     FormFactory.BUTTON_COLSPEC
            //                  },
            //                  RowSpec.decodeSpecs("pref")));

            //---- okButton ----
            okButton.setText("OK");
            okButton.addActionListener(new ActionListener() {
                public void actionPerformed(ActionEvent e) {
                    okButtonActionPerformed(e);
                }
            });
            buttonBar.add(okButton, cc.xy(2, 1));
        }
        dialogPane.add(buttonBar, BorderLayout.SOUTH);
    }
    contentPane.add(dialogPane, BorderLayout.CENTER);
    pack();
    setLocationRelativeTo(getOwner());
    // JFormDesigner - End of component initialization  //GEN-END:initComponents
}

From source file:anl.verdi.gui.AddFormulaPanel.java

private void initComponents() {
    // JFormDesigner - Component initialization - DO NOT MODIFY
    // //GEN-BEGIN:initComponents
    // Generated using JFormDesigner non-commercial license
    btnDelete = new JButton();
    scrollPane1 = new JScrollPane();
    formulaList = new JList();
    fldFormula = new JTextField();
    btnAdd = new JButton();
    CellConstraints cc = new CellConstraints();

    // ======== this ========
    setBorder(new TitledBorder("Formulas"));
    // 2014//from  w w  w  .j  a v  a 2s .  c  o  m
    ColumnSpec aColumnSpec = new ColumnSpec(ColumnSpec.FILL, Sizes.DEFAULT, FormSpec.DEFAULT_GROW);
    RowSpec aRowSpec = new RowSpec(RowSpec.FILL, Sizes.DEFAULT, FormSpec.DEFAULT_GROW);
    setLayout(new FormLayout(
            new ColumnSpec[] { FormFactory.DEFAULT_COLSPEC, FormFactory.LABEL_COMPONENT_GAP_COLSPEC,
                    aColumnSpec, FormFactory.LABEL_COMPONENT_GAP_COLSPEC, FormFactory.DEFAULT_COLSPEC },
            new RowSpec[] { FormFactory.DEFAULT_ROWSPEC, FormFactory.LINE_GAP_ROWSPEC, aRowSpec,
                    FormFactory.LINE_GAP_ROWSPEC, FormFactory.DEFAULT_ROWSPEC }));
    //      setLayout(new FormLayout(new ColumnSpec[] {
    //            FormFactory.DEFAULT_COLSPEC,
    //            FormFactory.LABEL_COMPONENT_GAP_COLSPEC,
    //            new ColumnSpec(ColumnSpec.FILL, Sizes.DEFAULT,
    //                  FormSpec.DEFAULT_GROW),
    //            FormFactory.LABEL_COMPONENT_GAP_COLSPEC,
    //            FormFactory.DEFAULT_COLSPEC },
    //            new RowSpec[] {
    //                  FormFactory.DEFAULT_ROWSPEC,
    //                  FormFactory.LINE_GAP_ROWSPEC,
    //                  new RowSpec(RowSpec.FILL, Sizes.DEFAULT,
    //                        FormSpec.DEFAULT_GROW),
    //                  FormFactory.LINE_GAP_ROWSPEC,
    //                  FormFactory.DEFAULT_ROWSPEC }));

    // 2014 set up file names
    String verdiHome = Tools.getVerdiHome(); // 2014 new method for reading in an image file
    String separator = "/"; // use forward slash only for constructor ImageIcon(String filename);
    String pathName = verdiHome + separator + "plugins" + separator + "core" + separator + "icons" + separator;

    // ---- btnDelete ----
    String fileMinus = new String(pathName + "Minus.png");
    //      btnDelete.setIcon(new ImageIcon(getClass().getResource("/minus.png")));
    btnDelete.setIcon(new ImageIcon(fileMinus));
    btnDelete.setToolTipText("Delete formula");
    add(btnDelete, cc.xy(1, 1));

    // ======== scrollPane1 ========
    {
        scrollPane1.setViewportView(formulaList);
    }
    add(scrollPane1, cc.xywh(1, 3, 5, 1));
    add(fldFormula, cc.xywh(1, 5, 3, 1));

    // ---- btnAdd ----
    btnAdd.setText("Add");
    add(btnAdd, cc.xy(5, 5));

    formulaList.addMouseListener(new MouseAdapter() {
        public void mousePressed(MouseEvent evt) {
            if (evt.isPopupTrigger()) {
                JPopupMenu menu = new JPopupMenu();
                menu.add(addVariableToEditor).setEnabled(true);
                menu.show(evt.getComponent(), evt.getX(), evt.getY());
            }
        }

        public void mouseReleased(MouseEvent evt) {
            if (evt.isPopupTrigger()) {
                JPopupMenu menu = new JPopupMenu();
                menu.add(addVariableToEditor).setEnabled(true);
                menu.show(evt.getComponent(), evt.getX(), evt.getY());
            }
        }

        public void mouseClicked(MouseEvent evt) {
            //
        }
    });

    // JFormDesigner - End of component initialization
    // //GEN-END:initComponents
}