Search in sources :

Example 51 with CellConstraints

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

the class MessagesForm 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,CENTER:DEFAULT:NONE,CENTER:3DLU:NONE,FILL:DEFAULT:GROW(1.0),CENTER:3DLU:NONE,FILL:DEFAULT:GROW(1.0),CENTER:3DLU:NONE,FILL:DEFAULT:GROW(1.0),CENTER:3DLU:NONE,FILL:DEFAULT:GROW(1.0),CENTER:3DLU:NONE,FILL:DEFAULT:GROW(1.0),CENTER:9DLU:NONE");
    CellConstraints cc = new CellConstraints();
    jpanel1.setLayout(formlayout1);
    _startupErrTextArea.setName("startupErrTextArea");
    JScrollPane jscrollpane1 = new JScrollPane();
    jscrollpane1.setViewportView(_startupErrTextArea);
    jscrollpane1.setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED);
    jscrollpane1.setHorizontalScrollBarPolicy(JScrollPane.HORIZONTAL_SCROLLBAR_AS_NEEDED);
    jpanel1.add(jscrollpane1, cc.xy(4, 4));
    _bundledJreErrTextArea.setName("bundledJreErrTextArea");
    JScrollPane jscrollpane2 = new JScrollPane();
    jscrollpane2.setViewportView(_bundledJreErrTextArea);
    jscrollpane2.setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED);
    jscrollpane2.setHorizontalScrollBarPolicy(JScrollPane.HORIZONTAL_SCROLLBAR_AS_NEEDED);
    jpanel1.add(jscrollpane2, cc.xy(4, 6));
    _jreVersionErrTextArea.setName("jreVersionErrTextArea");
    _jreVersionErrTextArea.setToolTipText(Messages.getString("jreVersionErrTip"));
    JScrollPane jscrollpane3 = new JScrollPane();
    jscrollpane3.setViewportView(_jreVersionErrTextArea);
    jscrollpane3.setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED);
    jscrollpane3.setHorizontalScrollBarPolicy(JScrollPane.HORIZONTAL_SCROLLBAR_AS_NEEDED);
    jpanel1.add(jscrollpane3, cc.xy(4, 8));
    _launcherErrTextArea.setName("launcherErrTextArea");
    JScrollPane jscrollpane4 = new JScrollPane();
    jscrollpane4.setViewportView(_launcherErrTextArea);
    jscrollpane4.setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED);
    jscrollpane4.setHorizontalScrollBarPolicy(JScrollPane.HORIZONTAL_SCROLLBAR_AS_NEEDED);
    jpanel1.add(jscrollpane4, cc.xy(4, 10));
    JLabel jlabel1 = new JLabel();
    jlabel1.setText(Messages.getString("startupErr"));
    jpanel1.add(jlabel1, new CellConstraints(2, 4, 1, 1, CellConstraints.DEFAULT, CellConstraints.TOP));
    JLabel jlabel2 = new JLabel();
    jlabel2.setText(Messages.getString("bundledJreErr"));
    jpanel1.add(jlabel2, new CellConstraints(2, 6, 1, 1, CellConstraints.DEFAULT, CellConstraints.TOP));
    JLabel jlabel3 = new JLabel();
    jlabel3.setText(Messages.getString("jreVersionErr"));
    jpanel1.add(jlabel3, new CellConstraints(2, 8, 1, 1, CellConstraints.DEFAULT, CellConstraints.TOP));
    JLabel jlabel4 = new JLabel();
    jlabel4.setText(Messages.getString("launcherErr"));
    jpanel1.add(jlabel4, new CellConstraints(2, 10, 1, 1, CellConstraints.DEFAULT, CellConstraints.TOP));
    _messagesCheck.setActionCommand("Add version information");
    _messagesCheck.setName("messagesCheck");
    _messagesCheck.setText(Messages.getString("addMessages"));
    jpanel1.add(_messagesCheck, cc.xy(4, 2));
    JLabel jlabel5 = new JLabel();
    jlabel5.setText(Messages.getString("instanceAlreadyExistsMsg"));
    jpanel1.add(jlabel5, new CellConstraints(2, 12, 1, 1, CellConstraints.DEFAULT, CellConstraints.TOP));
    _instanceAlreadyExistsMsgTextArea.setName("instanceAlreadyExistsMsgTextArea");
    _instanceAlreadyExistsMsgTextArea.setToolTipText(Messages.getString("instanceAlreadyExistsMsgTip"));
    JScrollPane jscrollpane5 = new JScrollPane();
    jscrollpane5.setViewportView(_instanceAlreadyExistsMsgTextArea);
    jscrollpane5.setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED);
    jscrollpane5.setHorizontalScrollBarPolicy(JScrollPane.HORIZONTAL_SCROLLBAR_AS_NEEDED);
    jpanel1.add(jscrollpane5, cc.xy(4, 12));
    addFillComponents(jpanel1, new int[] { 1, 2, 3, 4, 5 }, new int[] { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13 });
    return jpanel1;
}
Also used : FormLayout(com.jgoodies.forms.layout.FormLayout) JScrollPane(javax.swing.JScrollPane) JPanel(javax.swing.JPanel) JLabel(javax.swing.JLabel) CellConstraints(com.jgoodies.forms.layout.CellConstraints)

