JAL-3446 unused imports removed
[jalview.git] / src / jalview / gui / WsPreferences.java
index 850ef21..8b5e664 100644 (file)
  */
 package jalview.gui;
 
-import jalview.bin.Cache;
-import jalview.jbgui.GWsPreferences;
-import jalview.util.MessageManager;
-import jalview.ws.jws2.Jws2Discoverer;
-import jalview.ws.rest.RestServiceDescription;
-
 import java.awt.BorderLayout;
 import java.awt.Color;
 import java.awt.Component;
@@ -37,13 +31,18 @@ import java.util.List;
 import java.util.Vector;
 
 import javax.swing.JLabel;
-import javax.swing.JOptionPane;
 import javax.swing.JPanel;
 import javax.swing.JTable;
 import javax.swing.JTextField;
 import javax.swing.table.AbstractTableModel;
 import javax.swing.table.TableCellRenderer;
 
+import jalview.bin.Cache;
+import jalview.jbgui.GWsPreferences;
+import jalview.util.MessageManager;
+import jalview.ws.jws2.Jws2Discoverer;
+import jalview.ws.rest.RestServiceDescription;
+
 public class WsPreferences extends GWsPreferences
 {
 
@@ -65,7 +64,7 @@ public class WsPreferences extends GWsPreferences
   private void initFromPreferences()
   {
 
-    wsUrls = Jws2Discoverer.getDiscoverer().getServiceUrls();
+    wsUrls = Jws2Discoverer.getInstance().getServiceUrls();
     if (!wsUrls.isEmpty())
     {
       oldUrls = new Vector<String>(wsUrls);
@@ -122,8 +121,8 @@ public class WsPreferences extends GWsPreferences
     int r = 0;
     for (String url : wsUrls)
     {
-      int status = Jws2Discoverer.getDiscoverer().getServerStatusFor(url);
-      tdat[r][1] = new Integer(status);
+      int status = Jws2Discoverer.getInstance().getServerStatusFor(url);
+      tdat[r][1] = Integer.valueOf(status);
       tdat[r++][0] = url;
     }
 
@@ -241,7 +240,7 @@ public class WsPreferences extends GWsPreferences
 
   private void updateServiceList()
   {
-    Jws2Discoverer.getDiscoverer().setServiceUrls(wsUrls);
+    Jws2Discoverer.getInstance().setServiceUrls(wsUrls);
   }
 
   private void updateRsbsServiceList()
@@ -454,7 +453,7 @@ public class WsPreferences extends GWsPreferences
     boolean valid = false;
     int resp = JvOptionPane.CANCEL_OPTION;
     while (!valid && (resp = JvOptionPane.showInternalConfirmDialog(
-            Desktop.desktop, panel, title,
+            Desktop.getDesktopPane(), panel, title,
             JvOptionPane.OK_CANCEL_OPTION)) == JvOptionPane.OK_OPTION)
     {
       try
@@ -472,13 +471,13 @@ public class WsPreferences extends GWsPreferences
       } catch (Exception e)
       {
         valid = false;
-        JvOptionPane.showInternalMessageDialog(Desktop.desktop,
+        JvOptionPane.showInternalMessageDialog(Desktop.getDesktopPane(),
                 MessageManager.getString("label.invalid_url"));
       }
     }
     if (valid && resp == JvOptionPane.OK_OPTION)
     {
-      int validate = JvOptionPane.showInternalConfirmDialog(Desktop.desktop,
+      int validate = JvOptionPane.showInternalConfirmDialog(Desktop.getDesktopPane(),
               MessageManager.getString("info.validate_jabaws_server"),
               MessageManager.getString("label.test_server"),
               JvOptionPane.YES_NO_OPTION);
@@ -491,7 +490,7 @@ public class WsPreferences extends GWsPreferences
         }
         else
         {
-          int opt = JvOptionPane.showInternalOptionDialog(Desktop.desktop,
+          int opt = JvOptionPane.showInternalOptionDialog(Desktop.getDesktopPane(),
                   "The Server  '" + foo.toString()
                           + "' failed validation,\ndo you want to add it anyway? ",
                   "Server Validation Failed", JvOptionPane.YES_NO_OPTION,
@@ -502,7 +501,7 @@ public class WsPreferences extends GWsPreferences
           }
           else
           {
-            JvOptionPane.showInternalMessageDialog(Desktop.desktop,
+            JvOptionPane.showInternalMessageDialog(Desktop.getDesktopPane(),
                     MessageManager.getString(
                             "warn.server_didnt_pass_validation"));
           }
@@ -595,7 +594,7 @@ public class WsPreferences extends GWsPreferences
           if (lastrefresh != update)
           {
             lastrefresh = update;
-            Desktop.instance.startServiceDiscovery(true); // wait around for all
+            Desktop.getInstance().startServiceDiscovery(true); // wait around for all
                                                           // threads to complete
             updateList();
 
@@ -616,15 +615,15 @@ public class WsPreferences extends GWsPreferences
         public void run()
         {
           long ct = System.currentTimeMillis();
-          Desktop.instance.setProgressBar(MessageManager
+          Desktop.getInstance().setProgressBar(MessageManager
                   .getString("status.refreshing_web_service_menus"), ct);
           if (lastrefresh != update)
           {
             lastrefresh = update;
-            Desktop.instance.startServiceDiscovery(true);
+            Desktop.getInstance().startServiceDiscovery(true);
             updateList();
           }
-          Desktop.instance.setProgressBar(null, ct);
+          Desktop.getInstance().setProgressBar(null, ct);
         }
 
       }).start();
@@ -646,8 +645,8 @@ public class WsPreferences extends GWsPreferences
   @Override
   protected void resetWs_actionPerformed(ActionEvent e)
   {
-    Jws2Discoverer.getDiscoverer().setServiceUrls(null);
-    List<String> nwsUrls = Jws2Discoverer.getDiscoverer().getServiceUrls();
+    Jws2Discoverer.getInstance().setServiceUrls(null);
+    List<String> nwsUrls = Jws2Discoverer.getInstance().getServiceUrls();
     if (!wsUrls.equals(nwsUrls))
     {
       update++;