Search in sources :

Example 1 with RollOverButton

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

the class CheckDesignDialog method initComponents.

private void initComponents() {
    toolBar = new JToolBar();
    toolBar.setRollover(true);
    openButton = new RollOverButton(rb.getString("Menu.Open.Name").replace("_", ""), IconUtils.getIcon("/jgnash/resource/document-open.png"));
    saveButton = new RollOverButton(rb.getString("Menu.Save.Name").replace("_", ""), IconUtils.getIcon("/jgnash/resource/document-save.png"));
    toolBar.add(openButton);
    toolBar.add(saveButton);
    checkLayout = new CheckLayout();
    layout = new PrintableCheckLayout(checkLayout);
    countField = getIntegerField();
    xPosField = getFloatField();
    yPosField = getFloatField();
    heightField = getFloatField();
    previewPanel = new PrintPreviewPanel(layout, layout.getPageFormat());
    objectList = new JList<>();
    //objectList.setPrototypeCellValue("Some dummy text");
    setupButton = new JButton(rb.getString("Button.PageSetup"));
    addButton = new JButton(rb.getString("Button.Add"));
    removeButton = new JButton(rb.getString("Button.Remove"));
    clearButton = new JButton(rb.getString("Button.Clear"));
    applyButton = new JButton(rb.getString("Button.Apply"));
    printButton = new JButton(rb.getString("Button.PrintSample"));
    closeButton = new JButton(rb.getString("Button.Close"));
    nameField = new JTextFieldEx();
    typeCombo = new JComboBox<>();
    DefaultComboBoxModel<CheckObjectType> comboModel = new DefaultComboBoxModel<>(CheckObjectType.values());
    typeCombo.setModel(comboModel);
    model = new DefaultListModel<>();
    objectList.setModel(model);
    objectList.addListSelectionListener(this);
    addButton.addActionListener(this);
    applyButton.addActionListener(this);
    closeButton.addActionListener(this);
    clearButton.addActionListener(this);
    countField.addActionListener(this);
    removeButton.addActionListener(this);
    setupButton.addActionListener(this);
    heightField.addActionListener(this);
    saveButton.addActionListener(this);
    openButton.addActionListener(this);
    printButton.addActionListener(this);
    heightField.addFocusListener(this);
    countField.addFocusListener(this);
}
Also used : RollOverButton(jgnash.ui.components.RollOverButton) JButton(javax.swing.JButton) JToolBar(javax.swing.JToolBar) JTextFieldEx(jgnash.ui.components.JTextFieldEx) DefaultComboBoxModel(javax.swing.DefaultComboBoxModel) CheckObjectType(jgnash.engine.checks.CheckObject.CheckObjectType) CheckLayout(jgnash.engine.checks.CheckLayout)

Example 2 with RollOverButton

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

the class RecurringPanel method initComponents.

