Search in sources :

Example 76 with JToolBar

use of javax.swing.JToolBar in project JMRI by JMRI.

the class MdiMainFrame method addMainToolBar.

protected void addMainToolBar(String toolBarFile) {
    // no context
    JToolBar toolBar = JToolBarUtil.loadToolBar(toolBarFile, rightWI, null);
    // this takes up space at the top until pulled to floating
    add(toolBar, BorderLayout.NORTH);
}
Also used : JToolBar(javax.swing.JToolBar)

Example 77 with JToolBar

use of javax.swing.JToolBar in project JMRI by JMRI.

the class MultiPaneWindow method addMainToolBar.

protected void addMainToolBar(String toolBarFile) {
    JToolBar toolBar = JToolBarUtil.loadToolBar(toolBarFile, rightTopWI, null);
    // this takes up space at the top until pulled to floating
    add(toolBar, BorderLayout.NORTH);
}
Also used : JToolBar(javax.swing.JToolBar)

Example 78 with JToolBar

use of javax.swing.JToolBar 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 79 with JToolBar

use of javax.swing.JToolBar in project jgnash by ccavanaugh.

the class BudgetPanel method layoutMainPanel.

private void layoutMainPanel() {
    initComponents();
    FormLayout layout = new FormLayout("fill:p:g, 5dlu", "d, $rg, d, f:p:g, 5dlu");
    PanelBuilder builder = new PanelBuilder(layout, this);
    CellConstraints cc = new CellConstraints();
    JToolBar toolBar = new JToolBar();
    toolBar.setFloatable(false);
    toolBar.setRollover(true);
    toolBar.add(budgetCombo);
    toolBar.add(budgetPropertiesButton);
    toolBar.addSeparator();
    toolBar.add(budgetManagerButton);
    toolBar.addSeparator();
    toolBar.add(summaryRowVisibleCheckBox);
    toolBar.add(summaryColVisibleCheckBox);
    toolBar.addSeparator();
    toolBar.add(budgetExportButton);
    builder.add(toolBar, cc.xyw(1, 1, 2));
    scrollPane = new JideScrollPane();
    // force it something small so it will resize correctly
    scrollPane.setPreferredSize(new Dimension(1, 1));
    scrollPane.setColumnHeadersHeightUnified(true);
    rowHeaderResizeHandler = new AccountRowHeaderResizeHandler(scrollPane);
    overviewPanel = new BudgetOverviewPanel(this);
    add(overviewPanel, cc.xyw(1, 3, 2));
    add(scrollPane, cc.xy(1, 4));
    // listen for budget events
    MessageBus.getInstance().registerListener(this, MessageChannel.BUDGET);
    MessageBus.getInstance().registerListener(this, MessageChannel.SYSTEM);
    if (budgetCombo.getSelectedBudget() != null) {
        showBudgetPane();
    }
}
Also used : FormLayout(com.jgoodies.forms.layout.FormLayout) PanelBuilder(com.jgoodies.forms.builder.PanelBuilder) JideScrollPane(com.jidesoft.swing.JideScrollPane) JToolBar(javax.swing.JToolBar) Dimension(java.awt.Dimension) CellConstraints(com.jgoodies.forms.layout.CellConstraints)

Example 80 with JToolBar

use of javax.swing.JToolBar in project jgnash by ccavanaugh.

the class ActionParser method createToolBar.

public JToolBar createToolBar(final String id) {
    JToolBar toolBar = new JToolBar();
    ActionNode node = actionTrees.get(id);
    for (int i = 0; i < node.size(); i++) {
        if (node.id == null && node.idref == null) {
            toolBar.addSeparator();
        } else {
            toolBar.add(createButton(node.getChildAt(i)));
        }
    }
    return toolBar;
}
Also used : JToolBar(javax.swing.JToolBar)

Aggregations

JToolBar (javax.swing.JToolBar)124 JButton (javax.swing.JButton)51 BorderLayout (java.awt.BorderLayout)45 JPanel (javax.swing.JPanel)37 JScrollPane (javax.swing.JScrollPane)30 Dimension (java.awt.Dimension)25 Insets (java.awt.Insets)25 ActionEvent (java.awt.event.ActionEvent)24 JLabel (javax.swing.JLabel)23 ActionListener (java.awt.event.ActionListener)19 ImageIcon (javax.swing.ImageIcon)17 Component (java.awt.Component)14 JSplitPane (javax.swing.JSplitPane)14 JTable (javax.swing.JTable)14 JTextField (javax.swing.JTextField)14 JPopupMenu (javax.swing.JPopupMenu)13 JToggleButton (javax.swing.JToggleButton)12 GridBagConstraints (java.awt.GridBagConstraints)10 GridBagLayout (java.awt.GridBagLayout)10 JComponent (javax.swing.JComponent)10