use of jgnash.ui.components.JFloatField in project jgnash by ccavanaugh.
the class AmortizeDialog method initComponents.
private void initComponents() {
dateField = new DatePanel();
interestField = new JFloatField(0, 3, 2);
loanAmountField = new JFloatField();
loanTermField = new JIntegerField();
payPeriodsField = new JIntegerField();
intPeriodsField = new JIntegerField();
feesField = new JFloatField();
interestAccButton = new JButton(rb.getString("Word.None"));
bankAccButton = new JButton(rb.getString("Word.None"));
feesAccButton = new JButton(rb.getString("Word.None"));
payeeField = new JTextFieldEx();
memoField = new JTextFieldEx();
useDaysButton = new JCheckBox(rb.getString("Button.UseDailyRate"));
daysField = new JFloatField();
cancelButton = new JButton(rb.getString("Button.Cancel"));
okButton = new JButton(rb.getString("Button.Ok"));
}
use of jgnash.ui.components.JFloatField in project jgnash by ccavanaugh.
the class FeePanel method initComponents.
private void initComponents() {
feeField = new JFloatField(account.getCurrencyNode());
feeButton = new JButton(IconUtils.getIcon("/jgnash/resource/document-properties.png"));
feeButton.setMargin(new Insets(0, 0, 0, 0));
feeButton.addActionListener(this);
feeButton.setFocusPainted(false);
feeButton.setToolTipText(ResourceUtils.getString("ToolTip.ShowDetails"));
if (ThemeManager.isLookAndFeelNimbus()) {
NimbusUtils.reduceNimbusButtonMargin(feeButton);
feeButton.setIcon(NimbusUtils.scaleIcon(IconUtils.getIcon("/jgnash/resource/document-properties.png")));
}
}
use of jgnash.ui.components.JFloatField in project jgnash by ccavanaugh.
the class AbstractTransactionEntryPanel method init.
private void init() {
amountField = new JFloatField(account.getCurrencyNode());
accountPanel = new AccountExchangePanel(account.getCurrencyNode(), account, amountField);
enterButton = new JButton(rb.getString("Button.Enter"));
cancelButton = new JButton(rb.getString("Button.Clear"));
memoField = AutoCompleteFactory.getMemoField();
reconciledButton = new IndeterminateCheckBox(rb.getString("Button.Reconciled"));
reconciledButton.setHorizontalTextPosition(SwingConstants.LEADING);
reconciledButton.setMargin(new Insets(0, 0, 0, 0));
/* Connect the buttons to the form */
cancelButton.addActionListener(this);
enterButton.addActionListener(this);
/* Allows the user to submit the form from the keyboard when the enter button is selected */
KeyAdapter enterKeyListener = new KeyAdapter() {
@Override
public void keyPressed(KeyEvent e) {
if (e.getKeyCode() == KeyEvent.VK_ENTER) {
enterAction();
}
}
};
enterButton.addKeyListener(enterKeyListener);
amountField.addKeyListener(enterKeyListener);
// focus will return to the first field
setFocusCycleRoot(true);
}
use of jgnash.ui.components.JFloatField 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 jgnash.ui.components.JFloatField in project jgnash by ccavanaugh.
the class SecuritiesHistoryDialog method initComponents.
private void initComponents() {
dateField = new DatePanel();
closeField = new JFloatField();
lowField = new JFloatField();
highField = new JFloatField();
securityCombo = new SecurityComboBox();
volumeField = new JIntegerField();
updateButton = new JButton(rb.getString("Button.UpdateOnline"), IconUtils.getIcon("/jgnash/resource/applications-internet.png"));
deleteButton = new JButton(rb.getString("Button.Delete"));
clearButton = new JButton(rb.getString("Button.Clear"));
applyButton = new JButton(rb.getString("Button.Add"));
closeButton = new JButton(rb.getString("Button.Close"));
model = new HistoryModel();
table = new HistoryTable();
table.setModel(model);
table.setPreferredScrollableViewportSize(new Dimension(150, 120));
table.setCellSelectionEnabled(false);
table.setColumnSelectionAllowed(false);
table.setRowSelectionAllowed(true);
table.getSelectionModel().setSelectionMode(ListSelectionModel.MULTIPLE_INTERVAL_SELECTION);
table.setRowSorter(new TableRowSorter<>(model));
table.setFillsViewportHeight(true);
// create an empty chart for panel construction
chartPanel = new ChartPanel(new JFreeChart(new XYPlot()));
chartPanel.setPreferredSize(new Dimension(150, 90));
applyButton.addActionListener(this);
clearButton.addActionListener(this);
deleteButton.addActionListener(this);
updateButton.addActionListener(this);
securityCombo.addActionListener(this);
closeButton.addActionListener(this);
}
Aggregations