private void initComponents() {
    JPanel toolPanel = new JPanel(new BorderLayout());
    JToolBar toolBar = new JToolBar();
    toolBar.setFloatable(false);
    toolBar.setRollover(true);
    newButton = new RollOverButton(rb.getString("Button.New"), IconUtils.getIcon("/jgnash/resource/document-new.png"));
    modifyButton = new RollOverButton(rb.getString("Button.Modify"), IconUtils.getIcon("/jgnash/resource/document-properties.png"));
    deleteButton = new RollOverButton(rb.getString("Button.Delete"), IconUtils.getIcon("/jgnash/resource/edit-delete.png"));
    remindersButton = new RollOverButton(rb.getString("Button.CheckReminders"), IconUtils.getIcon("/jgnash/resource/view-refresh.png"));
    reminderTable = new FormattedJTable();
    reminderTable.setAutoCreateRowSorter(true);
    reminderTable.setFillsViewportHeight(true);
    reminderTable.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
    reminderTable.addKeyListener(new KeyAdapter() {

        @Override
        public void keyReleased(final KeyEvent e) {
            if (e.getKeyCode() == KeyEvent.VK_DELETE) {
                deleteReminder();
            }
        }
    });
    reminderTable.addMouseListener(new MouseAdapter() {

        @Override
        public void mouseClicked(final MouseEvent e) {
            if (e.getClickCount() == 2) {
                showModifyDialog();
            }
        }
    });
    setLayout(new BorderLayout());
    toolBar.add(newButton);
    toolBar.add(modifyButton);
    toolBar.add(deleteButton);
    toolBar.addSeparator();
    toolBar.add(remindersButton);
    toolPanel.add(toolBar, BorderLayout.NORTH);
    toolPanel.add(new JSeparator(), BorderLayout.CENTER);
    add(toolPanel, java.awt.BorderLayout.NORTH);
    JScrollPane scrollPane = new JScrollPane();
    scrollPane.setBorder(new EmptyBorder(new Insets(0, 0, 0, 0)));
    scrollPane.setHorizontalScrollBarPolicy(ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER);
    scrollPane.setAutoscrolls(true);
    scrollPane.setViewportView(reminderTable);
    add(scrollPane, java.awt.BorderLayout.CENTER);
    deleteButton.addActionListener(this);
    modifyButton.addActionListener(this);
    newButton.addActionListener(this);
    remindersButton.addActionListener(this);
}
Also used : JScrollPane(javax.swing.JScrollPane) JPanel(javax.swing.JPanel) RollOverButton(jgnash.ui.components.RollOverButton) MouseEvent(java.awt.event.MouseEvent) Insets(java.awt.Insets) KeyAdapter(java.awt.event.KeyAdapter) MouseAdapter(java.awt.event.MouseAdapter) JToolBar(javax.swing.JToolBar) JSeparator(javax.swing.JSeparator) FormattedJTable(jgnash.ui.components.FormattedJTable) KeyEvent(java.awt.event.KeyEvent) BorderLayout(java.awt.BorderLayout) EmptyBorder(javax.swing.border.EmptyBorder)

Example 3 with RollOverButton

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

the class ExpandingAccountTablePanel method initComponents.

private void initComponents() {
    accountPane = new ExpandingAccountTablePane();
    JPanel toolPanel = new JPanel();
    JToolBar toolBar = new JToolBar();
    setLayout(new BorderLayout());
    toolPanel.setLayout(new BorderLayout());
    toolBar.setFloatable(false);
    toolBar.setRollover(true);
    newButton = new RollOverButton(rb.getString("Button.New"), IconUtils.getIcon("/jgnash/resource/document-new.png"));
    newButton.setToolTipText(rb.getString("ToolTip.NewAccount"));
    toolBar.add(newButton);
    modifyButton = new RollOverButton(rb.getString("Button.Modify"), IconUtils.getIcon("/jgnash/resource/document-properties.png"));
    modifyButton.setToolTipText(rb.getString("ToolTip.ModifyAccount"));
    toolBar.add(modifyButton);
    reconcileButton = new RollOverButton(rb.getString("Button.Reconcile"), IconUtils.getIcon("/jgnash/resource/view-refresh.png"));
    reconcileButton.setToolTipText(rb.getString("ToolTip.ReconcileAccount"));
    toolBar.add(reconcileButton);
    deleteButton = new RollOverButton(rb.getString("Button.Delete"), IconUtils.getIcon("/jgnash/resource/edit-delete.png"));
    deleteButton.setToolTipText(rb.getString("ToolTip.DeleteAccount"));
    toolBar.add(deleteButton);
    filterButton = new RollOverButton(rb.getString("Button.Filter"), IconUtils.getIcon("/jgnash/resource/preferences-system.png"));
    filterButton.setToolTipText(rb.getString("ToolTip.FilterAccount"));
    toolBar.add(filterButton);
    zoomButton = new RollOverButton(rb.getString("Button.Zoom"), IconUtils.getIcon("/jgnash/resource/edit-find.png"));
    toolBar.add(zoomButton);
    toolPanel.add(toolBar, BorderLayout.NORTH);
    toolPanel.add(new JSeparator(), BorderLayout.CENTER);
    add(toolPanel, BorderLayout.NORTH);
    accountPane.setBorder(new EmptyBorder(new Insets(0, 0, 0, 0)));
    accountPane.setMinimumSize(new Dimension(200, 100));
    accountPane.setAutoscrolls(true);
    add(accountPane, BorderLayout.CENTER);
}
Also used : JPanel(javax.swing.JPanel) RollOverButton(jgnash.ui.components.RollOverButton) Insets(java.awt.Insets) BorderLayout(java.awt.BorderLayout) JToolBar(javax.swing.JToolBar) Dimension(java.awt.Dimension) EmptyBorder(javax.swing.border.EmptyBorder) JSeparator(javax.swing.JSeparator)

