Example usage for com.jgoodies.forms.layout CellConstraints xy

List of usage examples for com.jgoodies.forms.layout CellConstraints xy

Introduction

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

Prototype

public CellConstraints xy(int col, int row) 

Source Link

Document

Sets column and row origins; sets width and height to 1; uses the default alignments.

Examples:

 cc.xy(1, 1); cc.xy(1, 3); 

Usage

From source file:ambit2.ui.editors.BeanEditor.java

License:Open Source License

public void buildFields(PanelBuilder builder, CellConstraints cc) {

    builder.addLabel(detailsCaption, cc.xyw(1, 1, 3));
    int row = 3;//from  w  w w.j  a v a 2s  .  c  o  m
    for (int i = 0; i < columns.length; i++) {
        if (null == columns[i]) {
            builder.addSeparator(captions[i], cc.xyw(1, row, 3));
            row++;
        } else {
            builder.addLabel(capitalizeFirstLetter(captions[i]), cc.xy(1, row));
            builder.add(fields[i], cc.xy(3, row));
            row += 2;
        }
    }
}

From source file:ambit2.ui.editors.PreferencesPanel.java

License:Open Source License

protected JComponent addWidgets(VTAGS tag) {
    int rows = 0;

    StringBuilder layout = new StringBuilder();
    String d = "";
    for (int i = 0; i < Preferences.default_values.length; i++)
        if (!tag.equals(Preferences.default_values[i][VINDEX.TAG.ordinal()]))
            continue;
        else if (!(Boolean) Preferences.default_values[i][VINDEX.HIDDEN.ordinal()]) {
            layout.append(d);//www  .j  av  a 2s . co m
            layout.append("pref");
            d = ",";
        }

    FormLayout formlayout = new FormLayout("right:pref, 3dlu, 350dlu:grow", layout.toString());
    CellConstraints cc = new CellConstraints();
    PanelBuilder builder = new PanelBuilder(formlayout);
    for (int i = 0; i < Preferences.default_values.length; i++) {
        if (!tag.equals(Preferences.default_values[i][VINDEX.TAG.ordinal()]))
            continue;
        if ((Boolean) Preferences.default_values[i][5])
            continue;//hidden
        rows++;
        JLabel l = new JLabel(Preferences.default_values[i][1].toString());
        l.setToolTipText(Preferences.default_values[i][4].toString());
        //l.setAlignmentX(CENTER_ALIGNMENT);
        l.setPreferredSize(new Dimension(200, 24));
        builder.add(l, cc.xy(1, rows));
        JComponent c = null;
        if (Preferences.default_values[i][3] == Boolean.class) {
            Action a = new CheckBoxAction(i);
            c = new JCheckBox(a);
            ((JCheckBox) c).setSelected(
                    Boolean.parseBoolean(Preferences.getProperty(Preferences.default_values[i][0].toString())));
            c.setToolTipText(Preferences.default_values[i][4].toString());
        } else if (Preferences.default_values[i][3] == String.class) {
            c = new JFormattedTextField(Preferences.getProperty(Preferences.default_values[i][0].toString()));
            c.setToolTipText(Preferences.default_values[i][4].toString());
            c.addPropertyChangeListener("value", new TextPropertyChangeListener(i));

            //                  c.setPreferredSize(d);
            //                 c.setMaximumSize(d);
        }
        //c.setPreferredSize(d);
        builder.add(c, cc.xy(3, rows));
    }
    return builder.getPanel();

}

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

License:Open Source License

