Search in sources :

Example 31 with CellConstraints

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

the class ReturnOfCapitalPanel method layoutPanel.

private void layoutPanel() {
    removeAll();
    FormLayout layout = new FormLayout("right:d, $lcgap, 50dlu:g, 8dlu, right:d, $lcgap, max(65dlu;min)", "f:d, $nlgap, f:d, $nlgap, f:d, $nlgap, f:d");
    layout.setRowGroups(new int[][] { { 1, 3, 5, 7 } });
    CellConstraints cc = new CellConstraints();
    setLayout(layout);
    add("Label.Security", cc.xy(1, 1));
    add(ValidationFactory.wrap(securityCombo), cc.xy(3, 1));
    add("Label.Date", cc.xy(5, 1));
    add(datePanel, cc.xy(7, 1));
    add("Label.Memo", cc.xy(1, 3));
    add(memoField, cc.xy(3, 3));
    add("Label.ReturnOfCapital", cc.xy(5, 3));
    add(ValidationFactory.wrap(dividendField), cc.xy(7, 3));
    add("Label.IncomeAccount", cc.xy(1, 5));
    add(incomeExchangePanel, cc.xy(3, 5));
    add(getReconcileCheckBox(), cc.xyw(5, 5, 3));
    add("Label.Account", cc.xy(1, 7));
    add(accountExchangePanel, cc.xy(3, 7));
}
Also used : FormLayout(com.jgoodies.forms.layout.FormLayout) CellConstraints(com.jgoodies.forms.layout.CellConstraints)

Example 32 with CellConstraints

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

the class InvestmentTransactionPanel method layoutMainPanel.

private void layoutMainPanel() {
    initComponents();
    FormLayout layout = new FormLayout("d, 4dlu, m:g, 4dlu, m", "f:d, $ugap, f:d");
    CellConstraints cc = new CellConstraints();
    setBorder(new CompoundBorder(new ShadowBorder(), Borders.TABBED_DIALOG));
    setLayout(layout);
    add(cardPanel, cc.xyw(1, 1, 5));
    add(new JSeparator(), cc.xyw(1, 2, 5));
    add(new JLabel(rb.getString("Label.Action")), cc.xy(1, 3));
    add(actionCombo, cc.xy(3, 3));
    add(StaticUIMethods.buildOKCancelBar(enterButton, cancelButton), cc.xy(5, 3));
}
Also used : FormLayout(com.jgoodies.forms.layout.FormLayout) ShadowBorder(jgnash.ui.components.ShadowBorder) JLabel(javax.swing.JLabel) CompoundBorder(javax.swing.border.CompoundBorder) JSeparator(javax.swing.JSeparator) CellConstraints(com.jgoodies.forms.layout.CellConstraints)

Example 33 with CellConstraints

use of com.jgoodies.forms.layout.CellConstraints 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 34 with CellConstraints

use of com.jgoodies.forms.layout.CellConstraints 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)

Example 35 with CellConstraints

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

the class AccountExchangePanel method layoutRatePanel.

private JPanel layoutRatePanel() {
    ResourceBundle rb = ResourceUtils.getBundle();
    CellConstraints cc = new CellConstraints();
    FormLayout layout = new FormLayout("d, 6dlu, right:d, $lcgap, max(48dlu;min)", "f:d");
    JPanel panel = new JPanel(layout);
    panel.setBorder(Borders.DLU2);
    panel.add(conversionLabel, cc.xy(1, 1));
    panel.add(new JLabel(rb.getString("Label.ExchangeRate")), cc.xy(3, 1));
    panel.add(exchangeRateField, cc.xy(5, 1));
    return panel;
}
Also used : FormLayout(com.jgoodies.forms.layout.FormLayout) JPanel(javax.swing.JPanel) JLabel(javax.swing.JLabel) ResourceBundle(java.util.ResourceBundle) 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