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;
}
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;
}
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;
}
Aggregations