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

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

Introduction

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

Prototype

Alignment TOP

To view the source code for com.jgoodies.forms.layout CellConstraints TOP.

Click Source Link

Document

Put the component in the top.

Usage

From source file:org.neuclear.commons.crypto.passphraseagents.swing.KeyStoreDialog.java

private Component buildPanel() {
    FormLayout layout = new FormLayout("right:pref, 3dlu, pref:grow ",
            "pref,3dlu,pref, 3dlu, fill:pref:grow, 3dlu, pref, 3dlu, pref,3dlu, pref, 7dlu, pref");
    PanelBuilder builder = new PanelBuilder(layout);
    CellConstraints cc = new CellConstraints();

    builder.setDefaultDialogBorder();// w  ww  . java 2s .c om

    builder.add(icon, cc.xyw(1, 3, 1, CellConstraints.LEFT, CellConstraints.TOP));
    builder.addSeparator(Messages.getText("sign"), cc.xyw(2, 3, 2));

    builder.add(keys, cc.xyw(1, 5, 3));
    final JLabel pslabel = builder.addLabel(Messages.getText("passphrase"), cc.xy(1, 7));
    pslabel.setLabelFor(passphrase);
    pslabel.setIcon(IconTools.getPassword());

    builder.add(passphrase, cc.xy(3, 7));
    builder.add(remember, cc.xy(3, 9));
    builder.add(message, cc.xyw(1, 11, 3));

    ButtonBarBuilder bb = new ButtonBarBuilder();
    bb.addGlue();
    bb.addUnrelatedGap();
    bb.addGridded(sign);
    bb.addGridded(cancel);
    builder.add(bb.getPanel(), cc.xyw(1, 13, 3));

    return builder.getPanel();
}

From source file:org.openthinclient.console.nodes.pkgmgr.DialogPackageDetailView.java

License:Open Source License

@Override
public JComponent getHeaderComponent() {
    // make sure that the main component has been initialized
    getMainComponent();//from   w w  w  .  j a  v  a2 s  . c  o m

    final DefaultFormBuilder dfb = new DefaultFormBuilder(new FormLayout("p, 10dlu, r:p, 3dlu, f:p:g")); //$NON-NLS-1$
    dfb.setDefaultDialogBorder();
    dfb.setLeadingColumnOffset(2);
    dfb.setColumn(3);

    queryField = new JTextField();
    dfb.append(Messages.getString("DirObjectListNode.filter"), queryField); //$NON-NLS-1$
    dfb.nextLine();

    queryField.getDocument().addDocumentListener(new DocumentListener() {
        public void changedUpdate(DocumentEvent e) {
            tableModel.setFilter(queryField.getText());
        }

        public void removeUpdate(DocumentEvent e) {
            tableModel.setFilter(queryField.getText());
        }

        public void insertUpdate(DocumentEvent e) {
            tableModel.setFilter(queryField.getText());
        }

        @Override
        protected void finalize() throws Throwable {
            tableModel.setFilter("");
            packagesTable.clearSelection();
            super.finalize();
        }

    });

    dfb.add(new JLabel(
            IconManager.getInstance(DetailViewProvider.class, "icons").getIcon("tree." + "PackageListQuery")), //$NON-NLS-1$ //$NON-NLS-2$
            new CellConstraints(1, 1, 1, dfb.getRowCount(), CellConstraints.CENTER, CellConstraints.TOP));

    return dfb.getPanel();
}

From source file:org.openthinclient.console.nodes.pkgmgr.PackageDetailView.java

License:Open Source License

@Override
public JComponent getHeaderComponent() {
    // make sure that the main component has been initialized

    getMainComponent();//from   w  w w .  java  2 s. c o m

    final DefaultFormBuilder dfb = new DefaultFormBuilder(new FormLayout("p, 10dlu, r:p, 3dlu, f:p:g")); //$NON-NLS-1$
    dfb.setDefaultDialogBorder();
    dfb.setLeadingColumnOffset(2);
    dfb.setColumn(3);

    queryField = new JTextField();
    dfb.append(Messages.getString("DirObjectListNode.filter"), queryField); //$NON-NLS-1$
    dfb.nextLine();

    queryField.getDocument().addDocumentListener(new DocumentListener() {
        public void changedUpdate(DocumentEvent e) {
            tableModel.setFilter(queryField.getText());
        }

        public void removeUpdate(DocumentEvent e) {
            tableModel.setFilter(queryField.getText());
        }

        public void insertUpdate(DocumentEvent e) {
            tableModel.setFilter(queryField.getText());
        }

        @Override
        protected void finalize() throws Throwable {
            // System.out.println("PackageDetailView/DocumentListener/finalize");
            tableModel.setFilter("");
            super.finalize();
        }
    });

    dfb.add(new JLabel(
            IconManager.getInstance(DetailViewProvider.class, "icons").getIcon("tree.PackageListQuery")), //$NON-NLS-1$ //$NON-NLS-2$
            new CellConstraints(1, 1, 1, dfb.getRowCount(), CellConstraints.CENTER, CellConstraints.TOP));

    return dfb.getPanel();
}

From source file:org.openthinclient.console.nodes.views.DirectoryEntryDetailView.java

License:Open Source License

