JAL-1620 version bump and release notes
[jalview.git] / src / jalview / ws / jws2 / MsaWSClient.java
index fd01777..49a3412 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Jalview - A Sequence Alignment Editor and Viewer (Version 2.8.2)
+ * Jalview - A Sequence Alignment Editor and Viewer (Version 2.8.2b1)
  * Copyright (C) 2014 The Jalview Authors
  * 
  * This file is part of Jalview.
@@ -127,8 +127,10 @@ public class MsaWSClient extends Jws2Client
 
       return;
     }
+
     startMsaWSClient(altitle, msa, submitGaps, preserveOrder, seqdataset);
 
+
   }
 
   public MsaWSClient()
@@ -172,10 +174,29 @@ public class MsaWSClient extends Jws2Client
     MsaWSThread msathread = new MsaWSThread(server, preset, paramset,
             WsURL, wsInfo, alignFrame, WebServiceName, jobtitle, msa,
             submitGaps, preserveOrder, seqdataset);
-    wsInfo.setthisService(msathread);
-    msathread.start();
+    if (msathread.hasValidInput())
+    {
+      wsInfo.setthisService(msathread);
+      wsInfo.setVisible(true);
+      msathread.start();
+    }
+    else
+    {
+      JOptionPane.showMessageDialog(alignFrame,
+              MessageManager.getString("info.invalid_msa_input_mininfo"),
+              MessageManager.getString("info.invalid_msa_notenough"),
+              JOptionPane.INFORMATION_MESSAGE);
+      wsInfo.setVisible(false);
+    }
   }
 
+  public static void main(String[] args)
+  {
+    System.out.println("A".matches("(-*[a-zA-Z]-*){1}[a-zA-Z-]*"));
+  }
+
+
+
   protected String getServiceActionKey()
   {
     return "MsaWS";
@@ -250,9 +271,13 @@ public class MsaWSClient extends Jws2Client
         public void actionPerformed(ActionEvent e)
         {
           AlignmentView msa = alignFrame.gatherSequencesForAlignment();
+
+          if (msa != null)
+          {
           new MsaWSClient(service, alignFrame.getTitle(), msa, withGaps,
                   true, alignFrame.getViewport().getAlignment()
                           .getDataset(), alignFrame);
+          }
 
         }
       });
@@ -271,9 +296,12 @@ public class MsaWSClient extends Jws2Client
           public void actionPerformed(ActionEvent e)
           {
             AlignmentView msa = alignFrame.gatherSequencesForAlignment();
-            new MsaWSClient(service, null, null, true, alignFrame
+            if (msa != null)
+            {
+              new MsaWSClient(service, null, null, true, alignFrame
                     .getTitle(), msa, withGaps, true, alignFrame
                     .getViewport().getAlignment().getDataset(), alignFrame);
+            }
 
           }
         });
@@ -289,17 +317,7 @@ public class MsaWSClient extends Jws2Client
                   .getDismissDelay();
           for (final WsParamSetI preset : presets)
           {
-            final JMenuItem methodR = new JMenuItem(preset.getName())
-            {
-              @Override
-              protected void finalize() throws Throwable
-              {
-                // failsafe to ensure tooltip hover time is restored
-                ToolTipManager.sharedInstance().setDismissDelay(
-                        showToolTipFor);
-                super.finalize();
-              }
-            };
+            final JMenuItem methodR = new JMenuItem(preset.getName());
             final int QUICK_TOOLTIP = 1500;
             // JAL-1582 shorten tooltip display time in these menu items as
             // they can obscure other options
@@ -334,9 +352,14 @@ public class MsaWSClient extends Jws2Client
               {
                 AlignmentView msa = alignFrame
                         .gatherSequencesForAlignment();
-                new MsaWSClient(service, preset, alignFrame.getTitle(),
+
+                if (msa != null)
+                {
+                  MsaWSClient msac = new MsaWSClient(service, preset,
+                          alignFrame.getTitle(),
                         msa, false, true, alignFrame.getViewport()
                                 .getAlignment().getDataset(), alignFrame);
+                }
 
               }