public JComponent buildPanel(final IBrowserMode browserMode) {

    StringBuffer blayout = new StringBuffer();
    BrowserMode[] values = IBrowserMode.BrowserMode.values();
    button = new JToggleButton[values.length];

    ButtonGroup group = new ButtonGroup();
    boolean first = true;
    ActionListener listener = new ActionListener() {
        public void actionPerformed(ActionEvent e) {
            browserMode.setBrowserMode(BrowserMode.valueOf(e.getActionCommand()));

        }/*from w ww.j  ava  2s .  c o  m*/
    };
    for (int i = 0; i < values.length; i++) {
        BrowserMode mode = values[i];
        ImageIcon icon = mode.getIcon(false);
        String title = mode.getTitle();
        if (icon != null)
            title = "";
        button[i] = new JToggleButton(title, icon);
        //button[i].setBorder();
        button[i].addActionListener(listener);
        button[i].setActionCommand(mode.toString());
        button[i].setToolTipText(mode.getTooltip());
        button[i].setFocusable(false);
        button[i].setSelectedIcon(mode.getIcon(true));
        button[i].setFocusable(false);
        group.add(button[i]);
        button[i].setSelected(mode.equals(browserMode.getBrowserMode()));
        if (!first)
            blayout.append(",1dlu,");

        blayout.append("pref");
        first = false;

    }
    blayout.append(",8dlu,pref,1dlu,pref");
    zoomIn = new JButton(new AbstractAmbitAction("Zoom in", "images/zoom_in.png", "Increase cell size") {
        /**
          * 
          */
        private static final long serialVersionUID = -7230604413152102914L;

        public void actionPerformed(ActionEvent e) {
            //browserMode.zoom(browserMode.getBrowserMode().getCellSize(0,0).getHeight()*1.1);
            browserMode.zoom(1.1, 1.1);
        }
    });
    zoomIn.setFocusable(false);
    zoomOut = new JButton(new AbstractAmbitAction("Zoom out", "images/zoom_out.png", "Decrease cell size") {

        /**
          * 
          */
        private static final long serialVersionUID = 332852452089868875L;

        public void actionPerformed(ActionEvent e) {
            //browserMode.zoom(browserMode.getBrowserMode().getCellSize(0,0).getHeight()*0.9);
            browserMode.zoom(0.9, 0.9);
        }
    });
    zoomOut.setFocusable(false);
    FormLayout layout = new FormLayout(blayout.toString(), "pref");
    PanelBuilder panel = new PanelBuilder(layout);
    panel.setBorder(null);
    CellConstraints cc = new CellConstraints();
    for (int i = 0; i < values.length; i++) {
        panel.add(button[i], cc.xy(i * 2 + 1, 1));

    }
    //panel.add(new JToolBar.Separator(),cc.xy((values.length)*2+1,1));
    panel.add(zoomIn, cc.xy((values.length) * 2 + 1, 1));
    panel.add(zoomOut, cc.xy((values.length) * 2 + 3, 1));
    return panel.getPanel();
}

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

License:Open Source License

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

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

    label = new JLabel("Find");
    findValue = BasicComponentFactory//from   w w  w .j  a v a2s  .  co m
            .createTextField(presentationModel.getModel(IFindNavigator.PROPERTY_VALUE));
    findValue.setToolTipText("Enter value to search");

    prevPage = new JButton(new AbstractAmbitAction("<", "images/control_rewind.png", "Find previous") {
        public void actionPerformed(ActionEvent e) {
            pageable.findPrevious();
        }
    });
    nextPage = new JButton(new AbstractAmbitAction(">", "images/control_fastforward.png", "Find next") {
        public void actionPerformed(ActionEvent e) {
            pageable.findNext();
        }
    });
    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(findValue, cc.xy(3, 1));
    panel.add(prevPage, cc.xy(5, 1));
    panel.add(nextPage, cc.xy(7, 1));
    return panel.getPanel();
}

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//  ww w .  j a  v  a 2 s  .  c  om
            .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//from  www .j  a  va 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 ========
    {//from   w  ww .j a v a 2 s.  c om
        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);/*  www. j  av a 2 s .c  o m*/
    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);//from  w  w w .ja  va2s  .  com
    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/*from  w w  w . ja v a2  s .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
}