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

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

Introduction

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

Prototype

Alignment LEFT

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

Click Source Link

Document

Put the component in the left.

Usage

From source file:org.eclipse.wb.internal.swing.FormLayout.model.SelectionActionsSupport.java

License:Open Source License

@Override
public void addSelectionActions(List<ObjectInfo> objects, List<Object> actions) throws Exception {
    if (objects.isEmpty()) {
        return;/*w w w.  ja va  2s. c o  m*/
    }
    // prepare constraints
    List<CellConstraintsSupport> constraints = Lists.newArrayList();
    for (ObjectInfo object : objects) {
        // check object
        if (!(object instanceof ComponentInfo) || object.getParent() != m_layout.getContainer()) {
            return;
        }
        // add data info
        ComponentInfo component = (ComponentInfo) object;
        constraints.add(FormLayoutInfo.getConstraints(component));
    }
    // create horizontal actions
    actions.add(new Separator());
    addAlignmentAction(actions, constraints, true, "default.gif",
            ModelMessages.SelectionActionsSupport_haDefault, CellConstraints.DEFAULT);
    addAlignmentAction(actions, constraints, true, "left.gif", ModelMessages.SelectionActionsSupport_haLeft,
            CellConstraints.LEFT);
    addAlignmentAction(actions, constraints, true, "center.gif", ModelMessages.SelectionActionsSupport_haCenter,
            CellConstraints.CENTER);
    addAlignmentAction(actions, constraints, true, "right.gif", ModelMessages.SelectionActionsSupport_haRight,
            CellConstraints.RIGHT);
    addAlignmentAction(actions, constraints, true, "fill.gif", ModelMessages.SelectionActionsSupport_haFill,
            CellConstraints.FILL);
    // create vertical actions
    actions.add(new Separator());
    addAlignmentAction(actions, constraints, false, "default.gif",
            ModelMessages.SelectionActionsSupport_vaDefault, CellConstraints.DEFAULT);
    addAlignmentAction(actions, constraints, false, "top.gif", ModelMessages.SelectionActionsSupport_haTop,
            CellConstraints.TOP);
    addAlignmentAction(actions, constraints, false, "center.gif",
            ModelMessages.SelectionActionsSupport_vaCenter, CellConstraints.CENTER);
    addAlignmentAction(actions, constraints, false, "bottom.gif",
            ModelMessages.SelectionActionsSupport_vaBottom, CellConstraints.BOTTOM);
    addAlignmentAction(actions, constraints, false, "fill.gif", ModelMessages.SelectionActionsSupport_vaFill,
            CellConstraints.FILL);
}

From source file:org.eclipse.wb.tests.designer.swing.model.layout.FormLayout.CellConstraintsSupportTest.java

License:Open Source License

public void test_setAlignH() throws Exception {
    CellConstraintsSupport support = FormLayoutInfo.getConstraints(m_button);
    ////from  w  w w . j  av a  2  s. c  om
    String expectedSource = StringUtils.replace(m_lastEditor.getSource(), "1, 2", "1, 2, left, default");
    support.setAlignH(CellConstraints.LEFT);
    support.write();
    assertEditor(expectedSource, m_lastEditor);
}

From source file:org.eclipse.wb.tests.designer.swing.model.layout.FormLayout.CellConstraintsSupportTest.java

License:Open Source License

public void test_getSmallAlignmentImage() throws Exception {
    check_getSmallAlignmentImage(CellConstraints.DEFAULT, true, false);
    check_getSmallAlignmentImage(CellConstraints.LEFT, true, true);
    check_getSmallAlignmentImage(CellConstraints.CENTER, true, true);
    check_getSmallAlignmentImage(CellConstraints.RIGHT, true, true);
    check_getSmallAlignmentImage(CellConstraints.FILL, true, true);
    ///*w  w w. j  av  a 2s  .c o m*/
    check_getSmallAlignmentImage(CellConstraints.DEFAULT, false, false);
    check_getSmallAlignmentImage(CellConstraints.TOP, false, true);
    check_getSmallAlignmentImage(CellConstraints.CENTER, false, true);
    check_getSmallAlignmentImage(CellConstraints.BOTTOM, false, true);
    check_getSmallAlignmentImage(CellConstraints.FILL, false, true);
}

