use of com.jgoodies.forms.builder.DefaultFormBuilder in project jgnash by ccavanaugh.
the class RenameBudgetDialog method layoutMainPanel.
private void layoutMainPanel() {
initComponents();
FormLayout layout = new FormLayout("p, $lcgap, fill:100dlu:g", "f:p:g, $ugap, f:p");
DefaultFormBuilder builder = new DefaultFormBuilder(layout);
builder.border(Borders.DIALOG);
builder.append(new JLabel(rb.getString("Label.RenameBudget")), ValidationFactory.wrap(budgetNameField));
builder.nextRow();
builder.append(StaticUIMethods.buildOKCancelBar(okButton, cancelButton), 3);
getContentPane().add(builder.getPanel());
pack();
}
use of com.jgoodies.forms.builder.DefaultFormBuilder in project jgnash by ccavanaugh.
the class CheckDesignDialog method buildLeftPanel.
private JPanel buildLeftPanel() {
FormLayout formLayout = new FormLayout("p, $lcgap, max(55dlu;p):g(0.5), 8dlu, p, $lcgap, max(55dlu;p):g(0.5)", "");
DefaultFormBuilder builder = new DefaultFormBuilder(formLayout);
// previewPanel fills and
builder.appendRow(RowSpec.decode("f:p:g"));
// grows
builder.append(previewPanel, 7);
builder.nextLine();
builder.appendUnrelatedComponentsGapRow();
builder.nextLine();
builder.append(rb.getString("Label.Height"), heightField);
builder.append(rb.getString("Label.Count"), countField);
builder.nextLine();
builder.appendUnrelatedComponentsGapRow();
builder.nextLine();
builder.append(setupButton, 4);
return builder.getPanel();
}
use of com.jgoodies.forms.builder.DefaultFormBuilder in project jgnash by ccavanaugh.
the class BudgetColumnHeader method layoutMainPanel.
private void layoutMainPanel() {
FormLayout layout = new FormLayout("d", "d");
DefaultFormBuilder builder = new DefaultFormBuilder(layout, this);
builder.add(panels.get(0).getPeriodHeader(), CC.xy(1, 1));
for (int i = 1; i < panels.size(); i++) {
builder.appendColumn("d");
builder.add(panels.get(i).getPeriodHeader(), CC.xy(i + 1, 1));
}
}
use of com.jgoodies.forms.builder.DefaultFormBuilder in project jgnash by ccavanaugh.
the class BudgetGoalDialog method layoutMainPanel.
private void layoutMainPanel() {
FormLayout contentLayout = new FormLayout("fill:p:g, $lcgap, fill:p", "f:p:g, $ugap, f:p");
JPanel contentPanel = new JPanel(contentLayout);
DefaultFormBuilder contentBuilder = new DefaultFormBuilder(contentLayout, contentPanel);
contentBuilder.border(Borders.DIALOG);
FormLayout layout = new FormLayout("right:d, $lcgap, fill:p:g", "f:p, $rgap, d, $ugap, f:p:g");
DefaultFormBuilder builder = new DefaultFormBuilder(layout);
cancelButton = new JButton(rb.getString("Button.Cancel"));
okButton = new JButton(rb.getString("Button.Ok"));
historicalButton = new JButton(rb.getString("Button.HistoricalFill"));
fillAmountField = new JFloatField(account.getCurrencyNode());
fillAmountField.setDecimal(BigDecimal.ZERO);
fillPatternAmountField = new JFloatField(account.getCurrencyNode());
fillPatternAmountField.setDecimal(BigDecimal.ZERO);
fillButton = new JButton(rb.getString("Button.Enter"));
fillPatternEnterButton = new JButton(rb.getString("Button.Enter"));
budgetPeriodCombo = new JComboBox<>();
budgetPeriodCombo.setModel(new DefaultComboBoxModel<>(Period.values()));
budgetPeriodCombo.setSelectedItem(getBudgetGoal().getBudgetPeriod());
patternComboBox = new JComboBox<>();
patternComboBox.setModel(new DefaultComboBoxModel<>(Pattern.values()));
int max = getDescriptors().size();
startRowSpinner = new JSpinner(new SpinnerNumberModel(1, 1, max, 1));
endRowSpinner = new JSpinner(new SpinnerNumberModel(max, 1, max, 1));
builder.append(new JLabel(rb.getString("Label.Period")), budgetPeriodCombo);
builder.nextLine();
builder.nextLine();
builder.append(new JLabel(rb.getString("Label.Currency")), new JLabel(account.getCurrencyNode().getSymbol()));
builder.nextLine();
builder.nextLine();
JTable table = new GoalTable(model);
table.getSelectionModel().setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
// save entry if focus is lost
table.putClientProperty("terminateEditOnFocusLost", Boolean.TRUE);
ToolTipManager.sharedInstance().unregisterComponent(table);
JScrollPane scrollPane = new JScrollPane(table);
// force it something small so it will resize correctly
scrollPane.setPreferredSize(new Dimension(SCROLLPANE_WIDTH, SCROLLPANE_HEIGHT));
builder.append(scrollPane, 3);
JPanel patternPanel = new JPanel();
patternPanel.setLayout(new FormLayout(new ColumnSpec[] { FormSpecs.DEFAULT_COLSPEC, FormSpecs.RELATED_GAP_COLSPEC, ColumnSpec.decode("default:grow") }, new RowSpec[] { FormSpecs.RELATED_GAP_ROWSPEC, FormSpecs.DEFAULT_ROWSPEC, FormSpecs.RELATED_GAP_ROWSPEC, FormSpecs.DEFAULT_ROWSPEC, FormSpecs.RELATED_GAP_ROWSPEC, FormSpecs.DEFAULT_ROWSPEC, FormSpecs.RELATED_GAP_ROWSPEC, FormSpecs.DEFAULT_ROWSPEC, FormSpecs.RELATED_GAP_ROWSPEC, FormSpecs.DEFAULT_ROWSPEC }));
patternPanel.add(new JLabel(rb.getString("Label.Pattern")), "1, 2, right, default");
patternPanel.add(patternComboBox, "3, 2, fill, default");
patternPanel.add(new JLabel(rb.getString("Label.StartRow")), "1, 4, right, default");
patternPanel.add(startRowSpinner, "3, 4");
patternPanel.add(new JLabel(rb.getString("Label.EndRow")), "1, 6, right, default");
patternPanel.add(endRowSpinner, "3, 6");
patternPanel.add(new JLabel(rb.getString("Label.Amount")), "1, 8, right, default");
patternPanel.add(fillPatternAmountField, "3, 8, fill, default");
patternPanel.add(new ButtonBarBuilder().addGlue().addButton(fillPatternEnterButton).build(), "3, 10");
FormLayout fillLayout = new FormLayout("right:d, $lcgap, fill:max(48dlu;min):g, $lcgap, d", "d, $rgap, d, $rgap, d, $rgap, d, $rgap, d");
DefaultFormBuilder fillBuilder = new DefaultFormBuilder(fillLayout);
fillBuilder.border(new TitledBorder(rb.getString("Title.SmartFill")));
fillBuilder.append(historicalButton, 5);
fillBuilder.nextLine();
fillBuilder.nextLine();
fillBuilder.appendSeparator();
fillBuilder.nextLine();
fillBuilder.nextLine();
fillBuilder.append(new JLabel(rb.getString("Label.FillAll")), fillAmountField, fillButton);
fillBuilder.nextLine();
fillBuilder.nextLine();
fillBuilder.appendSeparator();
fillBuilder.nextLine();
fillBuilder.nextLine();
fillBuilder.append(patternPanel, 5);
budgetPeriodCombo.addActionListener(this);
cancelButton.addActionListener(this);
okButton.addActionListener(this);
historicalButton.addActionListener(this);
fillButton.addActionListener(this);
fillPatternEnterButton.addActionListener(this);
contentBuilder.append(builder.getPanel(), fillBuilder.getPanel());
contentBuilder.nextLine();
contentBuilder.nextLine();
contentBuilder.append(StaticUIMethods.buildOKCancelBar(okButton, cancelButton), 3);
getContentPane().add(contentBuilder.getPanel());
pack();
setMinimumSize(getSize());
DialogUtils.addBoundsListener(this);
// pack columns for better default appearance
JTableUtils.packGenericTable(table);
}
use of com.jgoodies.forms.builder.DefaultFormBuilder in project jgnash by ccavanaugh.
the class BudgetManagerDialog method layoutMainPanel.
private void layoutMainPanel() {
initComponents();
// build the button stack
ButtonStackBuilder buttonStackBuilder = new ButtonStackBuilder();
buttonStackBuilder.addButton(newAutoButton, newButton, duplicateButton, renameButton);
buttonStackBuilder.addUnrelatedGap();
buttonStackBuilder.addButton(deleteButton);
FormLayout layout = new FormLayout("p:g, $lcgap, f:p", "f:max(35dlu;p):g, $ugap, p");
DefaultFormBuilder builder = new DefaultFormBuilder(layout);
builder.border(Borders.DIALOG);
CellConstraints cc = new CellConstraints();
builder.add(new JScrollPane(budgetList), cc.xy(1, 1));
builder.add(buttonStackBuilder.getPanel(), cc.xy(3, 1));
builder.add(StaticUIMethods.buildCloseBar(closeButton), cc.xyw(1, 3, 3));
getContentPane().add(builder.getPanel(), BorderLayout.CENTER);
pack();
setMinimumSize(getSize());
}
Aggregations