Example 4 with RollOverButton

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

the class MainRegisterPanel method layoutMainPanel.

private void layoutMainPanel() {
    final ResourceBundle rb = ResourceUtils.getBundle();
    JPanel toolPanel;
    toolPanel = new JPanel();
    registerPane = new JSplitPane();
    registerPane.setOneTouchExpandable(true);
    setLayout(new BorderLayout());
    toolPanel.setLayout(new BorderLayout());
    JToolBar toolBar = new JToolBar();
    toolBar.setFloatable(false);
    toolBar.setRollover(true);
    reconcileButton = new RollOverButton(rb.getString("Button.Reconcile"), IconUtils.getIcon("/jgnash/resource/view-refresh.png"));
    reconcileButton.setToolTipText(rb.getString("ToolTip.ReconcileAccount"));
    reconcileButton.addActionListener(this);
    toolBar.add(reconcileButton);
    filterButton = new RollOverButton(rb.getString("Button.Filter"), IconUtils.getIcon("/jgnash/resource/preferences-system.png"));
    filterButton.setToolTipText(rb.getString("ToolTip.FilterAccounts"));
    filterButton.addActionListener(this);
    toolBar.add(filterButton);
    columnsButton = new RollOverButton(rb.getString("Button.Columns"), IconUtils.getIcon("/jgnash/resource/stock_select-column.png"));
    columnsButton.setToolTipText(rb.getString("ToolTip.ColumnVis"));
    columnsButton.addActionListener(this);
    toolBar.add(columnsButton);
    resizeButton = new RollOverButton(rb.getString("Button.Resize"), IconUtils.getIcon("/jgnash/resource/stock_table-fit-width.png"));
    resizeButton.setToolTipText(rb.getString("ToolTip.ResizeColumns"));
    resizeButton.addActionListener(this);
    toolBar.add(resizeButton);
    zoomButton = new RollOverButton(rb.getString("Button.Zoom"), IconUtils.getIcon("/jgnash/resource/edit-find.png"));
    zoomButton.setToolTipText(rb.getString("ToolTip.ZoomRegister"));
    zoomButton.addActionListener(this);
    toolBar.add(zoomButton);
    printButton = new RollOverButton(rb.getString("Button.Print"), IconUtils.getIcon("/jgnash/resource/document-print.png"));
    printButton.setToolTipText(rb.getString("ToolTip.PrintRegRep"));
    printButton.addActionListener(this);
    toolBar.add(printButton);
    exportButton = new RollOverButton(rb.getString("Button.Export"), IconUtils.getIcon("/jgnash/resource/document-save-as.png"));
    exportButton.setToolTipText(rb.getString("ToolTip.ExportTransactions"));
    exportButton.addActionListener(this);
    toolBar.add(exportButton);
    toolPanel.add(toolBar, BorderLayout.NORTH);
    toolPanel.add(new JSeparator(), BorderLayout.CENTER);
    add(toolPanel, java.awt.BorderLayout.NORTH);
    registerPane.setDividerLocation(50);
    registerPane.setContinuousLayout(true);
    registerTree = new RegisterTree();
    registerTree.setBorder(new EmptyBorder(new Insets(0, 0, 2, 0)));
    registerTree.expand();
    registerPane.setLeftComponent(registerTree);
    registerPane.setRightComponent(new JPanel(null));
    add(registerPane, BorderLayout.CENTER);
    registerPane.setDividerLocation(prefs.getInt(DIVIDER, registerPane.getDividerLocation()));
    MessageBus.getInstance().registerListener(this, MessageChannel.ACCOUNT, MessageChannel.SYSTEM);
}
Also used : JPanel(javax.swing.JPanel) RollOverButton(jgnash.ui.components.RollOverButton) Insets(java.awt.Insets) BorderLayout(java.awt.BorderLayout) ResourceBundle(java.util.ResourceBundle) JToolBar(javax.swing.JToolBar) JSplitPane(javax.swing.JSplitPane) EmptyBorder(javax.swing.border.EmptyBorder) JSeparator(javax.swing.JSeparator)

