Search in sources :

Example 1 with JXBusyLabel

use of org.jdesktop.swingx.JXBusyLabel in project jgnash by ccavanaugh.

the class MainFrame method buildUI.

private void buildUI() {
    ActionParser actionParser = new ActionParser(this);
    actionParser.preLoadActions("jgnash.ui.actions");
    actionParser.preLoadAction("copy-command", new DefaultEditorKit.CopyAction());
    actionParser.preLoadAction("cut-command", new DefaultEditorKit.CutAction());
    actionParser.preLoadAction("paste-command", new DefaultEditorKit.PasteAction());
    actionParser.preLoadAction("exit-command", new AbstractAction() {

        @Override
        public void actionPerformed(final ActionEvent e) {
            shutDown();
        }
    });
    actionParser.preLoadAction("open-command", new OpenFileAction());
    actionParser.preLoadAction("open-command-tb", new OpenFileAction());
    actionParser.preLoadAction("account-filter-command", new AbstractEnabledAction() {

        @Override
        public void actionPerformed(final ActionEvent e) {
            expandingAccountPanel.showAccountFilterDialog();
        }
    });
    actionParser.preLoadAction("register-filter-command", new AbstractEnabledAction() {

        @Override
        public void actionPerformed(final ActionEvent e) {
            registerTreePanel.showAccountFilterDialog();
        }
    });
    actionParser.preLoadAction("currency-background-update-command", new UpdateExchangeRateAction());
    actionParser.preLoadAction("security-background-update-command", new UpdateSecuritiesAction());
    try (final InputStream stream = MainFrame.class.getResourceAsStream("/jgnash/resource/main-frame-actions.xml")) {
        actionParser.loadFile(stream);
    } catch (final IOException exception) {
        logger.log(Level.SEVERE, exception.getMessage(), exception);
    }
    menuBar = actionParser.createMenuBar("main-menu");
    JToolBar toolBar = actionParser.createToolBar("main-toolbar");
    toolBar.setFloatable(false);
    toolBar.setRollover(true);
    viewMenu = (JMenu) actionParser.getJMenuItem("view-menu-command");
    reportMenu = (JMenu) actionParser.getJMenuItem("report-menu-command");
    windowMenu = (JMenu) actionParser.getJMenuItem("window-menu-command");
    Objects.requireNonNull(windowMenu);
    windowMenu.setEnabled(false);
    editAction = actionParser.getAction("edit-menu-command");
    if (EngineFactory.getEngine(EngineFactory.DEFAULT) == null) {
        setOpenState(false);
    }
    setTitle(Main.VERSION);
    mainView = buildMainView();
    backgroundOperationLabel = new JXBusyLabel(new Dimension(18, 18));
    statusField = new JTextField();
    statusField.setEditable(false);
    statusField.setFont(statusField.getFont().deriveFont(statusField.getFont().getSize2D() - 1f));
    infoColor = statusField.getForeground();
    JXStatusBar statusBar = new JXStatusBar();
    statusBar.setResizeHandleEnabled(true);
    statusBar.add(statusField, new JXStatusBar.Constraint(JXStatusBar.Constraint.ResizeBehavior.FILL));
    if (ThemeManager.isLookAndFeelSubstance()) {
        statusBar.add(new SubstanceFontSlider());
    }
    statusBar.add(backgroundOperationLabel);
    statusBar.add(new MemoryMonitor(), new JXStatusBar.Constraint(120));
    JPanel contentPanel = new JPanel(new BorderLayout());
    contentPanel.add(toolBar, BorderLayout.NORTH);
    contentPanel.add(mainView, BorderLayout.CENTER);
    contentPanel.add(statusBar, BorderLayout.SOUTH);
    JPanel rootPanel = new JPanel(new BorderLayout());
    rootPanel.add(menuBar, BorderLayout.NORTH);
    rootPanel.add(contentPanel, BorderLayout.CENTER);
    waitPanel = new WaitMessagePanel();
    busyLayerUI = new BusyLayerUI();
    JLayer<JPanel> rootLayer = new JLayer<>(rootPanel, busyLayerUI);
    getContentPane().add(rootLayer, BorderLayout.CENTER);
    setGlassPane(waitPanel);
}
Also used : JPanel(javax.swing.JPanel) SubstanceFontSlider(jgnash.ui.components.SubstanceFontSlider) JLayer(javax.swing.JLayer) ActionEvent(java.awt.event.ActionEvent) JTextField(javax.swing.JTextField) ActionParser(jgnash.ui.util.builder.ActionParser) BorderLayout(java.awt.BorderLayout) DefaultEditorKit(javax.swing.text.DefaultEditorKit) AbstractAction(javax.swing.AbstractAction) JXBusyLabel(org.jdesktop.swingx.JXBusyLabel) WaitMessagePanel(jgnash.ui.components.WaitMessagePanel) AbstractEnabledAction(jgnash.ui.actions.AbstractEnabledAction) InputStream(java.io.InputStream) IOException(java.io.IOException) JToolBar(javax.swing.JToolBar) Dimension(java.awt.Dimension) MemoryMonitor(jgnash.ui.components.MemoryMonitor) JXStatusBar(org.jdesktop.swingx.JXStatusBar)