Example 52 with CellConstraints

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

the class SingleInstanceForm 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 53 with CellConstraints

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

the class SingleInstanceForm 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:60DLU:NONE,FILL:DEFAULT:GROW(1.0),FILL:7DLU:NONE", "CENTER:9DLU:NONE,CENTER:DEFAULT:NONE,CENTER:3DLU:NONE,CENTER:DEFAULT:NONE,CENTER:3DLU:NONE,CENTER:DEFAULT:NONE,CENTER:9DLU:NONE");
    CellConstraints cc = new CellConstraints();
    jpanel1.setLayout(formlayout1);
    _splashFileLabel.setIcon(loadImage("images/asterix.gif"));
    _splashFileLabel.setName("splashFileLabel");
    _splashFileLabel.setText(Messages.getString("mutexName"));
    jpanel1.add(_splashFileLabel, cc.xy(2, 4));
    _mutexNameField.setName("mutexNameField");
    _mutexNameField.setToolTipText(Messages.getString("mutexNameTip"));
    jpanel1.add(_mutexNameField, cc.xywh(4, 4, 2, 1));
    _singleInstanceCheck.setActionCommand("Enable splash screen");
    _singleInstanceCheck.setName("singleInstanceCheck");
    _singleInstanceCheck.setText(Messages.getString("enableSingleInstance"));
    jpanel1.add(_singleInstanceCheck, cc.xywh(4, 2, 2, 1));
    _windowTitleField.setName("windowTitleField");
    _windowTitleField.setToolTipText(Messages.getString("windowTitleTip"));
    jpanel1.add(_windowTitleField, cc.xywh(4, 6, 2, 1));
    _splashFileLabel1.setName("splashFileLabel");
    _splashFileLabel1.setText(Messages.getString("windowTitle"));
    jpanel1.add(_splashFileLabel1, cc.xy(2, 6));
    addFillComponents(jpanel1, new int[] { 1, 2, 3, 4, 5, 6 }, new int[] { 1, 2, 3, 4, 5, 6, 7 });
    return jpanel1;
}
Also used : FormLayout(com.jgoodies.forms.layout.FormLayout) JPanel(javax.swing.JPanel) CellConstraints(com.jgoodies.forms.layout.CellConstraints)

Example 54 with CellConstraints

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

the class HeaderForm 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 55 with CellConstraints

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