@Override
public JComponent getHeaderComponent() {
    final DetailViewFormBuilder dfb = new DetailViewFormBuilder(new FormLayout("p, 10dlu, p, 0dlu, f:p:g"), //$NON-NLS-1$
            Messages.getBundle());/*from w  w w  . j  a  v  a  2s.  c  o m*/
    dfb.setLeadingColumnOffset(2);
    dfb.setColumn(3);

    Font f = UIManager.getFont("TitledBorder.font"); //$NON-NLS-1$
    f = f.deriveFont(Font.BOLD, AffineTransform.getScaleInstance(1.5, 1.5));

    final JLabel nameLabel = new JLabel(displayName);
    nameLabel.setForeground(UIManager.getColor("textHighlight")); //$NON-NLS-1$
    nameLabel.setFont(f);

    final JLabel nameField = new JLabel(dn.substring(rdn.length()));
    nameField.setForeground(UIManager.getColor("textHighlight").brighter()); //$NON-NLS-1$
    nameField.setFont(f);

    final JLabel descField = new JLabel(connectionDescriptor.getLDAPUrl());

    dfb.append(nameLabel, nameField);
    dfb.append(descField, 3);

    dfb.add(new JLabel(new ImageIcon(icon)),
            new CellConstraints(1, 1, 1, dfb.getRowCount(), CellConstraints.CENTER, CellConstraints.TOP));

    return dfb.getPanel();
}

From source file:org.openthinclient.console.nodes.views.DirObjectDetailView.java

License:Open Source License

@Override
public JComponent getHeaderComponent() {
    final DetailViewFormBuilder dfb = new DetailViewFormBuilder(new FormLayout("p, 10dlu, r:p, 3dlu, f:p:g"), //$NON-NLS-1$
            Messages.getBundle());/* www. j  a v  a 2s .co m*/
    dfb.setLeadingColumnOffset(2);
    dfb.setColumn(3);

    final String simpleClassName = dirObject.getClass().getSimpleName();
    Font f = UIManager.getFont("TitledBorder.font"); //$NON-NLS-1$
    f = f.deriveFont(Font.BOLD, AffineTransform.getScaleInstance(1.5, 1.5));

    final JLabel typeLabel = new JLabel(Messages.getString("types.singular." //$NON-NLS-1$
            + simpleClassName) + ":"); //$NON-NLS-1$
    typeLabel.setForeground(new Color(10, 10, 150));
    typeLabel.setFont(f);
    JLabel nameLabel = new JLabel();
    if (simpleClassName.equals("Realm")) {
        String dn = realm.getConnectionDescriptor().getBaseDN();
        dn = dn.replace("\\,", "#%COMMA%#");
        final String[] s = dn.split(",");
        String nameRealm = "";
        if (s.length > 0) {
            nameRealm = s[0].replace("ou=", "").trim();
            nameRealm = nameRealm.replace("#%COMMA%#", "\\,").trim();
        }
        nameLabel = new JLabel(nameRealm); //$NON-NLS-1$
    } else
        nameLabel = new JLabel(dirObject.getName() != null ? dirObject.getName() : ""); //$NON-NLS-1$
    nameLabel.setForeground(new Color(50, 50, 200));
    nameLabel.setFont(f);

    final JLabel descField = new JLabel(dirObject.getDescription() != null ? dirObject.getDescription() : ""); //$NON-NLS-1$

    dfb.append(typeLabel, nameLabel);
    dfb.append(descField, 3);

    dfb.add(new JLabel(IconManager.getInstance(DetailViewProvider.class, "icons") //$NON-NLS-1$
            .getIcon("tree." + dirObject.getClass().getSimpleName())), //$NON-NLS-1$
            new CellConstraints(1, 1, 1, dfb.getRowCount(), CellConstraints.CENTER, CellConstraints.TOP));

    return dfb.getPanel();
}

From source file:org.openthinclient.console.nodes.views.DirObjectEditor.java

License:Open Source License

@Override
public JComponent getHeaderComponent() {
    boolean isMutabel = true;
    boolean isRealm = false;
    final String name = dirObject.getClass().getSimpleName();

    // check if is mutable
    if (!LDAPDirectory.isMutable(dirObject.getClass()))
        isMutabel = false;// w  w w .  j  ava 2s . c o m
    if (name.equals("Realm"))
        isRealm = true;

    final JPanel panel = new JPanel();

    final PresentationModel model = new PresentationModel(new ValueHolder(dirObject, true));

    final DetailViewFormBuilder dfb = new DetailViewFormBuilder(new FormLayout("p, 10dlu, r:p, 3dlu, f:p:g"), //$NON-NLS-1$
            Messages.getBundle(), panel);
    dfb.setLeadingColumnOffset(2);
    dfb.setColumn(3);

    if (isMutabel == false) {
        dfb.appendI15d("DirObjectEditor.name", BasicComponentFactory.createLabel(model.getModel("name")));
        dfb.appendI15d("DirObjectEditor.description",
                BasicComponentFactory.createLabel(model.getModel("description")));
    } else if (isRealm == true) {
        // FIXME: make it easier
        String dn = realm.getConnectionDescriptor().getBaseDN();
        dn = dn.replace("\\,", "#%COMMA%#");
        final String[] s = dn.split(",");
        String nameRealm = "";
        if (s.length > 0) {
            nameRealm = s[0].replace("ou=", "").trim();
            nameRealm = nameRealm.replace("#%COMMA%#", "\\,").trim();
        }
        final JTextField field = new javax.swing.JTextField();
        field.setText(nameRealm);
        dfb.appendI15d("DirObjectEditor.name", field); //$NON-NLS-1$
        dfb.appendI15d("DirObjectEditor.description", BasicComponentFactory.createTextField( //$NON-NLS-1$
                model.getModel("description"), true)); //$NON-NLS-1$
    } else {
        dfb.appendI15d("DirObjectEditor.name", BasicComponentFactory.createTextField( //$NON-NLS-1$
                model.getModel("name"), false)); //$NON-NLS-1$
        dfb.appendI15d("DirObjectEditor.description", BasicComponentFactory.createTextField( //$NON-NLS-1$
                model.getModel("description"), true)); //$NON-NLS-1$
    }

    panel.add(
            new JLabel(IconManager.getInstance(DetailViewProvider.class, "icons") //$NON-NLS-1$
                    .getIcon("tree." + dirObject.getClass().getSimpleName())), //$NON-NLS-1$
            new CellConstraints(1, 1, 1, dfb.getRowCount(), CellConstraints.CENTER, CellConstraints.TOP));

    panel.putClientProperty(DirObjectEditor.KEY_VALIDATOR, this);

    return panel;
}

