Search in sources :

Example 1 with SpinningDial

use of com.mucommander.ui.icon.SpinningDial in project mucommander by mucommander.

the class RunDialog method createInputArea.

/**
 * Creates the shell input part of the dialog.
 * @return the shell input part of the dialog.
 */
private YBoxPanel createInputArea() {
    YBoxPanel mainPanel;
    JPanel labelPanel;
    mainPanel = new YBoxPanel();
    // Adds a textual description:
    // - if we're working in a local directory, 'run in current folder'.
    // - if we're working on a non-standard FS, 'run in home folder'.
    mainPanel.add(new JLabel(mainFrame.getActivePanel().getCurrentFolder().getURL().getScheme().equals(LocalFile.SCHEMA) ? Translator.get("run_dialog.run_command_description") + ":" : Translator.get("run_dialog.run_in_home_description") + ":"));
    // Adds the shell input combo box.
    mainPanel.add(inputCombo = new ShellComboBox(this));
    inputCombo.setEnabled(true);
    // Adds a textual description of the shell output area.
    mainPanel.addSpace(10);
    labelPanel = new JPanel(new FlowLayout(FlowLayout.LEFT));
    labelPanel.add(new JLabel(Translator.get("run_dialog.command_output") + ":"));
    labelPanel.add(new JLabel(dial = new SpinningDial()));
    mainPanel.add(labelPanel);
    return mainPanel;
}
Also used : JPanel(javax.swing.JPanel) FlowLayout(java.awt.FlowLayout) YBoxPanel(com.mucommander.commons.util.ui.layout.YBoxPanel) SpinningDial(com.mucommander.ui.icon.SpinningDial) JLabel(javax.swing.JLabel)

Example 2 with SpinningDial

use of com.mucommander.ui.icon.SpinningDial in project mucommander by mucommander.

the class AppearancePanel method createLookAndFeelPanel.

/**
 * Creates the look and feel panel.
 *
 * @return the look and feel panel.
 */
private JPanel createLookAndFeelPanel() {
    JPanel lnfPanel;
    // Creates the panel.
    lnfPanel = new YBoxPanel();
    lnfPanel.setAlignmentX(LEFT_ALIGNMENT);
    lnfPanel.setBorder(BorderFactory.createTitledBorder(Translator.get("prefs_dialog.look_and_feel")));
    // Creates the look and feel combo box.
    lookAndFeelComboBox = new PrefComboBox() {

        public boolean hasChanged() {
            int selectedIndex = getSelectedIndex();
            if (selectedIndex < 0)
                return false;
            return !lookAndFeels[selectedIndex].getClassName().equals(MuConfigurations.getPreferences().getVariable(MuPreference.LOOK_AND_FEEL));
        }
    };
    lookAndFeelComboBox.setRenderer(new BasicComboBoxRenderer() {

        @Override
        public Component getListCellRendererComponent(JList list, Object value, int index, boolean isSelected, boolean cellHasFocus) {
            JLabel label;
            label = (JLabel) super.getListCellRendererComponent(list, value, index, isSelected, cellHasFocus);
            if (index < 0)
                return label;
            // All look and feels that are not modifiable must be flagged with a lock icon.
            if (isLookAndFeelModifiable(lookAndFeels[index]))
                label.setIcon(transparentIcon);
            else
                label.setIcon(lockIcon);
            return label;
        }
    });
    // Populates the look and feel combo box.
    populateLookAndFeels();
    // Initialises buttons and event listening.
    importLookAndFeelButton = new JButton(Translator.get("prefs_dialog.import") + "...");
    deleteLookAndFeelButton = new JButton(Translator.get("delete"));
    importLookAndFeelButton.addActionListener(this);
    deleteLookAndFeelButton.addActionListener(this);
    resetLookAndFeelButtons();
    lookAndFeelComboBox.addActionListener(this);
    // Adds the look and feel list and the action buttons to the panel.
    JPanel flowPanel = new JPanel(new FlowLayout(FlowLayout.LEFT));
    flowPanel.add(lookAndFeelComboBox);
    flowPanel.add(importLookAndFeelButton);
    flowPanel.add(deleteLookAndFeelButton);
    flowPanel.add(new JLabel(dial = new SpinningDial()));
    lnfPanel.add(flowPanel);
    return lnfPanel;
}
Also used : JPanel(javax.swing.JPanel) FlowLayout(java.awt.FlowLayout) JButton(javax.swing.JButton) JLabel(javax.swing.JLabel) BasicComboBoxRenderer(javax.swing.plaf.basic.BasicComboBoxRenderer) YBoxPanel(com.mucommander.commons.util.ui.layout.YBoxPanel) PrefComboBox(com.mucommander.ui.dialog.pref.component.PrefComboBox) SpinningDial(com.mucommander.ui.icon.SpinningDial) Component(java.awt.Component) JList(javax.swing.JList)

Example 3 with SpinningDial

use of com.mucommander.ui.icon.SpinningDial in project mucommander by mucommander.

the class AsyncPanel method getDefaultWaitComponent.

/**
 * Returns the default component to be displayed while the target component is being loaded.
 *
 * @return the default component to be displayed while the target component is being loaded
 */
private static JComponent getDefaultWaitComponent() {
    JLabel label = new JLabel(Translator.get("loading"));
    label.setIcon(new SpinningDial(24, 24, true));
    // Center the label both horizontally and vertically
    JPanel tempPanel = new JPanel(new GridBagLayout());
    GridBagConstraints gbc = new GridBagConstraints();
    gbc.gridx = 0;
    gbc.gridy = 0;
    gbc.fill = GridBagConstraints.BOTH;
    tempPanel.add(label, gbc);
    return tempPanel;
}
Also used : JPanel(javax.swing.JPanel) GridBagConstraints(java.awt.GridBagConstraints) GridBagLayout(java.awt.GridBagLayout) SpinningDial(com.mucommander.ui.icon.SpinningDial) JLabel(javax.swing.JLabel)

Aggregations

SpinningDial (com.mucommander.ui.icon.SpinningDial)3 JLabel (javax.swing.JLabel)3 JPanel (javax.swing.JPanel)3 YBoxPanel (com.mucommander.commons.util.ui.layout.YBoxPanel)2 FlowLayout (java.awt.FlowLayout)2 PrefComboBox (com.mucommander.ui.dialog.pref.component.PrefComboBox)1 Component (java.awt.Component)1 GridBagConstraints (java.awt.GridBagConstraints)1 GridBagLayout (java.awt.GridBagLayout)1 JButton (javax.swing.JButton)1 JList (javax.swing.JList)1 BasicComboBoxRenderer (javax.swing.plaf.basic.BasicComboBoxRenderer)1