Example 5 with RollOverButton

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

the class BudgetPanel method initComponents.

private void initComponents() {
    initBudgetCombo();
    ResourceBundle rb = ResourceUtils.getBundle();
    budgetExportButton = new RollOverButton(rb.getString("Button.ExportSpreadsheet"), IconUtils.getIcon("/jgnash/resource/x-office-spreadsheet.png"));
    budgetExportButton.addActionListener(this);
    budgetManagerButton = new RollOverButton(rb.getString("Button.BudgetMgr"), IconUtils.getIcon("/jgnash/resource/document-new.png"));
    budgetManagerButton.setToolTipText(rb.getString("ToolTip.BudgetMgr"));
    budgetManagerButton.addActionListener(this);
    budgetPropertiesButton = new RollOverButton(rb.getString("Button.Properties"), IconUtils.getIcon("/jgnash/resource/document-properties.png"));
    budgetPropertiesButton.addActionListener(this);
    summaryRowVisibleCheckBox = new JCheckBox(rb.getString("Button.SumRowVis"));
    summaryRowVisibleCheckBox.setSelected(preferences.getBoolean(ROW_VISIBLE, true));
    summaryRowVisibleCheckBox.setFocusPainted(false);
    summaryColVisibleCheckBox = new JCheckBox(rb.getString("Button.SumColVis"));
    summaryColVisibleCheckBox.setSelected(preferences.getBoolean(COL_VISIBLE, true));
    summaryColVisibleCheckBox.setFocusPainted(false);
    summaryColVisibleCheckBox.addActionListener(this);
    summaryRowVisibleCheckBox.addActionListener(this);
    updateControlsState();
}
Also used : JCheckBox(javax.swing.JCheckBox) RollOverButton(jgnash.ui.components.RollOverButton) ResourceBundle(java.util.ResourceBundle)

Aggregations

RollOverButton (jgnash.ui.components.RollOverButton)5 JToolBar (javax.swing.JToolBar)4 BorderLayout (java.awt.BorderLayout)3 Insets (java.awt.Insets)3 JPanel (javax.swing.JPanel)3 JSeparator (javax.swing.JSeparator)3 EmptyBorder (javax.swing.border.EmptyBorder)3 ResourceBundle (java.util.ResourceBundle)2 Dimension (java.awt.Dimension)1 KeyAdapter (java.awt.event.KeyAdapter)1 KeyEvent (java.awt.event.KeyEvent)1 MouseAdapter (java.awt.event.MouseAdapter)1 MouseEvent (java.awt.event.MouseEvent)1 DefaultComboBoxModel (javax.swing.DefaultComboBoxModel)1 JButton (javax.swing.JButton)1 JCheckBox (javax.swing.JCheckBox)1 JScrollPane (javax.swing.JScrollPane)1 JSplitPane (javax.swing.JSplitPane)1 CheckLayout (jgnash.engine.checks.CheckLayout)1 CheckObjectType (jgnash.engine.checks.CheckObject.CheckObjectType)1