From source file:presentation.program.GuiTabProgramm.java

License:Open Source License

/**
 * This method initializes jPanelEpgDetails
 * //from  www  .  ja v a  2s. com
 * @return javax.swing.JPanel
 */
private JPanel getJPanelEpgDetails() {
    if (jPanelEpgDetails == null) {
        jPanelEpgDetails = new JPanel();
        FormLayout layout = new FormLayout("f:d:grow", //columns
                "pref, 5, f:d:grow"); //rows
        PanelBuilder builder = new PanelBuilder(jPanelEpgDetails, layout);
        CellConstraints cc = new CellConstraints();

        builder.addSeparator(ControlMain.getProperty("label_epgDetails"),
                cc.xy(1, 1, CellConstraints.FILL, CellConstraints.TOP));
        builder.add(this.getJScrollPaneEPGDetail(), cc.xy(1, 3));
    }
    return jPanelEpgDetails;
}

From source file:presentation.timer.GuiBoxTimerPanel.java

License:Open Source License

private void initialize() {
    FormLayout layout = new FormLayout("f:320:grow, 10, 100:grow, 160:grow, 7, pref", // columns
            "pref, t:220:grow, pref, 10, pref, 90:grow, 90:grow, 20"); // rows
    PanelBuilder builder = new PanelBuilder(this, layout);
    builder.setDefaultDialogBorder();//  ww w .  j  av  a2s .c o  m
    CellConstraints cc = new CellConstraints();

    builder.addSeparator(ControlMain.getProperty("label_recordTimer"), cc.xyw(1, 1, 4));
    builder.add(this.getJScrollPaneRecordTimerTable(), cc.xyw(1, 2, 4));
    builder.add(this.getJPanelDauerTimer(), cc.xyw(1, 3, 4, CellConstraints.CENTER, CellConstraints.TOP));
    builder.addSeparator(ControlMain.getProperty("label_systemTimer"), cc.xyw(1, 5, 4));
    builder.add(this.getJScrollPaneSystemTimerTable(), cc.xywh(1, 6, 4, 2));
    builder.add(this.getJPanelDauerTimer2(), cc.xyw(1, 8, 4, CellConstraints.CENTER, CellConstraints.TOP));
    builder.addTitle(ControlMain.getProperty("label_actRecTimer"), cc.xy(6, 1));
    builder.add(this.getJPanelButtonsRecordTimer(),
            cc.xywh(6, 2, 1, 1, CellConstraints.FILL, CellConstraints.TOP));
    builder.addTitle(ControlMain.getProperty("label_actSysTimer"),
            cc.xy(6, 5, CellConstraints.CENTER, CellConstraints.DEFAULT));
    builder.add(this.getJPanelButtonsSystemTimer(),
            cc.xywh(6, 6, 1, 1, CellConstraints.CENTER, CellConstraints.TOP));
    builder.add(this.getJPanelButtonsGui(),
            cc.xywh(6, 7, 1, 2, CellConstraints.CENTER, CellConstraints.BOTTOM));
}

From source file:repast.simphony.visualization.gui.styleBuilder.EditedStyleDialog.java

