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

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

Introduction

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

Prototype

public CellConstraints() 

Source Link

Document

Constructs a default instance of CellConstraints .

Usage

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

License:Open Source License

protected void buildPanel(String help) {
    FormLayout layout = new FormLayout(
            "3dlu,fill:40dlu:grow,fill:120dlu:grow,3dlu,32dlu, 3dlu, fill:40dlu:grow,fill:120dlu:grow,3dlu", //columns
            "3dlu,12dlu,3dlu,top:[pref,36dlu], 24dlu,3dlu,24dlu,3dlu,24dlu,3dlu,24dlu,bottom:[pref,72dlu]:grow,1dlu,pref,pref,pref,pref,pref"); //rows
    setLayout(layout);/*  w w w .  jav  a2  s . c o  m*/
    CellConstraints cc = new CellConstraints();

    add(createSeparator("Available"), cc.xywh(2, 2, 2, 1));
    add(createSeparator("Selected"), cc.xywh(7, 2, 2, 1));

    tables = new JList[fieldsModel.length];
    for (int i = 0; i < fieldsModel.length; i++) {
        tables[i] = new JList(fieldsModel[i]);

        SelectionInList<Property> selectionInList = new SelectionInList<Property>(fieldsModel[i]);
        Bindings.bind(tables[i], selectionInList);
        JScrollPane p = new JScrollPane(tables[i]);
        p.setBorder(BorderFactory.createEtchedBorder());
        p.setPreferredSize(new Dimension(160, 280));
        int offset = 2 + i * 5;
        add(p, cc.xywh(offset, 4, 2, 9));

        BeanAdapter beanAdapter = new BeanAdapter(selectionInList);

        String[][] config = { { "name", "Name" }, { "label", "Alias" }, { "units", "Units" },
                { "title", "url" }, { "url", "WWW" } };
        for (int j = 0; j < config.length; j++) {
            String[] c = config[j];
            ValueModel model = beanAdapter.getValueModel(c[0]);
            add(BasicComponentFactory.createLabel(new ValueHolder(c[1])), cc.xywh(offset, j + 14, 1, 1));
            JTextField t = BasicComponentFactory.createTextField(model);
            t.addMouseListener(new MouseAdapter() {
                @Override
                public void mouseEntered(MouseEvent e) {
                    super.mouseEntered(e);
                    ((JTextField) e.getSource()).setToolTipText(((JTextField) e.getSource()).getText());
                }
            });
            add(t, cc.xywh(offset + 1, j + 14, 1, 1));
        }
        /*
        ValueModel nameModel = beanAdapter.getValueModel("name");
        ValueModel commentsModel = beanAdapter.getValueModel("label");
        ValueModel titleModel = beanAdapter.getValueModel("title");
        ValueModel urlModel = beanAdapter.getValueModel("url");           
        //p.add(BasicComponentFactory.createTextField(parentModel));         
        add(BasicComponentFactory.createLabel(new ValueHolder("Name")),cc.xywh(offset,14,1,1));
        add(BasicComponentFactory.createTextField(nameModel),cc.xywh(offset+1,14,1,1));
        add(BasicComponentFactory.createLabel(new ValueHolder("Alias")),cc.xywh(offset,15,1,1));
        add(BasicComponentFactory.createTextField(commentsModel),cc.xywh(offset+1,15,1,1));
        add(BasicComponentFactory.createLabel(new ValueHolder("Reference")),cc.xywh(offset,16,1,1));
        add(BasicComponentFactory.createTextField(titleModel),cc.xywh(offset+1,16,1,1));         
        add(BasicComponentFactory.createLabel(new ValueHolder("WWW")),cc.xywh(offset,17,1,1));
        add(BasicComponentFactory.createTextField(urlModel),cc.xywh(offset+1,17,1,1));     
        */
    }

    buttons = new ArrayList<JButton>();
    int i = 0;
    for (MOVE op : MOVE.values()) {
        JButton button = new JButton(op.display());
        button.setPreferredSize(new Dimension(24, 24));
        button.setMaximumSize(new Dimension(24, 24));
        add(button, cc.xywh(5, 5 + (i * 2), 1, 1));
        button.addActionListener(this);
        button.setActionCommand(op.toString());
        i++;
    }

    /*
    JToolBar toolBar[] = new JToolBar[2];
    toolBar[0] = new JToolBar();
    toolBar[0].add(new JButton("Find"));
    toolBar[0].add(new JToolBar.Separator());
    toolBar[0].add(new JButton("Select all"));
    toolBar[0].add(new JButton("Unselect all"));
    toolBar[0].setFloatable(false);
    add(toolBar[0],cc.xywh(2,14,1,1));
            
    toolBar[1] = new JToolBar();
    toolBar[1].add(new JButton("Move Up"));
    toolBar[1].add(new JButton("Move Down"));
    toolBar[1].add(new JToolBar.Separator());
    toolBar[1].add(new JButton("Select all"));
    toolBar[1].add(new JButton("Unselect all"));
    toolBar[1].setFloatable(false);
    add(toolBar[1],cc.xywh(6,14,1,1));
    */
    /*
    helpArea = new JTextPane();
    helpArea.setText(help);
    helpArea.setEditable(false);
    helpArea.setBackground(new Color(255,255,225));
    helpArea.setPreferredSize(new Dimension(288,48));
    add(new JScrollPane(helpArea),cc.xywh(2,16,5,1));
    */

}

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  ww w.  ja v  a  2  s.  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  va2 s .c om*/
            .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/*w  w w  . j  a v a2s .co 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/*from  w  w  w  . j av a2s .  c om*/
            .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 w  w .  j  a va  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  w w  .ja  v 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  va  2s  .  c o 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.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 .jav  a  2s.c om*/
    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  w w.  ja va2  s  .  c  o 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
}