JAL-3690 patch out spinning animation for web service jobs
[jalview.git] / src / jalview / gui / WebserviceInfo.java
index 25ade21..b9b42dc 100644 (file)
@@ -22,6 +22,7 @@ package jalview.gui;
 
 import jalview.jbgui.GWebserviceInfo;
 import jalview.util.MessageManager;
+import jalview.util.Platform;
 import jalview.ws.WSClientI;
 
 import java.awt.BorderLayout;
@@ -259,6 +260,7 @@ public class WebserviceInfo extends GWebserviceInfo
   public WebserviceInfo(String title, String info, int width, int height,
           boolean makeVisible)
   {
+    // no references
     init(title, info, width, height, makeVisible);
   }
 
@@ -322,7 +324,7 @@ public class WebserviceInfo extends GWebserviceInfo
   {
     frame = new JInternalFrame();
     frame.setContentPane(this);
-    Desktop.addInternalFrame(frame, title, makeVisible, width, height);
+    Desktop.addInternalFrame(frame, title, makeVisible, width, height, Desktop.FRAME_ALLOW_RESIZE, Desktop.FRAME_SET_MIN_SIZE_300);
     frame.setClosable(false);
 
     progressBar = new ProgressBar(statusPanel, statusBar);
@@ -349,9 +351,12 @@ public class WebserviceInfo extends GWebserviceInfo
     titlePanel.add(ap, BorderLayout.WEST);
     titlePanel.add(titleText, BorderLayout.CENTER);
     setStatus(currentStatus);
-
-    Thread thread = new Thread(ap);
-    thread.start();
+    if (!Platform.isJS())
+    {
+      // No animation for the moment//
+      Thread thread = new Thread(ap);
+      thread.start();
+    }
     final WebserviceInfo thisinfo = this;
     frame.addInternalFrameListener(
             new InternalFrameAdapter()
@@ -746,7 +751,7 @@ public class WebserviceInfo extends GWebserviceInfo
       @Override
       public void run()
       {
-        JvOptionPane.showInternalMessageDialog(Desktop.desktop, message,
+        JvOptionPane.showInternalMessageDialog(Desktop.getDesktopPane(), message,
                 title, JvOptionPane.WARNING_MESSAGE);
 
       }
@@ -928,6 +933,12 @@ public void hyperlinkUpdate(HyperlinkEvent e)
   {
     progressBar.setProgressBar(message, id);
   }
+  
+  @Override
+  public void removeProgressBar(long id)
+  {
+    progressBar.removeProgressBar(id);
+  }
 
   @Override
   public void registerHandler(final long id,