From source file:org.jdesktop.swingx.demo.ContactPanel.java

private void initComponents() {
    // JFormDesigner - Component initialization - DO NOT MODIFY  //GEN-BEGIN:initComponents
    // Generated using JFormDesigner Evaluation license - Peter Weishapl
    xTextField2 = new JXTextField();
    xTextField1 = new JXTextField();
    xTextField3 = new JXTextField();
    label1 = new JLabel();
    xFormattedTextField1 = new JXFormattedTextField();
    xTextField4 = new JXTextField();
    separator1 = new JSeparator();
    xTextArea1 = new JXTextArea();
    CellConstraints cc = new CellConstraints();

    //======== this ========
    setBackground(Color.white);/*w w w  . ja va  2  s  .  co  m*/
    setBorder(Borders.DLU4_BORDER);

    setLayout(new FormLayout(
            new ColumnSpec[] { FormFactory.DEFAULT_COLSPEC, FormFactory.LABEL_COMPONENT_GAP_COLSPEC,
                    FormFactory.DEFAULT_COLSPEC, FormFactory.LABEL_COMPONENT_GAP_COLSPEC,
                    FormFactory.DEFAULT_COLSPEC, FormFactory.LABEL_COMPONENT_GAP_COLSPEC,
                    new ColumnSpec(ColumnSpec.FILL, Sizes.DEFAULT, FormSpec.DEFAULT_GROW),
                    FormFactory.LABEL_COMPONENT_GAP_COLSPEC, FormFactory.DEFAULT_COLSPEC,
                    FormFactory.LABEL_COMPONENT_GAP_COLSPEC, FormFactory.DEFAULT_COLSPEC },
            new RowSpec[] { new RowSpec(RowSpec.FILL, Sizes.DEFAULT, FormSpec.NO_GROW),
                    FormFactory.LINE_GAP_ROWSPEC, FormFactory.DEFAULT_ROWSPEC, FormFactory.LINE_GAP_ROWSPEC,
                    new RowSpec(RowSpec.CENTER, Sizes.DEFAULT, FormSpec.DEFAULT_GROW),
                    FormFactory.LINE_GAP_ROWSPEC, FormFactory.DEFAULT_ROWSPEC, FormFactory.LINE_GAP_ROWSPEC,
                    FormFactory.DEFAULT_ROWSPEC }));

    //---- xTextField2 ----
    xTextField2.setPrompt("Prefix");
    xTextField2.setFont(xTextField2.getFont().deriveFont(xTextField2.getFont().getStyle() | Font.BOLD,
            xTextField2.getFont().getSize() + 2f));
    add(xTextField2, cc.xy(1, 1));

    //---- xTextField1 ----
    xTextField1.setPrompt("First Name");
    xTextField1.setPromptForeground(Color.red);
    xTextField1.setToolTipText("You must enter a first name.");
    xTextField1.setFont(xTextField1.getFont().deriveFont(xTextField1.getFont().getStyle() | Font.BOLD,
            xTextField1.getFont().getSize() + 2f));
    add(xTextField1, cc.xy(3, 1));

    //---- xTextField3 ----
    xTextField3.setPrompt("Last Name");
    xTextField3.setPromptFontStyle(null);
    xTextField3.setFont(xTextField3.getFont().deriveFont(xTextField3.getFont().getStyle() | Font.BOLD,
            xTextField3.getFont().getSize() + 2f));
    add(xTextField3, cc.xy(5, 1));

    //---- label1 ----
    label1.setText("Birthdate:");
    add(label1, cc.xy(9, 1));

    //---- xFormattedTextField1 ----
    xFormattedTextField1.setPrompt("MM/dd/yy");
    add(xFormattedTextField1, cc.xy(11, 1));

    //---- xTextField4 ----
    xTextField4.setPrompt("Company");
    add(xTextField4, cc.xywh(1, 3, 11, 1, CellConstraints.LEFT, CellConstraints.DEFAULT));
    add(separator1, cc.xywh(1, 7, 11, 1));

    //---- xTextArea1 ----
    xTextArea1.setPrompt("Notes");
    add(xTextArea1, cc.xywh(1, 9, 11, 1));
    // JFormDesigner - End of component initialization  //GEN-END:initComponents
}