Example 2 with JXBusyLabel

use of org.jdesktop.swingx.JXBusyLabel in project gephi by gephi.

the class PreviewTopComponent method initComponents.

/**
 * This method is called from within the constructor to initialize the form.
 * WARNING: Do NOT modify this code. The content of this method is always
 * regenerated by the Form Editor.
 */
// <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
private void initComponents() {
    java.awt.GridBagConstraints gridBagConstraints;
    southBusyLabel = new JXBusyLabel(new Dimension(14, 14));
    bannerPanel = new javax.swing.JPanel();
    bannerLabel = new javax.swing.JLabel();
    refreshButton = new javax.swing.JButton();
    previewPanel = new javax.swing.JPanel();
    sketchPanel = new javax.swing.JPanel();
    refreshPanel = new javax.swing.JPanel();
    busyLabel = new JXBusyLabel(new Dimension(20, 20));
    southToolbar = new javax.swing.JToolBar();
    backgroundButton = new JColorButton(Color.WHITE);
    resetZoomButton = new javax.swing.JButton();
    minusButton = new javax.swing.JButton();
    plusButton = new javax.swing.JButton();
    setLayout(new java.awt.GridBagLayout());
    gridBagConstraints = new java.awt.GridBagConstraints();
    gridBagConstraints.gridx = 0;
    gridBagConstraints.gridy = 0;
    gridBagConstraints.anchor = java.awt.GridBagConstraints.FIRST_LINE_START;
    gridBagConstraints.insets = new java.awt.Insets(5, 5, 0, 0);
    add(southBusyLabel, gridBagConstraints);
    bannerPanel.setBackground(new java.awt.Color(178, 223, 240));
    bannerPanel.setBorder(BorderFactory.createMatteBorder(0, 0, 1, 0, Color.BLACK));
    bannerPanel.setLayout(new java.awt.GridBagLayout());
    // NOI18N
    bannerLabel.setIcon(new javax.swing.ImageIcon(getClass().getResource("/org/gephi/desktop/preview/resources/info.png")));
    // NOI18N
    org.openide.awt.Mnemonics.setLocalizedText(bannerLabel, org.openide.util.NbBundle.getMessage(PreviewTopComponent.class, "PreviewTopComponent.bannerLabel.text"));
    gridBagConstraints = new java.awt.GridBagConstraints();
    gridBagConstraints.gridx = 0;
    gridBagConstraints.gridy = 0;
    gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
    gridBagConstraints.weightx = 1.0;
    gridBagConstraints.insets = new java.awt.Insets(2, 5, 2, 5);
    bannerPanel.add(bannerLabel, gridBagConstraints);
    // NOI18N
    org.openide.awt.Mnemonics.setLocalizedText(refreshButton, org.openide.util.NbBundle.getMessage(PreviewTopComponent.class, "PreviewTopComponent.refreshButton.text"));
    refreshButton.addActionListener(new java.awt.event.ActionListener() {

        @Override
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            refreshButtonActionPerformed(evt);
        }
    });
    gridBagConstraints = new java.awt.GridBagConstraints();
    gridBagConstraints.gridx = 1;
    gridBagConstraints.gridy = 0;
    gridBagConstraints.anchor = java.awt.GridBagConstraints.EAST;
    gridBagConstraints.weightx = 1.0;
    gridBagConstraints.insets = new java.awt.Insets(1, 0, 1, 1);
    bannerPanel.add(refreshButton, gridBagConstraints);
    gridBagConstraints = new java.awt.GridBagConstraints();
    gridBagConstraints.gridx = 0;
    gridBagConstraints.gridy = 0;
    gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
    gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTH;
    add(bannerPanel, gridBagConstraints);
    previewPanel.setLayout(new java.awt.CardLayout());
    sketchPanel.setBackground(new java.awt.Color(255, 255, 255));
    sketchPanel.setPreferredSize(new java.awt.Dimension(500, 500));
    sketchPanel.setLayout(new java.awt.BorderLayout());
    previewPanel.add(sketchPanel, "previewCard");
    refreshPanel.setOpaque(false);
    refreshPanel.setLayout(new java.awt.GridBagLayout());
    busyLabel.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
    // NOI18N
    org.openide.awt.Mnemonics.setLocalizedText(busyLabel, org.openide.util.NbBundle.getMessage(PreviewTopComponent.class, "PreviewTopComponent.busyLabel.text"));
    gridBagConstraints = new java.awt.GridBagConstraints();
    gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
    gridBagConstraints.weightx = 1.0;
    gridBagConstraints.weighty = 1.0;
    refreshPanel.add(busyLabel, gridBagConstraints);
    previewPanel.add(refreshPanel, "refreshCard");
    gridBagConstraints = new java.awt.GridBagConstraints();
    gridBagConstraints.gridx = 0;
    gridBagConstraints.gridy = 0;
    gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
    gridBagConstraints.weightx = 1.0;
    gridBagConstraints.weighty = 1.0;
    add(previewPanel, gridBagConstraints);
    southToolbar.setFloatable(false);
    southToolbar.setRollover(true);
    // NOI18N
    org.openide.awt.Mnemonics.setLocalizedText(backgroundButton, org.openide.util.NbBundle.getMessage(PreviewTopComponent.class, "PreviewTopComponent.backgroundButton.text"));
    backgroundButton.setFocusable(false);
    southToolbar.add(backgroundButton);
    // NOI18N
    org.openide.awt.Mnemonics.setLocalizedText(resetZoomButton, org.openide.util.NbBundle.getMessage(PreviewTopComponent.class, "PreviewTopComponent.resetZoomButton.text"));
    resetZoomButton.setFocusable(false);
    resetZoomButton.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
    resetZoomButton.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);
    southToolbar.add(resetZoomButton);
    // NOI18N
    org.openide.awt.Mnemonics.setLocalizedText(minusButton, "-");
    // NOI18N
    minusButton.setToolTipText(org.openide.util.NbBundle.getMessage(PreviewTopComponent.class, "PreviewTopComponent.minusButton.toolTipText"));
    minusButton.setFocusable(false);
    minusButton.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
    minusButton.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);
    southToolbar.add(minusButton);
    // NOI18N
    org.openide.awt.Mnemonics.setLocalizedText(plusButton, "+");
    // NOI18N
    plusButton.setToolTipText(org.openide.util.NbBundle.getMessage(PreviewTopComponent.class, "PreviewTopComponent.plusButton.toolTipText"));
    plusButton.setFocusable(false);
    plusButton.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
    plusButton.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);
    southToolbar.add(plusButton);
    gridBagConstraints = new java.awt.GridBagConstraints();
    gridBagConstraints.gridx = 0;
    gridBagConstraints.gridy = 1;
    gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
    gridBagConstraints.weightx = 1.0;
    add(southToolbar, gridBagConstraints);
}
Also used : Color(java.awt.Color) JXBusyLabel(org.jdesktop.swingx.JXBusyLabel) ActionListener(java.awt.event.ActionListener) CardLayout(java.awt.CardLayout) Dimension(java.awt.Dimension) ActionEvent(java.awt.event.ActionEvent) JColorButton(org.gephi.ui.components.JColorButton) Dimension(java.awt.Dimension) BorderLayout(java.awt.BorderLayout)

Aggregations

BorderLayout (java.awt.BorderLayout)2 Dimension (java.awt.Dimension)2 ActionEvent (java.awt.event.ActionEvent)2 JXBusyLabel (org.jdesktop.swingx.JXBusyLabel)2 CardLayout (java.awt.CardLayout)1 Color (java.awt.Color)1 ActionListener (java.awt.event.ActionListener)1 IOException (java.io.IOException)1 InputStream (java.io.InputStream)1 AbstractAction (javax.swing.AbstractAction)1 JLayer (javax.swing.JLayer)1 JPanel (javax.swing.JPanel)1 JTextField (javax.swing.JTextField)1 JToolBar (javax.swing.JToolBar)1 DefaultEditorKit (javax.swing.text.DefaultEditorKit)1 AbstractEnabledAction (jgnash.ui.actions.AbstractEnabledAction)1 MemoryMonitor (jgnash.ui.components.MemoryMonitor)1 SubstanceFontSlider (jgnash.ui.components.SubstanceFontSlider)1 WaitMessagePanel (jgnash.ui.components.WaitMessagePanel)1 ActionParser (jgnash.ui.util.builder.ActionParser)1