JAL-1807 explicit imports (jalview.ws.*)
[jalview.git] / src / jalview / ws / rest / RestClient.java
index 1acecb4..9032823 100644 (file)
@@ -1,6 +1,6 @@
 /*
- * Jalview - A Sequence Alignment Editor and Viewer (Version 2.8.2)
- * Copyright (C) 2014 The Jalview Authors
+ * Jalview - A Sequence Alignment Editor and Viewer ($$Version-Rel$$)
+ * Copyright (C) $$Year-Rel$$ The Jalview Authors
  * 
  * This file is part of Jalview.
  * 
@@ -28,10 +28,14 @@ import jalview.gui.AlignmentPanel;
 import jalview.gui.Desktop;
 import jalview.gui.WebserviceInfo;
 import jalview.io.packed.DataProvider.JvDataType;
+import jalview.io.packed.JalviewDataset;
 import jalview.util.MessageManager;
 import jalview.ws.WSClient;
 import jalview.ws.WSClientI;
 import jalview.ws.WSMenuEntryProviderI;
+import jalview.ws.rest.params.Alignment;
+import jalview.ws.rest.params.JobConstant;
+import jalview.ws.rest.params.SeqGroupIndexVector;
 
 import java.awt.event.ActionEvent;
 import java.awt.event.ActionListener;
@@ -75,7 +79,7 @@ public class RestClient extends WSClient implements WSClientI,
    */
   protected AlignFrame recoverAlignFrameForView()
   {
-    return jalview.gui.Desktop.getAlignFrameFor(av);
+    return Desktop.getAlignFrameFor(av);
   }
 
   public RestClient(RestServiceDescription service2, AlignFrame alignFrame)
@@ -107,7 +111,7 @@ public class RestClient extends WSClient implements WSClientI,
     if (!headless)
     {
       wsInfo = new WebserviceInfo(WebServiceJobTitle, WebServiceName + "\n"
-              + WebServiceReference);
+              + WebServiceReference, true);
       wsInfo.setRenderAsHtml(true);
     }
 
@@ -224,7 +228,7 @@ public class RestClient extends WSClient implements WSClientI,
   /**
    * input data context
    */
-  jalview.io.packed.JalviewDataset jds;
+  JalviewDataset jds;
 
   /**
    * informative name for results
@@ -316,7 +320,7 @@ public class RestClient extends WSClient implements WSClientI,
   {
     String action = "Analysis", description = "Sequence Harmony and Multi-Relief (Brandt et al. 2010)", name = MessageManager.getString("label.multiharmony");
     Hashtable<String, InputType> iparams = new Hashtable<String, InputType>();
-    jalview.ws.rest.params.JobConstant toolp;
+    JobConstant toolp;
     // toolp = new jalview.ws.rest.JobConstant("tool","jalview");
     // iparams.put(toolp.token, toolp);
     // toolp = new jalview.ws.rest.params.JobConstant("mbjob[method]","shmr");
@@ -329,13 +333,13 @@ public class RestClient extends WSClient implements WSClientI,
     // toolp = new jalview.ws.rest.params.JobConstant("blast","0");
     // iparams.put(toolp.token, toolp);
 
-    jalview.ws.rest.params.Alignment aliinput = new jalview.ws.rest.params.Alignment();
+    Alignment aliinput = new Alignment();
     // SHMR server has a 65K limit for content pasted into the 'ali' parameter,
     // so we always upload our files.
     aliinput.token = "ali_file";
     aliinput.writeAsFile = true;
     iparams.put(aliinput.token, aliinput);
-    jalview.ws.rest.params.SeqGroupIndexVector sgroups = new jalview.ws.rest.params.SeqGroupIndexVector();
+    SeqGroupIndexVector sgroups = new SeqGroupIndexVector();
     sgroups.setMinsize(2);
     sgroups.min = 2;// need at least two group defined to make a partition
     iparams.put("groups", sgroups);
@@ -384,7 +388,7 @@ public class RestClient extends WSClient implements WSClientI,
       try
       {
         for (RestServiceDescription descr : RestServiceDescription
-                .parseDescriptions(jalview.bin.Cache.getDefault(
+                .parseDescriptions(Cache.getDefault(
                         RSBS_SERVICES,
                         makeShmmrRestClient().service.toString())))
         {
@@ -407,33 +411,6 @@ public class RestClient extends WSClient implements WSClientI,
     return lst;
   }
 
-  public static void main(String args[])
-  {
-    try
-    {
-      RestClient[] clients = getRestClients();
-      System.out.println("Got " + clients.length + " clients.");
-      int i = 0;
-      Vector<String> urls = new Vector<String>();
-      for (RestClient cl : clients)
-      {
-        System.out.println("" + (++i) + ": " + cl.service.toString());
-        urls.add(cl.service.toString());
-      }
-      setRsbsServices(urls);
-      if (clients.length != getRestClients().length)
-      {
-        System.err
-                .println("Failed. Differing numbers of clients when stringified and parsed again.");
-      }
-
-    } catch (Throwable x)
-    {
-      System.err.println("Failed. Unexpected exception.");
-      x.printStackTrace();
-    }
-  }
-
   public String getAction()
   {
     return service.details.Action;