From source file:org.jdesktop.swingx.demo.CustomizeBuddyField.java

private void initComponents() {
    // JFormDesigner - Component initialization - DO NOT MODIFY
    // //GEN-BEGIN:initComponents
    // Generated using JFormDesigner Evaluation license - Peter Weishapl
    panel2 = new JPanel();
    titledSeparator1 = new TitledSeparator();
    label2 = new JLabel();
    txtOuterMargin = new JFormattedTextField();
    panel3 = new JPanel();
    cbSnapBack = new JRadioButton();
    toggleButton1 = new JLabel();
    cbRss = new JRadioButton();
    label1 = new JLabel();
    cbCheckbox = new JRadioButton();
    checkBox2 = new JCheckBox();
    cbGap = new JRadioButton();
    panel1 = new JPanel();
    btnAddLeft = new JButton();
    btnAddRight = new JButton();
    btnRemoveall = new JButton();
    CellConstraints cc = new CellConstraints();

    //======== panel2 ========
    {/*from ww w . jav a2s.co m*/

        panel2.setLayout(new BorderLayout());

        //======== this ========
        {
            this.setLayout(new FormLayout(
                    new ColumnSpec[] { FormFactory.UNRELATED_GAP_COLSPEC, FormFactory.DEFAULT_COLSPEC,
                            FormFactory.LABEL_COMPONENT_GAP_COLSPEC,
                            new ColumnSpec(ColumnSpec.FILL, Sizes.DEFAULT, FormSpec.DEFAULT_GROW) },
                    new RowSpec[] { FormFactory.DEFAULT_ROWSPEC, FormFactory.LINE_GAP_ROWSPEC,
                            FormFactory.DEFAULT_ROWSPEC, FormFactory.UNRELATED_GAP_ROWSPEC,
                            FormFactory.DEFAULT_ROWSPEC }));

            //---- titledSeparator1 ----
            titledSeparator1.setTitle("Buddies");
            this.add(titledSeparator1, cc.xywh(1, 1, 4, 1));

            //---- label2 ----
            label2.setText("Outer Margin:");
            this.add(label2, cc.xy(2, 3));

            //---- txtOuterMargin ----
            txtOuterMargin.addPropertyChangeListener("value", new PropertyChangeListener() {
                public void propertyChange(PropertyChangeEvent e) {
                    txtOuterMarginPropertyChange(e);
                }
            });
            this.add(txtOuterMargin, cc.xy(4, 3));

            //======== panel3 ========
            {
                panel3.setLayout(new FormLayout(
                        new ColumnSpec[] { FormFactory.DEFAULT_COLSPEC,
                                new ColumnSpec(ColumnSpec.LEFT, Sizes.DLUX1, FormSpec.NO_GROW),
                                FormFactory.DEFAULT_COLSPEC, FormFactory.UNRELATED_GAP_COLSPEC,
                                FormFactory.DEFAULT_COLSPEC,
                                new ColumnSpec(ColumnSpec.LEFT, Sizes.DLUX1, FormSpec.NO_GROW),
                                FormFactory.DEFAULT_COLSPEC, FormFactory.UNRELATED_GAP_COLSPEC,
                                FormFactory.DEFAULT_COLSPEC,
                                new ColumnSpec(ColumnSpec.LEFT, Sizes.DLUX1, FormSpec.NO_GROW),
                                FormFactory.DEFAULT_COLSPEC, FormFactory.UNRELATED_GAP_COLSPEC,
                                new ColumnSpec(ColumnSpec.FILL, Sizes.DEFAULT, FormSpec.DEFAULT_GROW) },
                        new RowSpec[] { FormFactory.DEFAULT_ROWSPEC, FormFactory.LINE_GAP_ROWSPEC,
                                FormFactory.DEFAULT_ROWSPEC }));

                //---- cbSnapBack ----
                cbSnapBack.setSelected(true);
                panel3.add(cbSnapBack, cc.xy(1, 1));

                //---- toggleButton1 ----
                toggleButton1.setIcon(
                        new ImageIcon(getClass().getResource("/org/jdesktop/swingx/demo/Search_SnapBack.png")));
                panel3.add(toggleButton1, cc.xy(3, 1));
                panel3.add(cbRss, cc.xy(5, 1));

                //---- label1 ----
                label1.setIcon(
                        new ImageIcon(getClass().getResource("/org/jdesktop/swingx/demo/ShowRSSButton.png")));
                panel3.add(label1, cc.xy(7, 1));
                panel3.add(cbCheckbox, cc.xy(9, 1));
                panel3.add(checkBox2, cc.xy(11, 1));

                //---- cbGap ----
                cbGap.setText("Gap");
                panel3.add(cbGap, cc.xy(13, 1));

                //======== panel1 ========
                {
                    panel1.setLayout(new FormLayout(
                            new ColumnSpec[] { FormFactory.UNRELATED_GAP_COLSPEC,
                                    new ColumnSpec(ColumnSpec.RIGHT, Sizes.DEFAULT, FormSpec.NO_GROW),
                                    FormFactory.LABEL_COMPONENT_GAP_COLSPEC,
                                    new ColumnSpec(ColumnSpec.LEFT, Sizes.DEFAULT, FormSpec.NO_GROW),
                                    FormFactory.UNRELATED_GAP_COLSPEC, FormFactory.DEFAULT_COLSPEC },
                            RowSpec.decodeSpecs("default")));

                    //---- btnAddLeft ----
                    btnAddLeft.setText("Add Left");
                    btnAddLeft.addActionListener(new ActionListener() {
                        public void actionPerformed(ActionEvent e) {
                            btnAddLeftActionPerformed(e);
                        }
                    });
                    panel1.add(btnAddLeft, cc.xy(2, 1));

                    //---- btnAddRight ----
                    btnAddRight.setText("Add Right");
                    btnAddRight.addActionListener(new ActionListener() {
                        public void actionPerformed(ActionEvent e) {
                            btnAddRightActionPerformed(e);
                        }
                    });
                    panel1.add(btnAddRight, cc.xy(4, 1));

                    //---- btnRemoveall ----
                    btnRemoveall.setText("Remove All");
                    btnRemoveall.addActionListener(new ActionListener() {
                        public void actionPerformed(ActionEvent e) {
                            btnRemoveallActionPerformed(e);
                        }
                    });
                    panel1.add(btnRemoveall,
                            cc.xywh(6, 1, 1, 1, CellConstraints.LEFT, CellConstraints.DEFAULT));
                }
                panel3.add(panel1, cc.xywh(1, 3, 13, 1));
            }
            this.add(panel3, cc.xywh(2, 5, 3, 1));
        }
        panel2.add(this, BorderLayout.CENTER);
    }

    //---- buttonGroup1 ----
    ButtonGroup buttonGroup1 = new ButtonGroup();
    buttonGroup1.add(cbSnapBack);
    buttonGroup1.add(cbRss);
    buttonGroup1.add(cbCheckbox);
    buttonGroup1.add(cbGap);
    // //GEN-END:initComponents
}

