apply version 2.7 copyright
[jalview.git] / src / jalview / ws / jws2 / MsaWSClient.java
index f3c385a..4f6ce09 100644 (file)
@@ -1,6 +1,6 @@
 /*
- * Jalview - A Sequence Alignment Editor and Viewer (Version 2.6)
- * Copyright (C) 2010 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
+ * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
  * 
  * This file is part of Jalview.
  * 
@@ -50,7 +50,7 @@ public class MsaWSClient extends Jws2Client
 
   AlignFrame alignFrame;
 
-  private Preset preset;
+  private WsParamSetI preset;
 
   private List<Argument> paramset;
 
@@ -112,10 +112,11 @@ public class MsaWSClient extends Jws2Client
       return;
     }
     server = sh.service;
+    this.preset=preset;
     if (preset != null)
     {
-      if (preset instanceof JabaPreset)
-      {
+      if (!((preset instanceof JabaPreset) || preset instanceof JabaWsParamSet)) {
+      /*{
         this.preset = ((JabaPreset) preset).p;
       }
       else if (preset instanceof JabaWsParamSet)
@@ -137,7 +138,7 @@ public class MsaWSClient extends Jws2Client
         paramset = newargs;
       }
       else
-      {
+      {*/
         throw new Error(
                 "Implementation error: Can only instantiate Jaba parameter sets.");
       }
@@ -167,7 +168,7 @@ public class MsaWSClient extends Jws2Client
       }
       else
       {
-        this.preset = ((JabaPreset) prset).p;
+        this.preset = prset; // ((JabaPreset) prset).p;
         paramset = null; // no user supplied parameters.
       }
     }
@@ -274,18 +275,19 @@ public class MsaWSClient extends Jws2Client
     boolean hasparams = service.hasParameters();
     do
     {
-      String action="Align ";
+      String action = "Align ";
       if (submitGaps == true)
       {
-        action="Realign ";
+        action = "Realign ";
         msawsmenu = new JMenu("Realign with " + svcname);
-        msawsmenu.setToolTipText("Align sequences to an existing alignment");
+        msawsmenu
+                .setToolTipText("Align sequences to an existing alignment");
         rmsawsmenu.add(msawsmenu);
       }
       final boolean withGaps = submitGaps;
 
-      JMenuItem method = new JMenuItem(calcName + "Defaults");
-      method.setToolTipText(action+"with default settings");
+      JMenuItem method = new JMenuItem(calcName + "with Defaults");
+      method.setToolTipText(action + "with default settings");
 
       method.addActionListener(new ActionListener()
       {
@@ -301,8 +303,9 @@ public class MsaWSClient extends Jws2Client
       msawsmenu.add(method);
       if (hasparams)
       {
-        // only add these menu options if the service has user-modifiable arguments
-        method = new JMenuItem(calcName + "Edit and run ...");
+        // only add these menu options if the service has user-modifiable
+        // arguments
+        method = new JMenuItem("Edit settings and run ...");
         method.setToolTipText("View and change the parameters before alignment.");
 
         method.addActionListener(new ActionListener()
@@ -320,7 +323,7 @@ public class MsaWSClient extends Jws2Client
         List<WsParamSetI> presets = service.getParamStore().getPresets();
         if (presets != null && presets.size() > 0)
         {
-          JMenu presetlist = new JMenu(calcName + "Presets");
+          JMenu presetlist = new JMenu("Run "+calcName + "with preset");
 
           for (final WsParamSetI preset : presets)
           {