Search in sources :

Example 46 with CellConstraints

use of com.jgoodies.forms.layout.CellConstraints in project chipKIT32-MAX by chipKIT32.

the class EnvironmentVarsForm method createPanel.

public JPanel createPanel() {
    JPanel jpanel1 = new JPanel();
    FormLayout formlayout1 = new FormLayout("FILL:7DLU:NONE,RIGHT:MAX(65DLU;DEFAULT):NONE,FILL:3DLU:NONE,FILL:DEFAULT:GROW(1.0),FILL:7DLU:NONE", "CENTER:9DLU:NONE,FILL:DEFAULT:GROW(1.0),CENTER:9DLU:NONE");
    CellConstraints cc = new CellConstraints();
    jpanel1.setLayout(formlayout1);
    _envVarsTextArea.setName("envVarsTextArea");
    JScrollPane jscrollpane1 = new JScrollPane();
    jscrollpane1.setViewportView(_envVarsTextArea);
    jscrollpane1.setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED);
    jscrollpane1.setHorizontalScrollBarPolicy(JScrollPane.HORIZONTAL_SCROLLBAR_AS_NEEDED);
    jpanel1.add(jscrollpane1, cc.xy(4, 2));
    _envVarsLabel.setName("envVarsLabel");
    _envVarsLabel.setText(Messages.getString("setVariables"));
    jpanel1.add(_envVarsLabel, new CellConstraints(2, 2, 1, 1, CellConstraints.DEFAULT, CellConstraints.TOP));
    addFillComponents(jpanel1, new int[] { 1, 2, 3, 4, 5 }, new int[] { 1, 2, 3 });
    return jpanel1;
}
Also used : FormLayout(com.jgoodies.forms.layout.FormLayout) JScrollPane(javax.swing.JScrollPane) JPanel(javax.swing.JPanel) CellConstraints(com.jgoodies.forms.layout.CellConstraints)

Example 47 with CellConstraints

use of com.jgoodies.forms.layout.CellConstraints in project chipKIT32-MAX by chipKIT32.

the class HeaderForm method createPanel.

public JPanel createPanel() {
    JPanel jpanel1 = new JPanel();
    FormLayout formlayout1 = new FormLayout("FILL:7DLU:NONE,RIGHT:MAX(65DLU;DEFAULT):NONE,FILL:3DLU:NONE,FILL:DEFAULT:NONE,FILL:7DLU:NONE,FILL:DEFAULT:NONE,FILL:DEFAULT:GROW(1.0),FILL:7DLU:NONE", "CENTER:9DLU:NONE,CENTER:DEFAULT:NONE,CENTER:9DLU:NONE,CENTER:DEFAULT:NONE,CENTER:3DLU:NONE,FILL:DEFAULT:GROW(0.2),CENTER:3DLU:NONE,FILL:DEFAULT:GROW(1.0),CENTER:9DLU:NONE");
    CellConstraints cc = new CellConstraints();
    jpanel1.setLayout(formlayout1);
    _headerTypeLabel.setName("headerTypeLabel");
    _headerTypeLabel.setText(Messages.getString("headerType"));
    jpanel1.add(_headerTypeLabel, cc.xy(2, 2));
    _guiHeaderRadio.setActionCommand("GUI");
    _guiHeaderRadio.setName("guiHeaderRadio");
    _guiHeaderRadio.setText(Messages.getString("gui"));
    _headerButtonGroup.add(_guiHeaderRadio);
    jpanel1.add(_guiHeaderRadio, cc.xy(4, 2));
    _consoleHeaderRadio.setActionCommand("Console");
    _consoleHeaderRadio.setName("consoleHeaderRadio");
    _consoleHeaderRadio.setText(Messages.getString("console"));
    _headerButtonGroup.add(_consoleHeaderRadio);
    jpanel1.add(_consoleHeaderRadio, cc.xy(6, 2));
    _headerObjectsTextArea.setName("headerObjectsTextArea");
    JScrollPane jscrollpane1 = new JScrollPane();
    jscrollpane1.setViewportView(_headerObjectsTextArea);
    jscrollpane1.setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED);
    jscrollpane1.setHorizontalScrollBarPolicy(JScrollPane.HORIZONTAL_SCROLLBAR_AS_NEEDED);
    jpanel1.add(jscrollpane1, cc.xywh(4, 6, 4, 1));
    _libsTextArea.setName("libsTextArea");
    JScrollPane jscrollpane2 = new JScrollPane();
    jscrollpane2.setViewportView(_libsTextArea);
    jscrollpane2.setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED);
    jscrollpane2.setHorizontalScrollBarPolicy(JScrollPane.HORIZONTAL_SCROLLBAR_AS_NEEDED);
    jpanel1.add(jscrollpane2, cc.xywh(4, 8, 4, 1));
    _headerObjectsCheck.setActionCommand("Object files");
    _headerObjectsCheck.setName("headerObjectsCheck");
    _headerObjectsCheck.setText(Messages.getString("objectFiles"));
    jpanel1.add(_headerObjectsCheck, new CellConstraints(2, 6, 1, 1, CellConstraints.DEFAULT, CellConstraints.TOP));
    _libsCheck.setActionCommand("w32api");
    _libsCheck.setName("libsCheck");
    _libsCheck.setText(Messages.getString("libs"));
    jpanel1.add(_libsCheck, new CellConstraints(2, 8, 1, 1, CellConstraints.DEFAULT, CellConstraints.TOP));
    _linkerOptionsSeparator.setName("linkerOptionsSeparator");
    _linkerOptionsSeparator.setText(Messages.getString("linkerOptions"));
    jpanel1.add(_linkerOptionsSeparator, cc.xywh(2, 4, 6, 1));
    addFillComponents(jpanel1, new int[] { 1, 2, 3, 4, 5, 6, 7, 8 }, new int[] { 1, 2, 3, 4, 5, 6, 7, 8, 9 });
    return jpanel1;
}
Also used : FormLayout(com.jgoodies.forms.layout.FormLayout) JScrollPane(javax.swing.JScrollPane) JPanel(javax.swing.JPanel) CellConstraints(com.jgoodies.forms.layout.CellConstraints)