From source file:org.jdesktop.xswingx.demo.CustomizeBuddyField.java

private void initComponents() {
    // JFormDesigner - Component initialization - DO NOT MODIFY
    // //GEN-BEGIN:initComponents
    // Generated using JFormDesigner Evaluation license - Peter Weishapl
    panel2 = new JPanel();
    titledSeparator1 = new TitledSeparator();
    label2 = new JLabel();
    txtOuterMargin = new JFormattedTextField();
    panel3 = new JPanel();
    cbSnapBack = new JRadioButton();
    toggleButton1 = new JLabel();
    cbRss = new JRadioButton();
    label1 = new JLabel();
    cbCheckbox = new JRadioButton();
    checkBox2 = new JCheckBox();
    cbGap = new JRadioButton();
    panel1 = new JPanel();
    btnAddLeft = new JButton();
    btnAddRight = new JButton();
    btnRemoveall = new JButton();
    CellConstraints cc = new CellConstraints();

    //======== panel2 ========
    {/*from   w  w w  . j  a v  a 2s. c o  m*/

        panel2.setLayout(new BorderLayout());

        //======== this ========
        {
            this.setLayout(new FormLayout(
                    new ColumnSpec[] { FormFactory.UNRELATED_GAP_COLSPEC, FormFactory.DEFAULT_COLSPEC,
                            FormFactory.LABEL_COMPONENT_GAP_COLSPEC,
                            new ColumnSpec(ColumnSpec.FILL, Sizes.DEFAULT, FormSpec.DEFAULT_GROW) },
                    new RowSpec[] { FormFactory.DEFAULT_ROWSPEC, FormFactory.LINE_GAP_ROWSPEC,
                            FormFactory.DEFAULT_ROWSPEC, FormFactory.UNRELATED_GAP_ROWSPEC,
                            FormFactory.DEFAULT_ROWSPEC }));

            //---- titledSeparator1 ----
            titledSeparator1.setTitle("Buddies");
            this.add(titledSeparator1, cc.xywh(1, 1, 4, 1));

            //---- label2 ----
            label2.setText("Outer Margin:");
            this.add(label2, cc.xy(2, 3));

            //---- txtOuterMargin ----
            txtOuterMargin.addPropertyChangeListener("value", new PropertyChangeListener() {
                public void propertyChange(PropertyChangeEvent e) {
                    txtOuterMarginPropertyChange(e);
                }
            });
            this.add(txtOuterMargin, cc.xy(4, 3));

            //======== panel3 ========
            {
                panel3.setLayout(new FormLayout(
                        new ColumnSpec[] { FormFactory.DEFAULT_COLSPEC,
                                new ColumnSpec(ColumnSpec.LEFT, Sizes.DLUX1, FormSpec.NO_GROW),
                                FormFactory.DEFAULT_COLSPEC, FormFactory.UNRELATED_GAP_COLSPEC,
                                FormFactory.DEFAULT_COLSPEC,
                                new ColumnSpec(ColumnSpec.LEFT, Sizes.DLUX1, FormSpec.NO_GROW),
                                FormFactory.DEFAULT_COLSPEC, FormFactory.UNRELATED_GAP_COLSPEC,
                                FormFactory.DEFAULT_COLSPEC,
                                new ColumnSpec(ColumnSpec.LEFT, Sizes.DLUX1, FormSpec.NO_GROW),
                                FormFactory.DEFAULT_COLSPEC, FormFactory.UNRELATED_GAP_COLSPEC,
                                new ColumnSpec(ColumnSpec.FILL, Sizes.DEFAULT, FormSpec.DEFAULT_GROW) },
                        new RowSpec[] { FormFactory.DEFAULT_ROWSPEC, FormFactory.LINE_GAP_ROWSPEC,
                                FormFactory.DEFAULT_ROWSPEC }));

                //---- cbSnapBack ----
                cbSnapBack.setSelected(true);
                panel3.add(cbSnapBack, cc.xy(1, 1));

                //---- toggleButton1 ----
                toggleButton1.setIcon(new ImageIcon(
                        getClass().getResource("/org/jdesktop/xswingx/demo/Search_SnapBack.png")));
                panel3.add(toggleButton1, cc.xy(3, 1));
                panel3.add(cbRss, cc.xy(5, 1));

                //---- label1 ----
                label1.setIcon(
                        new ImageIcon(getClass().getResource("/org/jdesktop/xswingx/demo/ShowRSSButton.png")));
                panel3.add(label1, cc.xy(7, 1));
                panel3.add(cbCheckbox, cc.xy(9, 1));
                panel3.add(checkBox2, cc.xy(11, 1));

                //---- cbGap ----
                cbGap.setText("Gap");
                panel3.add(cbGap, cc.xy(13, 1));

                //======== panel1 ========
                {
                    panel1.setLayout(new FormLayout(
                            new ColumnSpec[] { FormFactory.UNRELATED_GAP_COLSPEC,
                                    new ColumnSpec(ColumnSpec.RIGHT, Sizes.DEFAULT, FormSpec.NO_GROW),
                                    FormFactory.LABEL_COMPONENT_GAP_COLSPEC,
                                    new ColumnSpec(ColumnSpec.LEFT, Sizes.DEFAULT, FormSpec.NO_GROW),
                                    FormFactory.UNRELATED_GAP_COLSPEC, FormFactory.DEFAULT_COLSPEC },
                            RowSpec.decodeSpecs("default")));

                    //---- btnAddLeft ----
                    btnAddLeft.setText("Add Left");
                    btnAddLeft.addActionListener(new ActionListener() {
                        public void actionPerformed(ActionEvent e) {
                            btnAddLeftActionPerformed(e);
                        }
                    });
                    panel1.add(btnAddLeft, cc.xy(2, 1));

                    //---- btnAddRight ----
                    btnAddRight.setText("Add Right");
                    btnAddRight.addActionListener(new ActionListener() {
                        public void actionPerformed(ActionEvent e) {
                            btnAddRightActionPerformed(e);
                        }
                    });
                    panel1.add(btnAddRight, cc.xy(4, 1));

                    //---- btnRemoveall ----
                    btnRemoveall.setText("Remove All");
                    btnRemoveall.addActionListener(new ActionListener() {
                        public void actionPerformed(ActionEvent e) {
                            btnRemoveallActionPerformed(e);
                        }
                    });
                    panel1.add(btnRemoveall,
                            cc.xywh(6, 1, 1, 1, CellConstraints.LEFT, CellConstraints.DEFAULT));
                }
                panel3.add(panel1, cc.xywh(1, 3, 13, 1));
            }
            this.add(panel3, cc.xywh(2, 5, 3, 1));
        }
        panel2.add(this, BorderLayout.CENTER);
    }

    //---- buttonGroup1 ----
    ButtonGroup buttonGroup1 = new ButtonGroup();
    buttonGroup1.add(cbSnapBack);
    buttonGroup1.add(cbRss);
    buttonGroup1.add(cbCheckbox);
    buttonGroup1.add(cbGap);
    // //GEN-END:initComponents
}

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();//from w  ww .  j  av a 2 s. co  m

    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.pmedv.blackboard.panels.BoardPropertiesPanel.java

