JAL-1432 updated copyright notices
[jalview.git] / src / jalview / gui / WsJobParameters.java
index 2266bf8..7c665a3 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.0b1)
+ * 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.gui;
 
@@ -566,14 +567,27 @@ public class WsJobParameters extends JPanel implements ItemListener,
   @SuppressWarnings("unchecked")
   private void updateTable(WsParamSetI p, List<ArgumentI> jobArgset)
   {
+    boolean setDefaultParams=false;
+    if (lastParmSet == null)
+    {
+      isUserPreset = false;
+      // First call - so provide Service default settings
+      setName.setSelectedItem(lastSetName = SVC_DEF);
+    }
+    if (p==null && SVC_DEF.equals(""+setName.getSelectedItem()))
+    {
+      // indicate that service defaults should be set if available
+      setDefaultParams=true;
+    }
     // populate table from default parameter set.
     List<ArgumentI> args = paramStore.getServiceParameters();
 
     // split to params and required arguments
     {
       int cw = 0;
+      boolean optset=false;
       for (ArgumentI myarg : args)
-      {
+      { 
         // Ideally, Argument would implement isRequired !
         if (myarg instanceof ParameterI)
         {
@@ -586,7 +600,7 @@ public class WsJobParameters extends JPanel implements ItemListener,
           {
             OptionI opt = (OptionI) myarg;
             OptionBox ob = opanp.addOption(opt);
-            ob.resetToDefault();
+            ob.resetToDefault(setDefaultParams);
             if (MAX_OPTWIDTH < ob.getPreferredSize().width)
             {
               MAX_OPTWIDTH = ob.getPreferredSize().width;
@@ -620,16 +634,6 @@ public class WsJobParameters extends JPanel implements ItemListener,
       // TODO: check if args should be unselected prior to resetting using the
       // preset
     }
-    else
-    {
-      if (lastParmSet == null)
-      {
-        isUserPreset = false;
-        // first call - so create a dummy name
-
-        setName.setSelectedItem(lastSetName = SVC_DEF);
-      }
-    }
 
     if (jobArgset != null)
     {