JAL-1193 ensure the 'loadedComplete' method gets called for all views
authorjprocter <jprocter@compbio.dundee.ac.uk>
Thu, 8 Nov 2012 17:45:43 +0000 (17:45 +0000)
committerjprocter <jprocter@compbio.dundee.ac.uk>
Thu, 8 Nov 2012 17:45:43 +0000 (17:45 +0000)
after the views have been opened by using the Swing stack as a queue

src/jalview/gui/Jalview2XML.java

index 3459fc8..e88b190 100644 (file)
@@ -1678,12 +1678,27 @@ public class Jalview2XML
 
       jarInputStreamProvider jprovider = createjarInputStreamProvider(file);
       af = LoadJalviewAlign(jprovider);
-      setLoadingFinishedForNewStructureViewers();
+      
     } catch (MalformedURLException e)
     {
       errorMessage = "Invalid URL format for '" + file + "'";
       reportErrors();
     }
+    finally {
+      try
+      {
+        SwingUtilities.invokeAndWait(new Runnable()
+        {
+          public void run()
+          {
+            setLoadingFinishedForNewStructureViewers();
+          };
+        });
+      } catch (Exception x)
+      {
+
+      }
+    }
     return af;
   }