License:Open Source License

private void initComponents() {
    // JFormDesigner - Component initialization - DO NOT MODIFY  //GEN-BEGIN:initComponents
    label3 = new JLabel();
    typeCombo = new JComboBox(BoardType.values());
    label4 = new JLabel();
    fileField = new FileBrowserTextfield();
    label1 = new JLabel();
    boardWidthSpinner = new JSpinner();
    label5 = new JLabel();
    label2 = new JLabel();
    boardHeightSpinner = new JSpinner();
    unitComboBox = new JComboBox();
    CellConstraints cc = new CellConstraints();

    //======== this ========
    setLayout(new FormLayout("2*($lcgap), default, 3*($lcgap, default:grow), 2*($lcgap)",
            "2*($lgap), 4*(default, $lgap), $lgap"));

    //---- label3 ----
    label3.setText(resources.getResourceByKey("BoardPropertiesPanel.boardType"));
    add(label3, cc.xy(3, 3));//from   w w w. j  av  a 2 s  .c  om
    add(typeCombo, cc.xywh(5, 3, 5, 1));

    //---- label4 ----
    label4.setText(resources.getResourceByKey("BoardPropertiesPanel.background"));
    add(label4, cc.xy(3, 5));
    add(fileField, cc.xywh(5, 5, 5, 1));

    //---- label1 ----
    label1.setText(resources.getResourceByKey("BoardPropertiesPanel.board.width"));
    add(label1, cc.xy(3, 7));
    add(boardWidthSpinner, cc.xy(5, 7));

    //---- label5 ----
    label5.setText(resources.getResourceByKey("BoardPropertiesPanel.unit"));
    add(label5, cc.xy(7, 7, CellConstraints.LEFT, CellConstraints.DEFAULT));

    //---- label2 ----
    label2.setText(resources.getResourceByKey("BoardPropertiesPanel.board.height"));
    add(label2, cc.xy(3, 9));
    add(boardHeightSpinner, cc.xy(5, 9));
    add(unitComboBox, cc.xy(7, 9, CellConstraints.LEFT, CellConstraints.DEFAULT));
    // JFormDesigner - End of component initialization  //GEN-END:initComponents
}

