Search in sources :

Example 6 with DatePanel

use of jgnash.ui.components.DatePanel in project jgnash by ccavanaugh.

the class DayTab method layoutMainPanel.

private void layoutMainPanel() {
    FormLayout layout = new FormLayout("right:p, $lcgap, f:p, 2dlu, max(48dlu;min), 2dlu, f:p", "f:p, $lgap, f:p, $lgap, f:p");
    layout.setRowGroups(new int[][] { { 1, 3, 5 } });
    setLayout(layout);
    setBorder(Borders.DIALOG);
    CellConstraints cc = new CellConstraints();
    noEndButton = new JRadioButton(rb.getString("Button.NoEndDate"));
    endButton = new JRadioButton();
    endDateField = new DatePanel();
    group.add(noEndButton);
    group.add(endButton);
    numberSpinner = new JSpinner(new SpinnerNumberModel(1, 1, 365, 1));
    add(new JLabel(rb.getString("Label.Every")), cc.xy(1, 1));
    add(numberSpinner, cc.xywh(3, 1, 3, 1));
    add(new JLabel(rb.getString("Tab.Day")), cc.xy(7, 1));
    add(new JLabel(rb.getString("Label.EndOn")), cc.xy(1, 3));
    add(noEndButton, cc.xywh(3, 3, 5, 1));
    add(endButton, cc.xy(3, 5));
    add(endDateField, cc.xy(5, 5));
}
Also used : FormLayout(com.jgoodies.forms.layout.FormLayout) SpinnerNumberModel(javax.swing.SpinnerNumberModel) JRadioButton(javax.swing.JRadioButton) DatePanel(jgnash.ui.components.DatePanel) JSpinner(javax.swing.JSpinner) JLabel(javax.swing.JLabel) CellConstraints(com.jgoodies.forms.layout.CellConstraints)

Example 7 with DatePanel

use of jgnash.ui.components.DatePanel in project jgnash by ccavanaugh.

the class YearTab method layoutMainPanel.

private void layoutMainPanel() {
    FormLayout layout = new FormLayout("right:p, $lcgap, f:p, 2dlu, max(48dlu;min), 2dlu, f:p", "f:p, $lgap, f:p, $lgap, f:p");
    layout.setRowGroups(new int[][] { { 1, 3, 5 } });
    setLayout(layout);
    setBorder(Borders.DIALOG);
    CellConstraints cc = new CellConstraints();
    noEndButton = new JRadioButton(rb.getString("Button.NoEndDate"));
    endButton = new JRadioButton();
    endDateField = new DatePanel();
    group.add(noEndButton);
    group.add(endButton);
    numberSpinner = new JSpinner(new SpinnerNumberModel(1, 1, 100, 1));
    add(new JLabel(rb.getString("Label.Every")), cc.xy(1, 1));
    add(numberSpinner, cc.xywh(3, 1, 3, 1));
    add(new JLabel(rb.getString("Tab.Year")), cc.xy(7, 1));
    add(new JLabel(rb.getString("Label.EndOn")), cc.xy(1, 3));
    add(noEndButton, cc.xywh(3, 3, 5, 1));
    add(endButton, cc.xy(3, 5));
    add(endDateField, cc.xy(5, 5));
}
Also used : FormLayout(com.jgoodies.forms.layout.FormLayout) SpinnerNumberModel(javax.swing.SpinnerNumberModel) JRadioButton(javax.swing.JRadioButton) DatePanel(jgnash.ui.components.DatePanel) JSpinner(javax.swing.JSpinner) JLabel(javax.swing.JLabel) CellConstraints(com.jgoodies.forms.layout.CellConstraints)

Example 8 with DatePanel

use of jgnash.ui.components.DatePanel 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);
}
Also used : JIntegerField(jgnash.ui.components.JIntegerField) ChartPanel(org.jfree.chart.ChartPanel) JFloatField(jgnash.ui.components.JFloatField) XYPlot(org.jfree.chart.plot.XYPlot) DatePanel(jgnash.ui.components.DatePanel) JButton(javax.swing.JButton) SecurityComboBox(jgnash.ui.components.SecurityComboBox) Dimension(java.awt.Dimension) JFreeChart(org.jfree.chart.JFreeChart)

Example 9 with DatePanel

use of jgnash.ui.components.DatePanel in project jgnash by ccavanaugh.

the class MonthTab method layoutMainPanel.

