Search in sources :

Example 46 with FormLayout

use of com.jgoodies.forms.layout.FormLayout in project jgnash by ccavanaugh.

the class TransactionNumberDialog method layoutDialog.

private void layoutDialog() {
    final FormLayout layout = new FormLayout("p:g", "f:p:g(1.0)");
    final DefaultFormBuilder builder = new DefaultFormBuilder(layout);
    builder.border(Borders.DIALOG);
    builder.append(layoutPanel());
    builder.nextLine();
    builder.appendUnrelatedComponentsGapRow();
    builder.nextLine();
    builder.append(StaticUIMethods.buildOKCancelBar(okButton, cancelButton));
    getContentPane().add(builder.getPanel(), BorderLayout.CENTER);
    pack();
    setMinimumSize(getSize());
}
Also used : FormLayout(com.jgoodies.forms.layout.FormLayout) DefaultFormBuilder(com.jgoodies.forms.builder.DefaultFormBuilder)

Example 47 with FormLayout

use of com.jgoodies.forms.layout.FormLayout in project jgnash by ccavanaugh.

the class AbstractTransactionPanel method buildHorizontalSubPanel.

/**
     * A method to help create one row sub panels.  This helps to work around
     * a layout limitation of components spanning multiple columns.
     * If a String is passed as a component, it will be localized and
     * converted to a JLabel.
     *
     * @param columnSpec The column spec for the layout
     * @param components The components for the sub-panel
     * @return The resulting JPanel
     */
protected JPanel buildHorizontalSubPanel(final String columnSpec, final Object... components) {
    FormLayout layout = new FormLayout(columnSpec, "f:d:g");
    DefaultFormBuilder builder = new DefaultFormBuilder(layout);
    for (Object component1 : components) {
        if (component1 instanceof String) {
            // add a label
            builder.append(new JLabel(rb.getString((String) component1)));
        } else {
            // add a component
            builder.append((Component) component1);
        }
    }
    return builder.getPanel();
}
Also used : FormLayout(com.jgoodies.forms.layout.FormLayout) DefaultFormBuilder(com.jgoodies.forms.builder.DefaultFormBuilder) JLabel(javax.swing.JLabel)

Example 48 with FormLayout

use of com.jgoodies.forms.layout.FormLayout in project jgnash by ccavanaugh.

the class AccountExchangePanel method removeExtraComponents.

private void removeExtraComponents() {
    FormLayout layout = (FormLayout) getLayout();
    remove(expandButton);
    remove(exchangeAmountField);
    remove(amountLabel);
    layout.removeColumn(7);
    layout.removeColumn(6);
    layout.removeColumn(5);
    layout.removeColumn(4);
    layout.removeColumn(3);
    layout.removeColumn(2);
    invalidate();
    isLayoutCompact = true;
}
Also used : FormLayout(com.jgoodies.forms.layout.FormLayout)

Example 49 with FormLayout

use of com.jgoodies.forms.layout.FormLayout in project jgnash by ccavanaugh.

the class AccountExchangePanel method layoutPanel.

private void layoutPanel() {
    FormLayout layout = new FormLayout("50dlu:g", "f:d:g");
    CellConstraints cc = new CellConstraints();
    setLayout(layout);
    add(accountCombo, cc.xy(1, 1));
    isLayoutCompact = true;
}
Also used : FormLayout(com.jgoodies.forms.layout.FormLayout) CellConstraints(com.jgoodies.forms.layout.CellConstraints)

Example 50 with FormLayout

use of com.jgoodies.forms.layout.FormLayout in project jgnash by ccavanaugh.

the class AccountExchangePanel method addExtraComponents.

private void addExtraComponents() {
    FormLayout layout = (FormLayout) getLayout();
    // col 2
    layout.appendColumn(ColumnSpec.decode("8dlu"));
    layout.appendColumn(ColumnSpec.decode("right:d"));
    layout.appendColumn(ColumnSpec.decode("$lcgap"));
    layout.appendColumn(ColumnSpec.decode("max(48dlu;min)"));
    // col 6
    layout.appendColumn(ColumnSpec.decode("1px"));
    // col 7
    layout.appendColumn(ColumnSpec.decode("min"));
    CellConstraints cc = new CellConstraints();
    add(amountLabel, cc.xy(3, 1));
    add(exchangeAmountField, cc.xy(5, 1));
    add(expandButton, cc.xy(7, 1));
    invalidate();
    isLayoutCompact = false;
}
Also used : FormLayout(com.jgoodies.forms.layout.FormLayout) CellConstraints(com.jgoodies.forms.layout.CellConstraints)

Aggregations

FormLayout (com.jgoodies.forms.layout.FormLayout)318 CellConstraints (com.jgoodies.forms.layout.CellConstraints)136 DefaultFormBuilder (com.jgoodies.forms.builder.DefaultFormBuilder)128 JPanel (javax.swing.JPanel)109 JScrollPane (javax.swing.JScrollPane)76 PanelBuilder (com.jgoodies.forms.builder.PanelBuilder)63 JLabel (javax.swing.JLabel)55 JButton (javax.swing.JButton)41 BorderLayout (java.awt.BorderLayout)32 FormBuilder (com.jgoodies.forms.builder.FormBuilder)19 JTextField (javax.swing.JTextField)19 ButtonBarBuilder (com.jgoodies.forms.builder.ButtonBarBuilder)18 JCheckBox (javax.swing.JCheckBox)18 Dimension (java.awt.Dimension)12 ActionEvent (java.awt.event.ActionEvent)12 DatePanel (jgnash.ui.components.DatePanel)11 TextAdapter (org.apache.cayenne.modeler.util.TextAdapter)11 JRadioButton (javax.swing.JRadioButton)10 ActionListener (java.awt.event.ActionListener)9 AbstractAction (javax.swing.AbstractAction)9