From source file:se.streamsource.streamflow.client.ui.administration.organisationsettings.MailRestrictionsView.java

License:Apache License

public MailRestrictionsView(@Service ApplicationContext context, @Uses final MailRestrictionsModel model) {
    this.model = model;

    FormLayout layout = new FormLayout("150dlu, 2dlu, 50, 200", "pref");
    setLayout(layout);/* ww  w. j ava 2  s.  c o  m*/
    setMaximumSize(new Dimension(Short.MAX_VALUE, 50));
    builder = new DefaultFormBuilder(layout, this);

    builder.add(new JLabel(i18n.text(AdministrationResources.mailrestrictions_addresses)),
            new CellConstraints(1, 1, 1, 1, CellConstraints.LEFT, CellConstraints.TOP, new Insets(4, 0, 0, 0)));

    JPanel addressPanel = new JPanel(new BorderLayout());
    addressPanel.setBorder(Borders.createEmptyBorder("2dlu, 2dlu, 2dlu, 2dlu"));

    ActionMap am = context.getActionMap(this);
    setActionMap(am);

    JPopupMenu options = new JPopupMenu();
    options.add(am.get("rename"));
    options.add(am.get("remove"));

    JScrollPane scrollPane = new JScrollPane();
    EventList<LinkValue> itemValueEventList = model.getList();
    list = new JList(new EventListModel<LinkValue>(itemValueEventList));
    list.setCellRenderer(new LinkListCellRenderer());
    scrollPane.setViewportView(list);
    addressPanel.add(scrollPane, BorderLayout.CENTER);

    JPanel toolbar = new JPanel();
    toolbar.add(new StreamflowButton(am.get("add")));
    toolbar.add(new StreamflowButton(new OptionsAction(options)));
    addressPanel.add(toolbar, BorderLayout.SOUTH);

    list.getSelectionModel()
            .addListSelectionListener(new SelectionActionEnabler(am.get("remove"), am.get("rename")));

    builder.add(addressPanel, new CellConstraints(3, 1, 2, 1));

    new RefreshWhenShowing(this, model);

}

