JAL-1821 JAL-1759 make sure we wait around until the current script has finished...
authorJim Procter <jprocter@issues.jalview.org>
Wed, 5 Aug 2015 17:05:08 +0000 (18:05 +0100)
committerJim Procter <jprocter@issues.jalview.org>
Wed, 5 Aug 2015 17:05:08 +0000 (18:05 +0100)
src/jalview/gui/AppJmol.java

index a16ea68..7876346 100644 (file)
@@ -748,8 +748,22 @@ public class AppJmol extends StructureViewerBase
         {
           public void run()
           {
-            alignStructs_withAllAlignPanels();
-            // jmb.superposeStructures(ap.av.getAlignment(), -1, null);
+            if (jmb.viewer.isScriptExecuting())
+            {
+              javax.swing.SwingUtilities.invokeLater(this);
+              try
+              {
+                Thread.sleep(5);
+              } catch (InterruptedException q)
+              {
+              }
+              ;
+              return;
+            }
+            else
+            {
+              alignStructs_withAllAlignPanels();
+            }
           }
         });
         alignAddedStructures = false;