updated version to 2.6.1
[jalview.git] / src / jalview / gui / WebserviceInfo.java
index e0090be..cc76409 100755 (executable)
@@ -1,5 +1,5 @@
 /*
- * Jalview - A Sequence Alignment Editor and Viewer (Version 2.5)
+ * Jalview - A Sequence Alignment Editor and Viewer (Version 2.6.1)
  * Copyright (C) 2010 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
  * 
  * This file is part of Jalview.
@@ -232,20 +232,20 @@ public class WebserviceInfo extends GWebserviceInfo
     Thread thread = new Thread(ap);
     thread.start();
     final WebserviceInfo thisinfo = this;
-    frame
-            .addInternalFrameListener(new javax.swing.event.InternalFrameAdapter()
-            {
-              public void internalFrameClosed(
-                      javax.swing.event.InternalFrameEvent evt)
-              {
-                // System.out.println("Shutting down webservice client");
-                WSClientI service = thisinfo.getthisService();
-                if (service != null && service.isCancellable())
-                {
-                  service.cancelJob();
-                }
-              };
-            });
+    frame.addInternalFrameListener(new javax.swing.event.InternalFrameAdapter()
+    {
+      public void internalFrameClosed(
+              javax.swing.event.InternalFrameEvent evt)
+      {
+        // System.out.println("Shutting down webservice client");
+        WSClientI service = thisinfo.getthisService();
+        if (service != null && service.isCancellable())
+        {
+          service.cancelJob();
+        }
+      };
+    });
+    frame.validate();
 
   }
 
@@ -460,9 +460,8 @@ public class WebserviceInfo extends GWebserviceInfo
       // anyhow - it has to stop threads and clean up
       // JBPNote : TODO: Instead of a warning, we should have an optional 'Are
       // you sure?' prompt
-      JOptionPane.showInternalMessageDialog(Desktop.desktop,
-              "This job cannot be cancelled.\nJust close the window.",
-              "Cancel job", JOptionPane.WARNING_MESSAGE);
+      warnUser("This job cannot be cancelled.\nJust close the window.",
+              "Cancel job");
     }
     else
     {
@@ -472,6 +471,26 @@ public class WebserviceInfo extends GWebserviceInfo
   }
 
   /**
+   * Spawns a thread that pops up a warning dialog box with the given message
+   * and title.
+   * 
+   * @param message
+   * @param title
+   */
+  public void warnUser(final String message, final String title)
+  {
+    javax.swing.SwingUtilities.invokeLater(new Runnable()
+    {
+      public void run()
+      {
+        JOptionPane.showInternalMessageDialog(Desktop.desktop, message,
+                title, JOptionPane.WARNING_MESSAGE);
+
+      }
+    });
+  }
+
+  /**
    * Set up GUI for user to get at results - and possibly automatically display
    * them if viewResultsImmediatly is set.
    */