the class JreForm 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:60DLU:NONE,FILL:3DLU:NONE,FILL:DEFAULT:NONE,FILL:7DLU:NONE,FILL:60DLU:NONE,FILL:3DLU:NONE,FILL:DEFAULT:GROW(1.0),FILL:7DLU:NONE", "CENTER:9DLU:NONE,CENTER:DEFAULT:NONE,CENTER:9DLU:NONE,CENTER:DEFAULT:NONE,CENTER:3DLU:NONE,CENTER:DEFAULT:NONE,CENTER:3DLU:NONE,CENTER:DEFAULT:NONE,CENTER:9DLU:NONE,CENTER:DEFAULT:NONE,CENTER:3DLU:NONE,CENTER:DEFAULT:NONE,CENTER:3DLU:NONE,CENTER:DEFAULT:NONE,CENTER:3DLU:NONE,FILL:50DLU:GROW(1.0),CENTER:3DLU:NONE,CENTER:DEFAULT:NONE,CENTER:9DLU:NONE");
    CellConstraints cc = new CellConstraints();
    jpanel1.setLayout(formlayout1);
    _jrePathLabel.setName("jrePathLabel");
    _jrePathLabel.setText(Messages.getString("jrePath"));
    jpanel1.add(_jrePathLabel, cc.xy(2, 2));
    _jreMinLabel.setName("jreMinLabel");
    _jreMinLabel.setText(Messages.getString("jreMin"));
    jpanel1.add(_jreMinLabel, cc.xy(2, 6));
    _jreMaxLabel.setName("jreMaxLabel");
    _jreMaxLabel.setText(Messages.getString("jreMax"));
    jpanel1.add(_jreMaxLabel, cc.xy(2, 8));
    _jvmOptionsTextLabel.setName("jvmOptionsTextLabel");
    _jvmOptionsTextLabel.setText(Messages.getString("jvmOptions"));
    jpanel1.add(_jvmOptionsTextLabel, new CellConstraints(2, 16, 1, 1, CellConstraints.DEFAULT, CellConstraints.TOP));
    _jreMinField.setName("jreMinField");
    jpanel1.add(_jreMinField, cc.xy(4, 6));
    _jreMaxField.setName("jreMaxField");
    jpanel1.add(_jreMaxField, cc.xy(4, 8));
    _jvmOptionsTextArea.setName("jvmOptionsTextArea");
    _jvmOptionsTextArea.setToolTipText(Messages.getString("jvmOptionsTip"));
    JScrollPane jscrollpane1 = new JScrollPane();
    jscrollpane1.setViewportView(_jvmOptionsTextArea);
    jscrollpane1.setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED);
    jscrollpane1.setHorizontalScrollBarPolicy(JScrollPane.HORIZONTAL_SCROLLBAR_AS_NEEDED);
    jpanel1.add(jscrollpane1, cc.xywh(4, 16, 7, 1));
    _initialHeapSizeLabel.setName("initialHeapSizeLabel");
    _initialHeapSizeLabel.setText(Messages.getString("initialHeapSize"));
    jpanel1.add(_initialHeapSizeLabel, cc.xy(2, 12));
    _maxHeapSizeLabel.setName("maxHeapSizeLabel");
    _maxHeapSizeLabel.setText(Messages.getString("maxHeapSize"));
    jpanel1.add(_maxHeapSizeLabel, cc.xy(2, 14));
    JLabel jlabel1 = new JLabel();
    jlabel1.setText("MB");
    jpanel1.add(jlabel1, cc.xy(6, 12));
    JLabel jlabel2 = new JLabel();
    jlabel2.setText("MB");
    jpanel1.add(jlabel2, cc.xy(6, 14));
    _initialHeapSizeField.setName("initialHeapSizeField");
    jpanel1.add(_initialHeapSizeField, cc.xy(4, 12));
    _maxHeapSizeField.setName("maxHeapSizeField");
    jpanel1.add(_maxHeapSizeField, cc.xy(4, 14));
    _maxHeapPercentField.setName("maxHeapPercentField");
    jpanel1.add(_maxHeapPercentField, cc.xy(8, 14));
    _initialHeapPercentField.setName("initialHeapPercentField");
    jpanel1.add(_initialHeapPercentField, cc.xy(8, 12));
    _jdkPreferenceCombo.setName("jdkPreferenceCombo");
    jpanel1.add(_jdkPreferenceCombo, cc.xywh(8, 6, 3, 1));
    JLabel jlabel3 = new JLabel();
    jlabel3.setText(Messages.getString("availableMemory"));
    jpanel1.add(jlabel3, cc.xy(10, 12));
    JLabel jlabel4 = new JLabel();
    jlabel4.setText(Messages.getString("availableMemory"));
    jpanel1.add(jlabel4, cc.xy(10, 14));
    _runtimeBitsCombo.setName("runtimeBitsCombo");
    _runtimeBitsCombo.setToolTipText("");
    jpanel1.add(_runtimeBitsCombo, cc.xywh(8, 8, 3, 1));
    jpanel1.add(createPanel1(), cc.xywh(2, 18, 9, 1));
    TitledSeparator titledseparator1 = new TitledSeparator();
    titledseparator1.setText(Messages.getString("searchOptions"));
    jpanel1.add(titledseparator1, cc.xywh(2, 4, 9, 1));
    TitledSeparator titledseparator2 = new TitledSeparator();
    titledseparator2.setText(Messages.getString("options"));
    jpanel1.add(titledseparator2, cc.xywh(2, 10, 9, 1));
    jpanel1.add(createPanel2(), cc.xywh(4, 2, 7, 1));
    addFillComponents(jpanel1, new int[] { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11 }, new int[] { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19 });
    return jpanel1;
}
Also used : FormLayout(com.jgoodies.forms.layout.FormLayout) JScrollPane(javax.swing.JScrollPane) JPanel(javax.swing.JPanel) TitledSeparator(com.jeta.forms.components.separator.TitledSeparator) JLabel(javax.swing.JLabel) 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