summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorunknown <Owner@.(none)>2011-07-15 12:26:55 (GMT)
committer unknown <Owner@.(none)>2011-07-15 12:26:55 (GMT)
commitd2fa8b007a7940ccca596efa30dcd226c41915d3 (patch)
tree524477b11181b1a4e887cf1d001872dfcdfd46c9
parent4191132348e20394940b3128b1c1ce84d9ab1623 (diff)
downloadQCG-Data-d2fa8b007a7940ccca596efa30dcd226c41915d3.zip
QCG-Data-d2fa8b007a7940ccca596efa30dcd226c41915d3.tar.gz
QCG-Data-d2fa8b007a7940ccca596efa30dcd226c41915d3.tar.bz2
[#338] allow different look and feel of client interface plus some z fighting fixes for login dialog
-rw-r--r--idrop-swing/release_notes.txt2
-rw-r--r--idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/LoginDialog.java12
-rw-r--r--idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/StartupSequencer.java12
-rw-r--r--idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/iDrop.form86
-rw-r--r--idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/iDrop.java217
5 files changed, 298 insertions, 31 deletions
diff --git a/idrop-swing/release_notes.txt b/idrop-swing/release_notes.txt
index bd5e5b2..a190fde 100644
--- a/idrop-swing/release_notes.txt
+++ b/idrop-swing/release_notes.txt
@@ -13,5 +13,5 @@ work in progress -- Milestone 0.9.8
*[#315] delete nodes in ll, refresh issue?
*[#321] progress bar not clearing at begin of txfr
* [#317] rename irods file (in windows xp) completes but throws up an 'exception moving file' dialog
-
+*[#338] allow different look and feel of client interface
diff --git a/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/LoginDialog.java b/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/LoginDialog.java
index 2cc283d..4831cdf 100644
--- a/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/LoginDialog.java
+++ b/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/LoginDialog.java
@@ -177,22 +177,26 @@ public class LoginDialog extends JDialog {
if (ex.getMessage().indexOf("Connection refused") > -1) {
Logger.getLogger(LoginDialog.class.getName()).log(Level.SEVERE,
null, ex);
- iDrop.showMessageFromOperation("Cannot connect to the server, is it down?");
+ MessageManager.showError(this, "Cannot connect to the server, is it down?", "Login Error");
+
return true;
} else if (ex.getMessage().indexOf("Connection reset") > -1) {
Logger.getLogger(LoginDialog.class.getName()).log(Level.SEVERE,
null, ex);
- iDrop.showMessageFromOperation("Cannot connect to the server, is it down?");
+ MessageManager.showError(this, "Cannot connect to the server, is it down?", "Login Error");
+
return true;
} else if (ex.getMessage().indexOf("io exception opening socket") > -1) {
Logger.getLogger(LoginDialog.class.getName()).log(Level.SEVERE,
null, ex);
- iDrop.showMessageFromOperation("Cannot connect to the server, is it down?");
+ MessageManager.showError(this, "Cannot connect to the server, is it down?", "Login Error");
+
return true;
} else {
Logger.getLogger(LoginDialog.class.getName()).log(Level.SEVERE,
null, ex);
- iDrop.showMessageFromOperation("login error - unable to log in, or invalid user id");
+ MessageManager.showError(this, "login error - unable to log in, or invalid user id", "Login Error");
+
return true;
}
} finally {
diff --git a/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/StartupSequencer.java b/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/StartupSequencer.java
index 6ab4f13..1fb084d 100644
--- a/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/StartupSequencer.java
+++ b/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/StartupSequencer.java
@@ -37,7 +37,7 @@ public class StartupSequencer {
private iDrop idrop;
private IDROPCore idropCore;
private static final org.slf4j.Logger log = LoggerFactory.getLogger(StartupSequencer.class);
- public static final int STARTUP_SEQUENCE_PAUSE_INTERVAL = 2000;
+ public static final int STARTUP_SEQUENCE_PAUSE_INTERVAL = 1000;
public void doStartupSequence() {
@@ -138,10 +138,12 @@ public class StartupSequencer {
int x = (tk.getScreenSize().width - loginDialog.getWidth()) / 2;
int y = (tk.getScreenSize().height - loginDialog.getHeight()) / 2;
loginDialog.setLocation(x, y);
- idropSplashWindow.toBack();
+
loginDialog.setAlwaysOnTop(true);
- loginDialog.toFront();
+
loginDialog.setVisible(true);
+ loginDialog.toFront();
+ idropSplashWindow.toBack();
if (idropCore.getIrodsAccount() == null) {
log.warn("no login account, exiting");
@@ -301,8 +303,12 @@ public class StartupSequencer {
if (idropCore.getIdropConfig().isShowStartupWizard()) {
log.info("doing setup wizard");
+ // idrop will be visible, don't z fight and declutter for wizard...s
+ idrop.setVisible(false);
SetupWizard setupWizard = new SetupWizard(idrop, true);
+ setupWizard.toFront();
setupWizard.setVisible(true);
+ idrop.setVisible(true);
}
}
}
diff --git a/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/iDrop.form b/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/iDrop.form
index 7beab4b..fd2d374 100644
--- a/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/iDrop.form
+++ b/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/iDrop.form
@@ -22,6 +22,8 @@
</MenuItem>
</SubComponents>
</Container>
+ <Component class="javax.swing.ButtonGroup" name="buttonGroupLandF">
+ </Component>
<Menu class="javax.swing.JMenuBar" name="jMenuBar1">
<SubComponents>
<Menu class="javax.swing.JMenu" name="jMenuFile">
@@ -90,6 +92,90 @@
</MenuItem>
</SubComponents>
</Menu>
+ <Menu class="javax.swing.JMenu" name="jMenuTools">
+ <Properties>
+ <Property name="mnemonic" type="int" value="84"/>
+ <Property name="text" type="java.lang.String" value="Tools"/>
+ <Property name="toolTipText" type="java.lang.String" value="Tools and options for iDrop"/>
+ </Properties>
+ <SubComponents>
+ <Menu class="javax.swing.JMenu" name="jMenuLookAndFeel">
+ <Properties>
+ <Property name="mnemonic" type="int" value="108"/>
+ <Property name="text" type="java.lang.String" value="Set look and feel"/>
+ <Property name="toolTipText" type="java.lang.String" value="Set the look and feel for the GUI"/>
+ </Properties>
+ <SubComponents>
+ <MenuItem class="javax.swing.JRadioButtonMenuItem" name="jRadioButtonLookAndFeelDefault">
+ <Properties>
+ <Property name="buttonGroup" type="javax.swing.ButtonGroup" editor="org.netbeans.modules.form.RADComponent$ButtonGroupPropertyEditor">
+ <ComponentRef name="buttonGroupLandF"/>
+ </Property>
+ <Property name="mnemonic" type="int" value="100"/>
+ <Property name="text" type="java.lang.String" value="Default"/>
+ <Property name="toolTipText" type="java.lang.String" value="Default system look an dfeel"/>
+ </Properties>
+ <Events>
+ <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="jRadioButtonLookAndFeelDefaultActionPerformed"/>
+ </Events>
+ </MenuItem>
+ <MenuItem class="javax.swing.JRadioButtonMenuItem" name="jRadioButtonLookAndFeelNimbus">
+ <Properties>
+ <Property name="buttonGroup" type="javax.swing.ButtonGroup" editor="org.netbeans.modules.form.RADComponent$ButtonGroupPropertyEditor">
+ <ComponentRef name="buttonGroupLandF"/>
+ </Property>
+ <Property name="mnemonic" type="int" value="110"/>
+ <Property name="selected" type="boolean" value="true"/>
+ <Property name="text" type="java.lang.String" value="Nimbus"/>
+ <Property name="toolTipText" type="java.lang.String" value="Nimbus look and feel"/>
+ </Properties>
+ <Events>
+ <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="jRadioButtonLookAndFeelNimbusActionPerformed"/>
+ </Events>
+ </MenuItem>
+ <MenuItem class="javax.swing.JRadioButtonMenuItem" name="jRadioButtonMenuItemMetal">
+ <Properties>
+ <Property name="buttonGroup" type="javax.swing.ButtonGroup" editor="org.netbeans.modules.form.RADComponent$ButtonGroupPropertyEditor">
+ <ComponentRef name="buttonGroupLandF"/>
+ </Property>
+ <Property name="mnemonic" type="int" value="109"/>
+ <Property name="text" type="java.lang.String" value="Metal"/>
+ <Property name="toolTipText" type="java.lang.String" value="Metal look and feel"/>
+ </Properties>
+ <Events>
+ <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="jRadioButtonMenuItemMetalActionPerformed"/>
+ </Events>
+ </MenuItem>
+ <MenuItem class="javax.swing.JRadioButtonMenuItem" name="jRadioButtonMenuItemMotif">
+ <Properties>
+ <Property name="buttonGroup" type="javax.swing.ButtonGroup" editor="org.netbeans.modules.form.RADComponent$ButtonGroupPropertyEditor">
+ <ComponentRef name="buttonGroupLandF"/>
+ </Property>
+ <Property name="mnemonic" type="int" value="116"/>
+ <Property name="text" type="java.lang.String" value="Motif"/>
+ <Property name="toolTipText" type="java.lang.String" value="Motif look and feel"/>
+ </Properties>
+ <Events>
+ <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="jRadioButtonMenuItemMotifActionPerformed"/>
+ </Events>
+ </MenuItem>
+ <MenuItem class="javax.swing.JRadioButtonMenuItem" name="jRadioButtonMenuItemGTK">
+ <Properties>
+ <Property name="buttonGroup" type="javax.swing.ButtonGroup" editor="org.netbeans.modules.form.RADComponent$ButtonGroupPropertyEditor">
+ <ComponentRef name="buttonGroupLandF"/>
+ </Property>
+ <Property name="mnemonic" type="int" value="103"/>
+ <Property name="text" type="java.lang.String" value="GTK"/>
+ <Property name="toolTipText" type="java.lang.String" value="GTK look and feel"/>
+ </Properties>
+ <Events>
+ <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="jRadioButtonMenuItemGTKActionPerformed"/>
+ </Events>
+ </MenuItem>
+ </SubComponents>
+ </Menu>
+ </SubComponents>
+ </Menu>
</SubComponents>
</Menu>
</NonVisualComponents>
diff --git a/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/iDrop.java b/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/iDrop.java
index 36609a6..611fb5b 100644
--- a/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/iDrop.java
+++ b/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/iDrop.java
@@ -38,6 +38,7 @@ import javax.swing.JCheckBox;
import javax.swing.JDialog;
import javax.swing.JOptionPane;
import javax.swing.JToggleButton;
+import javax.swing.SwingUtilities;
import javax.swing.UIManager;
import javax.swing.UIManager.LookAndFeelInfo;
import javax.swing.event.ListSelectionEvent;
@@ -116,18 +117,8 @@ public class iDrop extends javax.swing.JFrame implements ActionListener,
throw new IllegalArgumentException("null idropCore");
}
- try {
- for (LookAndFeelInfo info : UIManager.getInstalledLookAndFeels()) {
- if ("Nimbus".equals(info.getName())) {
- UIManager.setLookAndFeel(info.getClassName());
- break;
- }
- }
- } catch (Exception e) {
- throw new IdropRuntimeException(e);
- }
-
this.iDropCore = idropCore;
+ setLookAndFeel("Nimbus");
}
/** Creates new form IDrop */
@@ -503,7 +494,7 @@ public class iDrop extends javax.swing.JFrame implements ActionListener,
Toolkit toolkit = getToolkit();
if (e.getActionCommand().equals("Exit")) {
- shutdown();
+ shutdown();
} else if (e.getActionCommand().equals("Logout")) {
this.setIrodsAccount(null);
this.signalChangeInAccountSoCachedDataCanBeCleared();
@@ -1120,6 +1111,7 @@ public class iDrop extends javax.swing.JFrame implements ActionListener,
searchTablePopupMenu = new javax.swing.JPopupMenu();
menuItemShowInHierarchy = new javax.swing.JMenuItem();
+ buttonGroupLandF = new javax.swing.ButtonGroup();
iDropToolbar = new javax.swing.JPanel();
pnlToolbarSizer = new javax.swing.JPanel();
pnlTopToolbarSearchArea = new javax.swing.JPanel();
@@ -1217,6 +1209,13 @@ public class iDrop extends javax.swing.JFrame implements ActionListener,
jMenuView = new javax.swing.JMenu();
jCheckBoxMenuItemShowSourceTree = new javax.swing.JCheckBoxMenuItem();
jCheckBoxMenuItemShowIrodsInfo = new javax.swing.JCheckBoxMenuItem();
+ jMenuTools = new javax.swing.JMenu();
+ jMenuLookAndFeel = new javax.swing.JMenu();
+ jRadioButtonLookAndFeelDefault = new javax.swing.JRadioButtonMenuItem();
+ jRadioButtonLookAndFeelNimbus = new javax.swing.JRadioButtonMenuItem();
+ jRadioButtonMenuItemMetal = new javax.swing.JRadioButtonMenuItem();
+ jRadioButtonMenuItemMotif = new javax.swing.JRadioButtonMenuItem();
+ jRadioButtonMenuItemGTK = new javax.swing.JRadioButtonMenuItem();
menuItemShowInHierarchy.setText("Show in iRODS");
menuItemShowInHierarchy.setToolTipText("Show this file or collection in the iRODS hierarchy");
@@ -1870,15 +1869,118 @@ public class iDrop extends javax.swing.JFrame implements ActionListener,
jMenuBar1.add(jMenuView);
+ jMenuTools.setMnemonic('T');
+ jMenuTools.setText("Tools");
+ jMenuTools.setToolTipText("Tools and options for iDrop");
+
+ jMenuLookAndFeel.setMnemonic('l');
+ jMenuLookAndFeel.setText("Set look and feel");
+ jMenuLookAndFeel.setToolTipText("Set the look and feel for the GUI");
+
+ buttonGroupLandF.add(jRadioButtonLookAndFeelDefault);
+ jRadioButtonLookAndFeelDefault.setMnemonic('d');
+ jRadioButtonLookAndFeelDefault.setText("Default");
+ jRadioButtonLookAndFeelDefault.setToolTipText("Default system look an dfeel");
+ jRadioButtonLookAndFeelDefault.addActionListener(new java.awt.event.ActionListener() {
+ public void actionPerformed(java.awt.event.ActionEvent evt) {
+ jRadioButtonLookAndFeelDefaultActionPerformed(evt);
+ }
+ });
+ jMenuLookAndFeel.add(jRadioButtonLookAndFeelDefault);
+
+ buttonGroupLandF.add(jRadioButtonLookAndFeelNimbus);
+ jRadioButtonLookAndFeelNimbus.setMnemonic('n');
+ jRadioButtonLookAndFeelNimbus.setSelected(true);
+ jRadioButtonLookAndFeelNimbus.setText("Nimbus");
+ jRadioButtonLookAndFeelNimbus.setToolTipText("Nimbus look and feel");
+ jRadioButtonLookAndFeelNimbus.addActionListener(new java.awt.event.ActionListener() {
+ public void actionPerformed(java.awt.event.ActionEvent evt) {
+ jRadioButtonLookAndFeelNimbusActionPerformed(evt);
+ }
+ });
+ jMenuLookAndFeel.add(jRadioButtonLookAndFeelNimbus);
+
+ buttonGroupLandF.add(jRadioButtonMenuItemMetal);
+ jRadioButtonMenuItemMetal.setMnemonic('m');
+ jRadioButtonMenuItemMetal.setText("Metal");
+ jRadioButtonMenuItemMetal.setToolTipText("Metal look and feel");
+ jRadioButtonMenuItemMetal.addActionListener(new java.awt.event.ActionListener() {
+ public void actionPerformed(java.awt.event.ActionEvent evt) {
+ jRadioButtonMenuItemMetalActionPerformed(evt);
+ }
+ });
+ jMenuLookAndFeel.add(jRadioButtonMenuItemMetal);
+
+ buttonGroupLandF.add(jRadioButtonMenuItemMotif);
+ jRadioButtonMenuItemMotif.setMnemonic('t');
+ jRadioButtonMenuItemMotif.setText("Motif");
+ jRadioButtonMenuItemMotif.setToolTipText("Motif look and feel");
+ jRadioButtonMenuItemMotif.addActionListener(new java.awt.event.ActionListener() {
+ public void actionPerformed(java.awt.event.ActionEvent evt) {
+ jRadioButtonMenuItemMotifActionPerformed(evt);
+ }
+ });
+ jMenuLookAndFeel.add(jRadioButtonMenuItemMotif);
+
+ buttonGroupLandF.add(jRadioButtonMenuItemGTK);
+ jRadioButtonMenuItemGTK.setMnemonic('g');
+ jRadioButtonMenuItemGTK.setText("GTK");
+ jRadioButtonMenuItemGTK.setToolTipText("GTK look and feel");
+ jRadioButtonMenuItemGTK.addActionListener(new java.awt.event.ActionListener() {
+ public void actionPerformed(java.awt.event.ActionEvent evt) {
+ jRadioButtonMenuItemGTKActionPerformed(evt);
+ }
+ });
+ jMenuLookAndFeel.add(jRadioButtonMenuItemGTK);
+
+ jMenuTools.add(jMenuLookAndFeel);
+
+ jMenuBar1.add(jMenuTools);
+
setJMenuBar(jMenuBar1);
pack();
}// </editor-fold>//GEN-END:initComponents
private void jMenuItemCloseActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItemCloseActionPerformed
- this.setVisible(false);
+ this.setVisible(false);
}//GEN-LAST:event_jMenuItemCloseActionPerformed
+ private void jRadioButtonMenuItemGTKActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jRadioButtonMenuItemGTKActionPerformed
+ if (jRadioButtonMenuItemGTK.isSelected()) {
+ log.info("setting GTK l&f");
+ setLookAndFeel("GTK");
+ }
+ }//GEN-LAST:event_jRadioButtonMenuItemGTKActionPerformed
+
+ private void jRadioButtonLookAndFeelDefaultActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jRadioButtonLookAndFeelDefaultActionPerformed
+ if (jRadioButtonLookAndFeelDefault.isSelected()) {
+ log.info("setting System l&f");
+ setLookAndFeel("System");
+ }
+ }//GEN-LAST:event_jRadioButtonLookAndFeelDefaultActionPerformed
+
+ private void jRadioButtonLookAndFeelNimbusActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jRadioButtonLookAndFeelNimbusActionPerformed
+ if (jRadioButtonLookAndFeelNimbus.isSelected()) {
+ log.info("setting Nimbus l&f");
+ setLookAndFeel("Nimbus");
+ }
+ }//GEN-LAST:event_jRadioButtonLookAndFeelNimbusActionPerformed
+
+ private void jRadioButtonMenuItemMetalActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jRadioButtonMenuItemMetalActionPerformed
+ if (jRadioButtonMenuItemMetal.isSelected()) {
+ log.info("setting Metal l&f");
+ setLookAndFeel("Metal");
+ }
+ }//GEN-LAST:event_jRadioButtonMenuItemMetalActionPerformed
+
+ private void jRadioButtonMenuItemMotifActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jRadioButtonMenuItemMotifActionPerformed
+ if (jRadioButtonMenuItemMotif.isSelected()) {
+ log.info("setting Motif l&f");
+ setLookAndFeel("Motif");
+ }
+ }//GEN-LAST:event_jRadioButtonMenuItemMotifActionPerformed
+
private void btnShowTransferManagerActionPerformed(
final java.awt.event.ActionEvent evt) {// GEN-FIRST:event_btnShowTransferManagerActionPerformed
@@ -1920,12 +2022,12 @@ public class iDrop extends javax.swing.JFrame implements ActionListener,
public void actionPerformed(final ActionEvent e) {
/*
getiDropCore().getPreferences().putBoolean("showGUI",
- showGUICheckBox.isSelected() ? true : false);
+ showGUICheckBox.isSelected() ? true : false);
* FIXME: recast as database options
*
*
*/
-
+
newPreferencesDialog.setVisible(false);
}
};
@@ -1977,7 +2079,7 @@ public class iDrop extends javax.swing.JFrame implements ActionListener,
private void jMenuItemExitActionPerformed(
final java.awt.event.ActionEvent evt) {// GEN-FIRST:event_jMenuItemExitActionPerformed
- shutdown();
+ shutdown();
}// GEN-LAST:event_jMenuItemExitActionPerformed
/**
@@ -2308,6 +2410,7 @@ public class iDrop extends javax.swing.JFrame implements ActionListener,
private javax.swing.JButton btnUpdateInfo;
private javax.swing.JButton btnViewMetadata;
private javax.swing.JButton btnearch;
+ private javax.swing.ButtonGroup buttonGroupLandF;
private javax.swing.JComboBox comboSearchType;
private javax.swing.JPanel iDropToolbar;
private javax.swing.JToolBar idropProgressPanelToolbar;
@@ -2318,7 +2421,14 @@ public class iDrop extends javax.swing.JFrame implements ActionListener,
private javax.swing.JMenu jMenuFile;
private javax.swing.JMenuItem jMenuItemClose;
private javax.swing.JMenuItem jMenuItemExit;
+ private javax.swing.JMenu jMenuLookAndFeel;
+ private javax.swing.JMenu jMenuTools;
private javax.swing.JMenu jMenuView;
+ private javax.swing.JRadioButtonMenuItem jRadioButtonLookAndFeelDefault;
+ private javax.swing.JRadioButtonMenuItem jRadioButtonLookAndFeelNimbus;
+ private javax.swing.JRadioButtonMenuItem jRadioButtonMenuItemGTK;
+ private javax.swing.JRadioButtonMenuItem jRadioButtonMenuItemMetal;
+ private javax.swing.JRadioButtonMenuItem jRadioButtonMenuItemMotif;
private javax.swing.JSplitPane jSplitPanelLocalRemote;
private javax.swing.JLabel lblComment;
private javax.swing.JLabel lblCurrentFile;
@@ -2400,6 +2510,7 @@ public class iDrop extends javax.swing.JFrame implements ActionListener,
private javax.swing.JTextField txtTags;
private javax.swing.JLabel userNameLabel;
// End of variables declaration//GEN-END:variables
+
public Object getLastCachedInfoItem() {
return lastCachedInfoItem;
}
@@ -2472,22 +2583,82 @@ public class iDrop extends javax.swing.JFrame implements ActionListener,
}
private void shutdown() {
- int result = JOptionPane.showConfirmDialog(this,
- "Shut down iDrop?",
- "Do you want to shut down iDrop?",
- JOptionPane.OK_CANCEL_OPTION);
- if (result == JOptionPane.OK_OPTION) {
+ int result = JOptionPane.showConfirmDialog(this,
+ "Shut down iDrop?",
+ "Do you want to shut down iDrop?",
+ JOptionPane.OK_CANCEL_OPTION);
+ if (result == JOptionPane.OK_OPTION) {
try {
log.info("shut down queue timer");
- getiDropCore().getQueueTimer().cancel();
+ iDropCore.getQueueTimer().cancel();
log.info("saving current configuration to idrop.properties");
iDropCore.getIdropConfigurationService().saveConfigurationToPropertiesFile();
log.info("properties saved");
} catch (IdropException ex) {
Exceptions.printStackTrace(ex);
}
- System.exit(0);
+ System.exit(0);
+ }
+ }
+
+ private void setLookAndFeel(String lookAndFeelChoice) {
+ String lookAndFeel = "";
+ if (lookAndFeelChoice != null) {
+ if (lookAndFeelChoice.equals("Metal")) {
+ lookAndFeel = UIManager.getCrossPlatformLookAndFeelClassName();
+ // an alternative way to set the Metal L&F is to replace the
+ // previous line with:
+ // lookAndFeel = "javax.swing.plaf.metal.MetalLookAndFeel";
+
+ } else if (lookAndFeelChoice.equals("System")) {
+ lookAndFeel = UIManager.getSystemLookAndFeelClassName();
+ } else if (lookAndFeelChoice.equals("Motif")) {
+ lookAndFeel = "com.sun.java.swing.plaf.motif.MotifLookAndFeel";
+ } else if (lookAndFeelChoice.equals("GTK")) {
+ lookAndFeel = "com.sun.java.swing.plaf.gtk.GTKLookAndFeel";
+ } else if (lookAndFeelChoice.equals("Nimbus")) {
+ for (LookAndFeelInfo info : UIManager.getInstalledLookAndFeels()) {
+ if ("Nimbus".equals(info.getName())) {
+ lookAndFeel = info.getClassName();
+ break;
+ }
}
+ } else {
+ lookAndFeel = UIManager.getCrossPlatformLookAndFeelClassName();
+ }
+
+ if (lookAndFeel.equals("")) {
+ lookAndFeel = UIManager.getCrossPlatformLookAndFeelClassName();
+
+ }
+
+
+ final String finalLookAndFeel = lookAndFeel;
+ final iDrop thisGui = this;
+
+
+
+ java.awt.EventQueue.invokeLater(new Runnable() {
+
+ @Override
+ public void run() {
+
+ try {
+ UIManager.setLookAndFeel(finalLookAndFeel);
+ //thisGui.getIrodsTree().updateUI();
+ SwingUtilities.updateComponentTreeUI(thisGui);
+ thisGui.irodsTree = null;
+ thisGui.buildTargetTree();
+ thisGui.pack();
+
+ } catch (Exception e) {
+ log.warn("unable to set look and feel to :{}", finalLookAndFeel);
+ }
+ }
+ });
+
+
+ }
}
class PopupListener extends MouseAdapter {