Example 48 with CellConstraints

use of com.jgoodies.forms.layout.CellConstraints in project chipKIT32-MAX by chipKIT32.

the class MessagesForm method addFillComponents.

/**
    * Adds fill components to empty cells in the first row and first column of the grid.
    * This ensures that the grid spacing will be the same as shown in the designer.
    * @param cols an array of column indices in the first row where fill components should be added.
    * @param rows an array of row indices in the first column where fill components should be added.
    */
void addFillComponents(Container panel, int[] cols, int[] rows) {
    Dimension filler = new Dimension(10, 10);
    boolean filled_cell_11 = false;
    CellConstraints cc = new CellConstraints();
    if (cols.length > 0 && rows.length > 0) {
        if (cols[0] == 1 && rows[0] == 1) {
            /** add a rigid area  */
            panel.add(Box.createRigidArea(filler), cc.xy(1, 1));
            filled_cell_11 = true;
        }
    }
    for (int index = 0; index < cols.length; index++) {
        if (cols[index] == 1 && filled_cell_11) {
            continue;
        }
        panel.add(Box.createRigidArea(filler), cc.xy(cols[index], 1));
    }
    for (int index = 0; index < rows.length; index++) {
        if (rows[index] == 1 && filled_cell_11) {
            continue;
        }
        panel.add(Box.createRigidArea(filler), cc.xy(1, rows[index]));
    }
}
Also used : Dimension(java.awt.Dimension) CellConstraints(com.jgoodies.forms.layout.CellConstraints)

Example 49 with CellConstraints

use of com.jgoodies.forms.layout.CellConstraints in project beast-mcmc by beast-dev.

the class JreForm method createPanel2.

