JAL-1503 update version in GPL header
[jalview.git] / src / jalview / ws / jws2 / Jws2Client.java
index e6b4cf5..fa43e7c 100644 (file)
@@ -1,19 +1,20 @@
 /*
- * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
+ * Jalview - A Sequence Alignment Editor and Viewer (Version 2.8.1)
+ * Copyright (C) 2014 The Jalview Authors
  * 
  * This file is part of Jalview.
  * 
  * Jalview is free software: you can redistribute it and/or
  * modify it under the terms of the GNU General Public License 
  * as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
- * 
+ *  
  * Jalview is distributed in the hope that it will be useful, but 
  * WITHOUT ANY WARRANTY; without even the implied warranty 
  * of MERCHANTABILITY or FITNESS FOR A PARTICULAR 
  * PURPOSE.  See the GNU General Public License for more details.
  * 
  * You should have received a copy of the GNU General Public License along with Jalview.  If not, see <http://www.gnu.org/licenses/>.
+ * The Jalview Authors are detailed in the 'AUTHORS' file.
  */
 package jalview.ws.jws2;
 
@@ -27,6 +28,7 @@ import jalview.gui.AlignFrame;
 import jalview.gui.Desktop;
 import jalview.gui.WebserviceInfo;
 import jalview.gui.WsJobParameters;
+import jalview.util.MessageManager;
 import jalview.ws.jws2.dm.JabaWsParamSet;
 import jalview.ws.jws2.jabaws2.Jws2Instance;
 import jalview.ws.params.WsParamSetI;
@@ -45,8 +47,8 @@ public abstract class Jws2Client extends jalview.ws.WSClient
 
   protected List<Argument> paramset;
 
-  public Jws2Client(AlignFrame _alignFrame,
-          WsParamSetI preset, List<Argument> arguments)
+  public Jws2Client(AlignFrame _alignFrame, WsParamSetI preset,
+          List<Argument> arguments)
   {
     alignFrame = _alignFrame;
     this.preset = preset;
@@ -78,6 +80,7 @@ public abstract class Jws2Client extends jalview.ws.WSClient
   {
     return processParams(sh, editParams, false);
   }
+
   protected boolean processParams(Jws2Instance sh, boolean editParams,
           boolean adjustingExisting)
   {
@@ -89,10 +92,12 @@ public abstract class Jws2Client extends jalview.ws.WSClient
         sh.paramStore = new JabaParamStore(sh,
                 Desktop.getUserParameterStore());
       }
-      WsJobParameters jobParams = new WsJobParameters(sh, preset);
+      WsJobParameters jobParams = (preset == null && paramset != null && paramset
+              .size() > 0) ? new WsJobParameters(null, sh, null, paramset)
+              : new WsJobParameters(sh, preset);
       if (adjustingExisting)
       {
-        jobParams.setName("Adjusting parameters for existing Calculation");
+        jobParams.setName(MessageManager.getString("label.adjusting_parameters_for_calculation"));
       }
       if (!jobParams.showRunDialog())
       {
@@ -101,8 +106,9 @@ public abstract class Jws2Client extends jalview.ws.WSClient
       WsParamSetI prset = jobParams.getPreset();
       if (prset == null)
       {
-        paramset = JabaParamStore.getJabafromJwsArgs(jobParams
-                .getJobParams());
+        paramset = jobParams.isServiceDefaults() ? null : JabaParamStore
+                .getJabafromJwsArgs(jobParams.getJobParams());
+        this.preset = null;
       }
       else
       {