JAL-2890 added constructor that includes tool name & simplified others
authorkjvdheide <kjvanderheide@dundee.ac.uk>
Thu, 1 Feb 2018 16:58:14 +0000 (16:58 +0000)
committerkjvdheide <kjvanderheide@dundee.ac.uk>
Thu, 1 Feb 2018 16:58:14 +0000 (16:58 +0000)
src/jalview/ext/cipres/TreeJob.java

index 5955c36..6ad8033 100644 (file)
@@ -18,7 +18,7 @@ public class TreeJob
 
   private final CiApplication app = CiApplication.getInstance();
 
-  private String toolName;
+  private String tool;
 
   private Map<String, Collection<String>> vParams = new HashMap<>();
 
@@ -39,13 +39,18 @@ public class TreeJob
 
   public TreeJob(String alignmentFilePath)
   {
-    cipresClient = new CiClient(
-            app.getAppKey(), app.getUsername(), app.getPassword(),
-            app.getRestUrl()
-    );
+    this();
     inputParams.put("infile_", alignmentFilePath);
   }
 
+  public TreeJob(String alignmentFilePath, String toolName)
+  {
+    this(alignmentFilePath);
+    tool = toolName;
+  }
+
+
+
 
 
   /**
@@ -115,12 +120,18 @@ public class TreeJob
 
   public String getTool()
   {
-    return toolName;
+    return tool;
   }
 
   public void setTool(String toolName)
   {
-    this.toolName = toolName;
+
+    if (!(this.tool.equals(toolName)))
+    {
+      this.tool = toolName;
+      paramsValidated = false;
+    }
+
   }
 
   /**