public JPanel createPanel2() {
    JPanel jpanel1 = new JPanel();
    FormLayout formlayout1 = new FormLayout("FILL:DEFAULT:GROW(1.0),FILL:3DLU:NONE,FILL:DEFAULT:NONE,FILL:3DLU:NONE,FILL:DEFAULT:NONE", "CENTER:DEFAULT:NONE");
    CellConstraints cc = new CellConstraints();
    jpanel1.setLayout(formlayout1);
    _jrePathField.setName("jrePathField");
    _jrePathField.setToolTipText(Messages.getString("jrePathTip"));
    jpanel1.add(_jrePathField, cc.xy(1, 1));
    _bundledJre64BitCheck.setActionCommand(Messages.getString("bundledJre64Bit"));
    _bundledJre64BitCheck.setName("bundledJre64BitCheck");
    _bundledJre64BitCheck.setText(Messages.getString("bundledJre64Bit"));
    _bundledJre64BitCheck.setToolTipText(Messages.getString("bundledJre64BitTip"));
    jpanel1.add(_bundledJre64BitCheck, cc.xy(3, 1));
    _bundledJreAsFallbackCheck.setActionCommand(Messages.getString("bundledJreAsFallback"));
    _bundledJreAsFallbackCheck.setName("bundledJreAsFallbackCheck");
    _bundledJreAsFallbackCheck.setText(Messages.getString("bundledJreAsFallback"));
    _bundledJreAsFallbackCheck.setToolTipText(Messages.getString("bundledJreAsFallbackTip"));
    jpanel1.add(_bundledJreAsFallbackCheck, cc.xy(5, 1));
    addFillComponents(jpanel1, new int[] { 2, 4 }, new int[0]);
    return jpanel1;
}
Also used : FormLayout(com.jgoodies.forms.layout.FormLayout) JPanel(javax.swing.JPanel) CellConstraints(com.jgoodies.forms.layout.CellConstraints)

Example 50 with CellConstraints

use of com.jgoodies.forms.layout.CellConstraints in project beast-mcmc by beast-dev.

the class MessagesForm method addFillComponents.

/**
    * Adds fill components to empty cells in the first row and first column of the grid.
    * This ensures that the grid spacing will be the same as shown in the designer.
    * @param cols an array of column indices in the first row where fill components should be added.
    * @param rows an array of row indices in the first column where fill components should be added.
    */
void addFillComponents(Container panel, int[] cols, int[] rows) {
    Dimension filler = new Dimension(10, 10);
    boolean filled_cell_11 = false;
    CellConstraints cc = new CellConstraints();
    if (cols.length > 0 && rows.length > 0) {
        if (cols[0] == 1 && rows[0] == 1) {
            /** add a rigid area  */
            panel.add(Box.createRigidArea(filler), cc.xy(1, 1));
            filled_cell_11 = true;
        }
    }
    for (int index = 0; index < cols.length; index++) {
        if (cols[index] == 1 && filled_cell_11) {
            continue;
        }
        panel.add(Box.createRigidArea(filler), cc.xy(cols[index], 1));
    }
    for (int index = 0; index < rows.length; index++) {
        if (rows[index] == 1 && filled_cell_11) {
            continue;
        }
        panel.add(Box.createRigidArea(filler), cc.xy(1, rows[index]));
    }
}
Also used : Dimension(java.awt.Dimension) CellConstraints(com.jgoodies.forms.layout.CellConstraints)

Aggregations

CellConstraints (com.jgoodies.forms.layout.CellConstraints)142 FormLayout (com.jgoodies.forms.layout.FormLayout)97 JPanel (javax.swing.JPanel)65 Dimension (java.awt.Dimension)42 JLabel (javax.swing.JLabel)30 JScrollPane (javax.swing.JScrollPane)29 PanelBuilder (com.jgoodies.forms.builder.PanelBuilder)18 BorderLayout (java.awt.BorderLayout)12 JButton (javax.swing.JButton)7 TitledSeparator (com.jeta.forms.components.separator.TitledSeparator)6 JRadioButton (javax.swing.JRadioButton)6 DatePanel (jgnash.ui.components.DatePanel)5 TextAdapter (org.apache.cayenne.modeler.util.TextAdapter)5 FlowLayout (java.awt.FlowLayout)4 JSpinner (javax.swing.JSpinner)4 JTextField (javax.swing.JTextField)4 SpinnerNumberModel (javax.swing.SpinnerNumberModel)4 GridConstraints (com.intellij.uiDesigner.core.GridConstraints)3 DefaultFormBuilder (com.jgoodies.forms.builder.DefaultFormBuilder)3 JCayenneCheckBox (org.apache.cayenne.swing.components.JCayenneCheckBox)3