private void initComponents() {
    // JFormDesigner - Component initialization - DO NOT MODIFY  //GEN-BEGIN:initComponents
    // Generated using JFormDesigner non-commercial license
    dialogPane = new JPanel();
    buttonBar = new JPanel();
    okButton = new JButton();
    cancelButton = new JButton();
    panel1 = new JPanel();
    shapePanel = new JPanel();
    shapeComboBox = new JComboBox();
    iconColorbutton = new JButton();
    iconButton = new JButton();
    clearFileButton = new JButton();
    textureButton = new JButton();
    clearTextureButton = new JButton();
    previewPanel = new JPanel();
    panel3 = new JPanel();
    label1 = new JLabel();
    label2 = new JLabel();
    label3 = new JLabel();
    label4 = new JLabel();
    sizeComboBox = new JComboBox();
    sizeMinComboBox = new JComboBox();
    sizeMaxComboBox = new JComboBox();
    sizeScaleComboBox = new JComboBox();
    panel4 = new JPanel();
    label5 = new JLabel();
    label6 = new JLabel();
    label7 = new JLabel();
    label19 = new JLabel();
    labelComboBox = new JComboBox();
    labelPositionComboBox = new JComboBox();
    labelOffsetTextField = new JTextField();
    labelPrecisionComboBox = new JComboBox();
    panel2 = new JPanel();
    label8 = new JLabel();
    label9 = new JLabel();
    label10 = new JLabel();
    label11 = new JLabel();
    labelFontFamilyComboBox = new JComboBox();
    labelFontSizeComboBox = new JComboBox();
    labelFontStyleComboBox = new JComboBox();
    fontColorButton = new JButton();
    panel6 = new JPanel();
    label15 = new JLabel();
    label16 = new JLabel();
    label17 = new JLabel();
    label18 = new JLabel();
    label12 = new JLabel();
    redValueComboBox = new JComboBox();
    redMinComboBox = new JComboBox();
    redMaxComboBox = new JComboBox();
    redScaleComboBox = new JComboBox();
    label13 = new JLabel();
    greenValueComboBox = new JComboBox();
    greenMinComboBox = new JComboBox();
    greenMaxComboBox = new JComboBox();
    greenScaleComboBox = new JComboBox();
    label14 = new JLabel();
    blueValueComboBox = new JComboBox();
    blueMinComboBox = new JComboBox();
    blueMaxComboBox = new JComboBox();
    blueScaleComboBox = new JComboBox();
    CellConstraints cc = new CellConstraints();

    //======== this ========
    setModal(true);/*w  ww. j a  v  a  2  s  .c o m*/
    setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE);
    Container contentPane = getContentPane();
    contentPane.setLayout(new BorderLayout());

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

        //======== buttonBar ========
        {
            buttonBar.setBorder(Borders.BUTTON_BAR_PAD);
            buttonBar.setLayout(new FormLayout(
                    new ColumnSpec[] { FormSpecs.GLUE_COLSPEC, FormSpecs.BUTTON_COLSPEC,
                            FormSpecs.RELATED_GAP_COLSPEC, FormSpecs.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);

        //======== panel1 ========
        {
            panel1.setLayout(new FormLayout(
                    new ColumnSpec[] { ColumnSpec.decode("left:max(default;166dlu):grow"),
                            FormSpecs.LABEL_COMPONENT_GAP_COLSPEC, FormSpecs.DEFAULT_COLSPEC,
                            FormSpecs.LABEL_COMPONENT_GAP_COLSPEC, new ColumnSpec(Sizes.dluX(133)),
                            FormSpecs.LABEL_COMPONENT_GAP_COLSPEC, FormSpecs.DEFAULT_COLSPEC },
                    new RowSpec[] { FormSpecs.DEFAULT_ROWSPEC, FormSpecs.LINE_GAP_ROWSPEC,
                            FormSpecs.DEFAULT_ROWSPEC, FormSpecs.LINE_GAP_ROWSPEC, FormSpecs.DEFAULT_ROWSPEC,
                            FormSpecs.LINE_GAP_ROWSPEC, FormSpecs.DEFAULT_ROWSPEC, FormSpecs.LINE_GAP_ROWSPEC,
                            FormSpecs.DEFAULT_ROWSPEC, FormSpecs.LINE_GAP_ROWSPEC,
                            FormSpecs.DEFAULT_ROWSPEC }));

            //======== shapePanel ========
            {
                shapePanel.setBorder(new TitledBorder("Icon Shape and Color"));
                shapePanel.setLayout(new FormLayout(
                        new ColumnSpec[] { new ColumnSpec(Sizes.dluX(79)),
                                FormSpecs.LABEL_COMPONENT_GAP_COLSPEC, FormSpecs.DEFAULT_COLSPEC,
                                FormSpecs.LABEL_COMPONENT_GAP_COLSPEC, FormSpecs.DEFAULT_COLSPEC },
                        new RowSpec[] { FormSpecs.DEFAULT_ROWSPEC, FormSpecs.LINE_GAP_ROWSPEC,
                                FormSpecs.DEFAULT_ROWSPEC, FormSpecs.LINE_GAP_ROWSPEC,
                                FormSpecs.DEFAULT_ROWSPEC, FormSpecs.LINE_GAP_ROWSPEC,
                                new RowSpec(Sizes.dluY(17)) }));

                //---- shapeComboBox ----
                shapeComboBox.addActionListener(new ActionListener() {
                    public void actionPerformed(ActionEvent e) {
                        shapeComboBoxActionPerformed(e);
                    }
                });
                shapePanel.add(shapeComboBox, cc.xy(1, 1));

                //---- iconColorbutton ----
                iconColorbutton.addActionListener(new ActionListener() {
                    public void actionPerformed(ActionEvent e) {
                        iconColorbuttonActionPerformed(e);
                    }
                });
                shapePanel.add(iconColorbutton, cc.xy(3, 1));

                //---- iconButton ----
                iconButton.setText("text");
                iconButton.addActionListener(new ActionListener() {
                    public void actionPerformed(ActionEvent e) {
                        iconButtonActionPerformed(e);
                    }
                });
                shapePanel.add(iconButton, cc.xy(1, 5));

                //---- clearFileButton ----
                clearFileButton.setText("text");
                clearFileButton.addActionListener(new ActionListener() {
                    public void actionPerformed(ActionEvent e) {
                        clearFileButtonActionPerformed(e);
                    }
                });
                shapePanel.add(clearFileButton, cc.xy(3, 5));

                //---- textureButton ----
                textureButton.setText("Select Texture");
                textureButton.addActionListener(new ActionListener() {
                    public void actionPerformed(ActionEvent e) {
                        textureButtonActionPerformed(e);
                    }
                });
                shapePanel.add(textureButton, cc.xy(1, 7));

                //---- clearTextureButton ----
                clearTextureButton.setText("Clear Texture");
                clearTextureButton.addActionListener(new ActionListener() {
                    public void actionPerformed(ActionEvent e) {
                        clearTextureButtonActionPerformed(e);
                    }
                });
                shapePanel.add(clearTextureButton, cc.xy(3, 7));
            }
            panel1.add(shapePanel, cc.xywh(1, 1, 2, 1));

            //======== previewPanel ========
            {
                previewPanel.setBorder(new TitledBorder("Icon Preview"));
                previewPanel.setLayout(new FormLayout("101dlu:grow", "top:57dlu:grow"));
            }
            panel1.add(previewPanel, cc.xywh(5, 1, 3, 1, CellConstraints.DEFAULT, CellConstraints.TOP));

            //======== panel3 ========
            {
                panel3.setBorder(new TitledBorder("Icon Size"));
                panel3.setLayout(new FormLayout(
                        new ColumnSpec[] { ColumnSpec.decode("max(pref;66dlu)"),
                                FormSpecs.LABEL_COMPONENT_GAP_COLSPEC, FormSpecs.DEFAULT_COLSPEC,
                                FormSpecs.LABEL_COMPONENT_GAP_COLSPEC, FormSpecs.DEFAULT_COLSPEC,
                                FormSpecs.LABEL_COMPONENT_GAP_COLSPEC, FormSpecs.DEFAULT_COLSPEC,
                                FormSpecs.LABEL_COMPONENT_GAP_COLSPEC, FormSpecs.DEFAULT_COLSPEC,
                                FormSpecs.LABEL_COMPONENT_GAP_COLSPEC, FormSpecs.DEFAULT_COLSPEC,
                                FormSpecs.LABEL_COMPONENT_GAP_COLSPEC, FormSpecs.DEFAULT_COLSPEC },
                        new RowSpec[] { FormSpecs.DEFAULT_ROWSPEC, FormSpecs.LINE_GAP_ROWSPEC,
                                FormSpecs.DEFAULT_ROWSPEC }));

                //---- label1 ----
                label1.setText("Value");
                panel3.add(label1, cc.xy(1, 1));

                //---- label2 ----
                label2.setText("Minimum");
                panel3.add(label2, cc.xy(5, 1));

                //---- label3 ----
                label3.setText("Maximum");
                panel3.add(label3, cc.xy(9, 1));

                //---- label4 ----
                label4.setText("Scaling");
                panel3.add(label4, cc.xy(13, 1));

                //---- sizeComboBox ----
                sizeComboBox.setEditable(true);
                sizeComboBox.addActionListener(new ActionListener() {
                    public void actionPerformed(ActionEvent e) {
                        sizeComboBoxActionPerformed(e);
                    }
                });
                panel3.add(sizeComboBox, cc.xy(1, 3));

                //---- sizeMinComboBox ----
                sizeMinComboBox.setEditable(true);
                sizeMinComboBox.addActionListener(new ActionListener() {
                    public void actionPerformed(ActionEvent e) {
                        sizeMinComboBoxActionPerformed(e);
                    }
                });
                panel3.add(sizeMinComboBox, cc.xy(5, 3));

                //---- sizeMaxComboBox ----
                sizeMaxComboBox.setEditable(true);
                sizeMaxComboBox.addActionListener(new ActionListener() {
                    public void actionPerformed(ActionEvent e) {
                        sizeMaxComboBoxActionPerformed(e);
                    }
                });
                panel3.add(sizeMaxComboBox, cc.xy(9, 3));

                //---- sizeScaleComboBox ----
                sizeScaleComboBox.setEditable(true);
                sizeScaleComboBox.addActionListener(new ActionListener() {
                    public void actionPerformed(ActionEvent e) {
                        sizeScaleComboBoxActionPerformed(e);
                    }
                });
                panel3.add(sizeScaleComboBox, cc.xy(13, 3));
            }
            panel1.add(panel3, cc.xywh(1, 3, 7, 1));

            //======== panel4 ========
            {
                panel4.setBorder(new TitledBorder("Icon Label"));
                panel4.setLayout(new FormLayout(
                        new ColumnSpec[] { ColumnSpec.decode("max(pref;67dlu)"),
                                FormSpecs.LABEL_COMPONENT_GAP_COLSPEC, FormSpecs.DEFAULT_COLSPEC,
                                FormSpecs.LABEL_COMPONENT_GAP_COLSPEC, FormSpecs.DEFAULT_COLSPEC,
                                FormSpecs.LABEL_COMPONENT_GAP_COLSPEC, FormSpecs.DEFAULT_COLSPEC,
                                FormSpecs.LABEL_COMPONENT_GAP_COLSPEC, FormSpecs.DEFAULT_COLSPEC,
                                FormSpecs.LABEL_COMPONENT_GAP_COLSPEC, FormSpecs.DEFAULT_COLSPEC,
                                FormSpecs.LABEL_COMPONENT_GAP_COLSPEC, new ColumnSpec(Sizes.dluX(33)),
                                FormSpecs.LABEL_COMPONENT_GAP_COLSPEC, FormSpecs.DEFAULT_COLSPEC,
                                FormSpecs.LABEL_COMPONENT_GAP_COLSPEC, FormSpecs.DEFAULT_COLSPEC },
                        new RowSpec[] { FormSpecs.DEFAULT_ROWSPEC, FormSpecs.LINE_GAP_ROWSPEC,
                                FormSpecs.DEFAULT_ROWSPEC }));

                //---- label5 ----
                label5.setText("Value");
                panel4.add(label5, cc.xy(1, 1));

                //---- label6 ----
                label6.setText("Position");
                panel4.add(label6, cc.xy(5, 1));

                //---- label7 ----
                label7.setText("Offset");
                panel4.add(label7, cc.xy(9, 1));

                //---- label19 ----
                label19.setText("Precision");
                panel4.add(label19, cc.xy(13, 1));

                //---- labelComboBox ----
                labelComboBox.setEditable(true);
                labelComboBox.addActionListener(new ActionListener() {
                    public void actionPerformed(ActionEvent e) {
                        labelComboBoxActionPerformed(e);
                    }
                });
                panel4.add(labelComboBox, cc.xy(1, 3));

                //---- labelPositionComboBox ----
                labelPositionComboBox.setEditable(true);
                labelPositionComboBox
                        .setModel(new DefaultComboBoxModel(new String[] { "bottom", "top", "left", "right" }));
                labelPositionComboBox.addActionListener(new ActionListener() {
                    public void actionPerformed(ActionEvent e) {
                        labelPositionComboBoxActionPerformed(e);
                    }
                });
                panel4.add(labelPositionComboBox, cc.xy(5, 3));

                //---- labelOffsetTextField ----
                labelOffsetTextField.addActionListener(new ActionListener() {
                    public void actionPerformed(ActionEvent e) {
                        labelOffsetTextFieldActionPerformed(e);
                    }
                });
                panel4.add(labelOffsetTextField, cc.xy(9, 3));

                //---- labelPrecisionComboBox ----
                labelPrecisionComboBox.setEditable(true);
                labelPrecisionComboBox.setModel(new DefaultComboBoxModel(
                        new String[] { "1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12" }));
                labelPrecisionComboBox.setSelectedIndex(2);
                labelPrecisionComboBox.addActionListener(new ActionListener() {
                    public void actionPerformed(ActionEvent e) {
                        labelPrecisionComboBoxActionPerformed(e);
                    }
                });
                panel4.add(labelPrecisionComboBox, cc.xy(13, 3));
            }
            panel1.add(panel4, cc.xywh(1, 5, 7, 1));

            //======== panel2 ========
            {
                panel2.setBorder(new TitledBorder("Icon Label Font"));
                panel2.setLayout(new FormLayout(
                        new ColumnSpec[] { FormSpecs.DEFAULT_COLSPEC, FormSpecs.LABEL_COMPONENT_GAP_COLSPEC,
                                FormSpecs.DEFAULT_COLSPEC, FormSpecs.LABEL_COMPONENT_GAP_COLSPEC,
                                FormSpecs.DEFAULT_COLSPEC, FormSpecs.LABEL_COMPONENT_GAP_COLSPEC,
                                FormSpecs.DEFAULT_COLSPEC, FormSpecs.LABEL_COMPONENT_GAP_COLSPEC,
                                FormSpecs.DEFAULT_COLSPEC, FormSpecs.LABEL_COMPONENT_GAP_COLSPEC,
                                FormSpecs.DEFAULT_COLSPEC, FormSpecs.LABEL_COMPONENT_GAP_COLSPEC,
                                FormSpecs.DEFAULT_COLSPEC, FormSpecs.LABEL_COMPONENT_GAP_COLSPEC,
                                FormSpecs.DEFAULT_COLSPEC },
                        new RowSpec[] { FormSpecs.DEFAULT_ROWSPEC, FormSpecs.LINE_GAP_ROWSPEC,
                                FormSpecs.DEFAULT_ROWSPEC }));

                //---- label8 ----
                label8.setText("Font");
                panel2.add(label8, cc.xy(1, 1));

                //---- label9 ----
                label9.setText("Font Size");
                panel2.add(label9, cc.xy(5, 1));

                //---- label10 ----
                label10.setText("Font Style");
                panel2.add(label10, cc.xy(9, 1));

                //---- label11 ----
                label11.setText("Font Color");
                panel2.add(label11, cc.xy(13, 1));

                //---- labelFontFamilyComboBox ----
                labelFontFamilyComboBox.addActionListener(new ActionListener() {
                    public void actionPerformed(ActionEvent e) {
                        labelFontFamilyComboBoxActionPerformed(e);
                    }
                });
                panel2.add(labelFontFamilyComboBox, cc.xy(1, 3));

                //---- labelFontSizeComboBox ----
                labelFontSizeComboBox.setModel(new DefaultComboBoxModel(new String[] { "8", "10", "11", "12",
                        "14", "16", "18", "20", "24", "30", "36", "40", "48", "60", "72 " }));
                labelFontSizeComboBox.setEditable(true);
                labelFontSizeComboBox.addActionListener(new ActionListener() {
                    public void actionPerformed(ActionEvent e) {
                        labelFontSizeComboBoxActionPerformed(e);
                    }
                });
                panel2.add(labelFontSizeComboBox, cc.xy(5, 3));

                //---- labelFontStyleComboBox ----
                labelFontStyleComboBox
                        .setModel(new DefaultComboBoxModel(new String[] { "Plain", "Bold", "Italic" }));
                labelFontStyleComboBox.addActionListener(new ActionListener() {
                    public void actionPerformed(ActionEvent e) {
                        labelFontStyleComboBoxActionPerformed(e);
                    }
                });
                panel2.add(labelFontStyleComboBox, cc.xy(9, 3));

                //---- fontColorButton ----
                fontColorButton.addActionListener(new ActionListener() {
                    public void actionPerformed(ActionEvent e) {
                        fontColorButtonActionPerformed(e);
                    }
                });
                panel2.add(fontColorButton, cc.xy(13, 3));
            }
            panel1.add(panel2, cc.xywh(1, 7, 7, 1));

            //======== panel6 ========
            {
                panel6.setBorder(new TitledBorder("Variable Icon Color"));
                panel6.setLayout(new FormLayout(
                        new ColumnSpec[] { FormSpecs.DEFAULT_COLSPEC, FormSpecs.LABEL_COMPONENT_GAP_COLSPEC,
                                FormSpecs.DEFAULT_COLSPEC, FormSpecs.LABEL_COMPONENT_GAP_COLSPEC,
                                FormSpecs.DEFAULT_COLSPEC, FormSpecs.LABEL_COMPONENT_GAP_COLSPEC,
                                FormSpecs.DEFAULT_COLSPEC, FormSpecs.LABEL_COMPONENT_GAP_COLSPEC,
                                FormSpecs.DEFAULT_COLSPEC, FormSpecs.LABEL_COMPONENT_GAP_COLSPEC,
                                FormSpecs.DEFAULT_COLSPEC, FormSpecs.LABEL_COMPONENT_GAP_COLSPEC,
                                FormSpecs.DEFAULT_COLSPEC, FormSpecs.LABEL_COMPONENT_GAP_COLSPEC,
                                FormSpecs.DEFAULT_COLSPEC },
                        new RowSpec[] { FormSpecs.DEFAULT_ROWSPEC, FormSpecs.LINE_GAP_ROWSPEC,
                                FormSpecs.DEFAULT_ROWSPEC, FormSpecs.LINE_GAP_ROWSPEC,
                                FormSpecs.DEFAULT_ROWSPEC, FormSpecs.LINE_GAP_ROWSPEC,
                                FormSpecs.DEFAULT_ROWSPEC }));

                //---- label15 ----
                label15.setText("Value");
                panel6.add(label15, cc.xy(3, 1));

                //---- label16 ----
                label16.setText("Minimum");
                panel6.add(label16, cc.xy(7, 1));

                //---- label17 ----
                label17.setText("Maximum");
                panel6.add(label17, cc.xy(11, 1));

                //---- label18 ----
                label18.setText("Scaling");
                panel6.add(label18, cc.xy(15, 1));

                //---- label12 ----
                label12.setText("Red");
                panel6.add(label12, cc.xy(1, 3));

                //---- redValueComboBox ----
                redValueComboBox.setEditable(true);
                redValueComboBox.addActionListener(new ActionListener() {
                    public void actionPerformed(ActionEvent e) {
                        redValueComboBoxActionPerformed(e);
                    }
                });
                panel6.add(redValueComboBox, cc.xy(3, 3));

                //---- redMinComboBox ----
                redMinComboBox.setEditable(true);
                redMinComboBox.addActionListener(new ActionListener() {
                    public void actionPerformed(ActionEvent e) {
                        redMinComboBoxActionPerformed(e);
                    }
                });
                panel6.add(redMinComboBox, cc.xy(7, 3));

                //---- redMaxComboBox ----
                redMaxComboBox.setEditable(true);
                redMaxComboBox.addActionListener(new ActionListener() {
                    public void actionPerformed(ActionEvent e) {
                        redMaxComboBoxActionPerformed(e);
                    }
                });
                panel6.add(redMaxComboBox, cc.xy(11, 3));

                //---- redScaleComboBox ----
                redScaleComboBox.setEditable(true);
                redScaleComboBox.addActionListener(new ActionListener() {
                    public void actionPerformed(ActionEvent e) {
                        redScaleComboBoxActionPerformed(e);
                    }
                });
                panel6.add(redScaleComboBox, cc.xy(15, 3));

                //---- label13 ----
                label13.setText("Green");
                panel6.add(label13, cc.xy(1, 5));

                //---- greenValueComboBox ----
                greenValueComboBox.setEditable(true);
                greenValueComboBox.addActionListener(new ActionListener() {
                    public void actionPerformed(ActionEvent e) {
                        greenValueComboBoxActionPerformed(e);
                    }
                });
                panel6.add(greenValueComboBox, cc.xy(3, 5));

                //---- greenMinComboBox ----
                greenMinComboBox.setEditable(true);
                greenMinComboBox.addActionListener(new ActionListener() {
                    public void actionPerformed(ActionEvent e) {
                        greenMinComboBoxActionPerformed(e);
                    }
                });
                panel6.add(greenMinComboBox, cc.xy(7, 5));

                //---- greenMaxComboBox ----
                greenMaxComboBox.setEditable(true);
                greenMaxComboBox.addActionListener(new ActionListener() {
                    public void actionPerformed(ActionEvent e) {
                        greenMaxComboBoxActionPerformed(e);
                    }
                });
                panel6.add(greenMaxComboBox, cc.xy(11, 5));

                //---- greenScaleComboBox ----
                greenScaleComboBox.setEditable(true);
                greenScaleComboBox.addActionListener(new ActionListener() {
                    public void actionPerformed(ActionEvent e) {
                        greenScaleComboBoxActionPerformed(e);
                    }
                });
                panel6.add(greenScaleComboBox, cc.xy(15, 5));

                //---- label14 ----
                label14.setText("Blue");
                panel6.add(label14, cc.xy(1, 7));

                //---- blueValueComboBox ----
                blueValueComboBox.setEditable(true);
                blueValueComboBox.addActionListener(new ActionListener() {
                    public void actionPerformed(ActionEvent e) {
                        blueValueComboBoxActionPerformed(e);
                    }
                });
                panel6.add(blueValueComboBox, cc.xy(3, 7));

                //---- blueMinComboBox ----
                blueMinComboBox.setEditable(true);
                blueMinComboBox.addActionListener(new ActionListener() {
                    public void actionPerformed(ActionEvent e) {
                        blueMinComboBoxActionPerformed(e);
                    }
                });
                panel6.add(blueMinComboBox, cc.xy(7, 7));

                //---- blueMaxComboBox ----
                blueMaxComboBox.setEditable(true);
                blueMaxComboBox.addActionListener(new ActionListener() {
                    public void actionPerformed(ActionEvent e) {
                        blueMaxComboBoxActionPerformed(e);
                    }
                });
                panel6.add(blueMaxComboBox, cc.xy(11, 7));

                //---- blueScaleComboBox ----
                blueScaleComboBox.setEditable(true);
                blueScaleComboBox.addActionListener(new ActionListener() {
                    public void actionPerformed(ActionEvent e) {
                        blueScaleComboBoxActionPerformed(e);
                    }
                });
                panel6.add(blueScaleComboBox, cc.xy(15, 7));
            }
            panel1.add(panel6, cc.xywh(1, 9, 7, 1));
        }
        dialogPane.add(panel1, BorderLayout.CENTER);
    }
    contentPane.add(dialogPane, BorderLayout.CENTER);
    setSize(520, 595);
    setLocationRelativeTo(getOwner());
    // JFormDesigner - End of component initialization  //GEN-END:initComponents
}

From source file:se.streamsource.streamflow.client.ui.administration.forms.definition.FieldEditView.java

License:Apache License

private JPanel createVisibilityRulePanel() {
    rulePanel = new JPanel();
    FormLayout ruleFormLayout = new FormLayout("45dlu, 5dlu, 150dlu, 5dlu, 45dlu, 5dlu, 150dlu:grow",
            "pref, pref, pref, pref:grow");

    DefaultFormBuilder ruleFormBuilder = new DefaultFormBuilder(ruleFormLayout, rulePanel);
    ruleFormBuilder.addSeparator(text(AdministrationResources.visibility_rule));
    ruleFormBuilder.setBorder(Borders.createEmptyBorder("4dlu, 4dlu, 4dlu, 4dlu"));

    ruleFormBuilder.nextLine();// w  ww .  ja v  a 2s  .co m

    ruleFormBuilder.add(new JLabel(text(AdministrationResources.rule_field_id)));
    ruleFormBuilder.nextColumn(2);
    ruleFormBuilder.add(valueBinder.bind("fieldId", actionBinder.bind("changeRuleFieldId", ruleFieldIdCombo)));
    ruleFieldIdCombo.setRenderer(new LinkListCellRenderer());

    ruleFormBuilder.nextColumn(2);

    ruleFormBuilder.add(new JLabel(text(AdministrationResources.rule_values)));

    ruleFormBuilder.add(
            module.objectBuilderFactory().newObjectBuilder(VisibilityRuleValuesView.class)
                    .use(model.newVisibilityRuleValuesModel()).newInstance(),
            new CellConstraints(7, 2, 1, 3, CellConstraints.FILL, CellConstraints.FILL));

    ruleFormBuilder.nextLine();

    ruleFormBuilder.add(new JLabel(text(AdministrationResources.rule_condition)));
    ruleFormBuilder.nextColumn(2);
    ruleFormBuilder
            .add(valueBinder.bind("condition", actionBinder.bind("changeRuleCondition", ruleConditionCombo)));
    ruleConditionCombo.setRenderer(new DefaultListRenderer() {
        public Component getListCellRendererComponent(JList list, Object value, int index, boolean isSelected,
                boolean cellHasFocus) {
            if (value instanceof LinkValue) {
                LinkValue itemValue = (LinkValue) value;
                String val = itemValue == null ? ""
                        : text(VisibilityRuleCondition.valueOf(itemValue.text().get()));

                return super.getListCellRendererComponent(list, val, index, isSelected, cellHasFocus);
            } else
                return super.getListCellRendererComponent(list, value, index, isSelected, cellHasFocus);
        }
    });

    //ruleFormBuilder.nextLine();

    ruleFormBuilder.add(new JLabel(text(AdministrationResources.rule_visible_when)),
            new CellConstraints(1, 4, 1, 1, CellConstraints.FILL, CellConstraints.TOP));
    //ruleFormBuilder.nextColumn( 2 );

    javax.swing.Action visibilityWhenToTrueAction = am.get("changeVisibleWhenToTrue");
    javax.swing.Action visibilityWhenToFalseAction = am.get("changeVisibleWhenToFalse");

    JXRadioGroup buttonGroup = new JXRadioGroup();
    buttonGroup.setLayoutAxis(BoxLayout.LINE_AXIS);
    visibleWhenTrue = new JRadioButton(visibilityWhenToTrueAction);
    visibleWhenFalse = new JRadioButton(visibilityWhenToFalseAction);
    buttonGroup.add(visibleWhenTrue);
    buttonGroup.add(visibleWhenFalse);

    ruleFormBuilder.add(buttonGroup,
            new CellConstraints(3, 4, 1, 1, CellConstraints.FILL, CellConstraints.TOP));

    return rulePanel;
}