JAL-3070 pull up sequence anonymisation hash, presets and params list.
[jalview.git] / src / jalview / ws / jws2 / MsaWSThread.java
index c4fc66b..b1d6452 100644 (file)
@@ -38,12 +38,11 @@ import jalview.ws.AWsJob;
 import jalview.ws.JobStateSummary;
 import jalview.ws.WSClientI;
 import jalview.ws.jws2.dm.JabaWsParamSet;
+import jalview.ws.params.ArgumentI;
 import jalview.ws.params.WsParamSetI;
 
 import java.util.ArrayList;
-import java.util.Hashtable;
 import java.util.List;
-import java.util.Map;
 import java.util.Vector;
 
 import javax.swing.JInternalFrame;
@@ -68,10 +67,6 @@ class MsaWSThread extends AWS2Thread implements WSClientI
   {
     long lastChunk = 0;
 
-    WsParamSetI preset = null;
-
-    List<Argument> arguments = null;
-
     /**
      * input
      */
@@ -106,8 +101,6 @@ class MsaWSThread extends AWS2Thread implements WSClientI
 
     }
 
-    Hashtable<String, Map> SeqNames = new Hashtable();
-
     Vector<String[]> emptySeqs = new Vector();
 
     /**
@@ -385,7 +378,7 @@ class MsaWSThread extends AWS2Thread implements WSClientI
       }
       if (arguments != null && arguments.size() > 0)
       {
-        newargs.addAll(arguments);
+        newargs.addAll(JabaParamStore.getJabafromJwsArgs(arguments));
       }
       return newargs;
     }
@@ -402,7 +395,7 @@ class MsaWSThread extends AWS2Thread implements WSClientI
                 + "Preset: " + preset.getName());
         if (preset instanceof JabaWsParamSet)
         {
-          for (Argument opt : ((JabaWsParamSet) preset).getjabaArguments())
+          for (Argument opt : getJabaArguments())
           {
             jobProgress.append(
                     opt.getName() + " " + opt.getDefaultValue() + "\n");
@@ -413,7 +406,7 @@ class MsaWSThread extends AWS2Thread implements WSClientI
       {
         jobProgress.append("With custom parameters : \n");
         // merge arguments with preset's own arguments.
-        for (Argument opt : arguments)
+        for (Argument opt : getJabaArguments())
         {
           jobProgress.append(
                   opt.getName() + " " + opt.getDefaultValue() + "\n");
@@ -474,7 +467,7 @@ class MsaWSThread extends AWS2Thread implements WSClientI
    * @param seqset
    *          Alignment
    */
-  MsaWSThread(MsaWS server2, WsParamSetI preset, List<Argument> paramset,
+  MsaWSThread(MsaWS server2, WsParamSetI preset, List<ArgumentI> paramset,
           String wsUrl, WebserviceInfo wsinfo,
           jalview.gui.AlignFrame alFrame, String wsname, String title,
           AlignmentView _msa, boolean subgaps, boolean presorder,
@@ -489,7 +482,7 @@ class MsaWSThread extends AWS2Thread implements WSClientI
     if (conmsa != null)
     {
       int nvalid = 0, njobs = conmsa.length;
-      jobs = new MsaWSJob[njobs];
+      jobs = new AWsJob[njobs];
       for (int j = 0; j < njobs; j++)
       {
         if (j != 0)
@@ -500,12 +493,12 @@ class MsaWSThread extends AWS2Thread implements WSClientI
         {
           jobs[j] = new MsaWSJob(0, conmsa[j]);
         }
-        if (((MsaWSJob) jobs[j]).hasValidInput())
+        if (jobs[j].hasValidInput())
         {
           nvalid++;
         }
-        ((MsaWSJob) jobs[j]).preset = preset;
-        ((MsaWSJob) jobs[j]).arguments = paramset;
+        jobs[j].setPreset(preset);
+        jobs[j].setArguments(paramset);
         ((MsaWSJob) jobs[j]).alignmentProgram = wsname;
         if (njobs > 0)
         {