From source file:se.streamsource.streamflow.client.ui.administration.projectsettings.CaseDueOnNotificationView.java

License:Apache License

public CaseDueOnNotificationView(@Service ApplicationContext context, @Uses CaseDueOnNotificationModel model) {
    this.model = model;
    model.addObserver(this);

    threshold.setColumns(2);/*from  w  w  w  .j ava  2s .  c o m*/
    FormLayout layout = new FormLayout("150dlu, 2dlu, 50, 200", "pref, pref, pref");
    setLayout(layout);
    setMaximumSize(new Dimension(Short.MAX_VALUE, 50));
    builder = new DefaultFormBuilder(layout, this);
    builder.add(new JLabel(i18n.text(AdministrationResources.dueon_notification_threshold)),
            new CellConstraints(1, 1));
    builder.add(threshold, new CellConstraints(3, 1));

    builder.add(new JLabel(i18n.text(AdministrationResources.dueon_notification_active)),
            new CellConstraints(1, 2));
    builder.add(active, new CellConstraints(3, 2, 2, 1));

    builder.add(new JLabel(i18n.text(AdministrationResources.dueon_notification_additional_recipient)),
            new CellConstraints(1, 3, 1, 1, CellConstraints.LEFT, CellConstraints.TOP, new Insets(4, 0, 0, 0)));
    ActionMap am = context.getActionMap(this);
    setActionMap(am);

    new ActionBinder(am).bind("changeThreshold", threshold);
    new ActionBinder(am).bind("activateNotifications", active);

    new RefreshWhenShowing(this, model);
}