private void layoutMainPanel() {
    FormLayout layout = new FormLayout("right:p, $lcgap, f:p, 2dlu, max(48dlu;min), 2dlu, f:p, 10dlu, right:p, 4dlu, max(48dlu;min)", "f:p, $lgap, f:p, $lgap, f:p");
    layout.setRowGroups(new int[][] { { 1, 3, 5 } });
    setLayout(layout);
    setBorder(Borders.DIALOG);
    CellConstraints cc = new CellConstraints();
    noEndButton = new JRadioButton(rb.getString("Button.NoEndDate"));
    endButton = new JRadioButton();
    endDateField = new DatePanel();
    group.add(noEndButton);
    group.add(endButton);
    numberSpinner = new JSpinner(new SpinnerNumberModel(1, 1, 24, 1));
    typeComboBox = new JComboBox<>();
    typeComboBox.setModel(new DefaultComboBoxModel<>(new String[] { rb.getString("Column.Date"), rb.getString("Column.Day") }));
    add(new JLabel(rb.getString("Label.Every")), cc.xy(1, 1));
    add(numberSpinner, cc.xywh(3, 1, 3, 1));
    add(new JLabel(rb.getString("Tab.Month")), cc.xy(7, 1));
    add(new JLabel(rb.getString("Label.By")), cc.xy(9, 1));
    add(typeComboBox, cc.xy(11, 1));
    add(new JLabel(rb.getString("Label.EndOn")), cc.xy(1, 3));
    add(noEndButton, cc.xyw(3, 3, 5));
    add(endButton, cc.xy(3, 5));
    add(endDateField, cc.xy(5, 5));
}
Also used : FormLayout(com.jgoodies.forms.layout.FormLayout) SpinnerNumberModel(javax.swing.SpinnerNumberModel) JRadioButton(javax.swing.JRadioButton) DatePanel(jgnash.ui.components.DatePanel) JSpinner(javax.swing.JSpinner) JLabel(javax.swing.JLabel) CellConstraints(com.jgoodies.forms.layout.CellConstraints)

Example 10 with DatePanel

use of jgnash.ui.components.DatePanel in project jgnash by ccavanaugh.

the class RecurringEntryDialog method createFreqPanel.

private JPanel createFreqPanel() {
    FormLayout layout = new FormLayout("right:p, 4dlu, max(48dlu;min), 6dlu, p, f:p:g", "f:p, 3dlu, min");
    CellConstraints cc = new CellConstraints();
    JPanel p = new JPanel(layout);
    startDateField = new DatePanel();
    enabledCheckBox = new JCheckBox(rb.getString("Button.Enabled"));
    freqTab = new JTabbedPane();
    freqTab.add(rb.getString("Tab.None"), new NoneTab());
    freqTab.add(rb.getString("Tab.Day"), new DayTab());
    freqTab.add(rb.getString("Tab.Week"), new WeekTab());
    freqTab.add(rb.getString("Tab.Month"), new MonthTab());
    freqTab.add(rb.getString("Tab.Year"), new YearTab());
    tabMap.put(OneTimeReminder.class, 0);
    tabMap.put(DailyReminder.class, 1);
    tabMap.put(WeeklyReminder.class, 2);
    tabMap.put(MonthlyReminder.class, 3);
    tabMap.put(YearlyReminder.class, 4);
    p.add(new JLabel(rb.getString("Label.FirstPayDate")), cc.xy(1, 1));
    p.add(startDateField, cc.xy(3, 1));
    p.add(enabledCheckBox, cc.xy(5, 1));
    p.add(freqTab, cc.xywh(1, 3, 6, 1));
    return p;
}
Also used : FormLayout(com.jgoodies.forms.layout.FormLayout) JCheckBox(javax.swing.JCheckBox) JPanel(javax.swing.JPanel) DatePanel(jgnash.ui.components.DatePanel) JTabbedPane(javax.swing.JTabbedPane) JLabel(javax.swing.JLabel) CellConstraints(com.jgoodies.forms.layout.CellConstraints)

Aggregations

DatePanel (jgnash.ui.components.DatePanel)12 FormLayout (com.jgoodies.forms.layout.FormLayout)8 JButton (javax.swing.JButton)6 CellConstraints (com.jgoodies.forms.layout.CellConstraints)5 JLabel (javax.swing.JLabel)5 JRadioButton (javax.swing.JRadioButton)5 JCheckBox (javax.swing.JCheckBox)4 JPanel (javax.swing.JPanel)4 JSpinner (javax.swing.JSpinner)4 SpinnerNumberModel (javax.swing.SpinnerNumberModel)4 DefaultFormBuilder (com.jgoodies.forms.builder.DefaultFormBuilder)3 ChartPanel (org.jfree.chart.ChartPanel)3 JFreeChart (org.jfree.chart.JFreeChart)3 LocalDate (java.time.LocalDate)2 Account (jgnash.engine.Account)2 JFloatField (jgnash.ui.components.JFloatField)2 JIntegerField (jgnash.ui.components.JIntegerField)2 Dimension (java.awt.Dimension)1 TextField (java.awt.TextField)1 MouseEvent (java.awt.event.MouseEvent)1