OptionPanes invokeLater
authoramwaterhouse <Andrew Waterhouse>
Thu, 17 Aug 2006 10:08:18 +0000 (10:08 +0000)
committeramwaterhouse <Andrew Waterhouse>
Thu, 17 Aug 2006 10:08:18 +0000 (10:08 +0000)
src/jalview/gui/Jalview2XML.java
src/jalview/gui/Jalview2XML_V1.java

index 1f2cbb1..b8466f0 100755 (executable)
@@ -765,7 +765,7 @@ public class Jalview2XML
      *\r
      * @param file DOCUMENT ME!\r
      */\r
-    public AlignFrame LoadJalviewAlign(String file)\r
+    public AlignFrame LoadJalviewAlign(final String file)\r
     {\r
         jalview.gui.AlignFrame af = null;\r
         try\r
@@ -820,22 +820,23 @@ public class Jalview2XML
         }\r
         catch(java.net.UnknownHostException ex)\r
         {\r
-          if (Desktop.instance != null)\r
-            Desktop.instance.stopLoading();\r
-\r
           ex.printStackTrace();\r
           System.err.println("Couldn't locate Jalview XML file : " +\r
               ex + "\n");\r
-           JOptionPane.showInternalMessageDialog(Desktop.desktop,\r
-                                    "Couldn't locate " + file,\r
-                                    "URL not found",\r
-                                    JOptionPane.WARNING_MESSAGE);\r
 \r
+          javax.swing.SwingUtilities.invokeLater(new Runnable()\r
+          {\r
+            public void run()\r
+            {\r
+              JOptionPane.showInternalMessageDialog(Desktop.desktop,\r
+                  "Couldn't locate " + file,\r
+                  "URL not found",\r
+                  JOptionPane.WARNING_MESSAGE);\r
+            }\r
+          });\r
         }\r
         catch (Exception ex)\r
         {\r
-          if (Desktop.instance != null)\r
-            Desktop.instance.stopLoading();\r
 \r
           //Is Version 1 Jar file?\r
           af =  new Jalview2XML_V1().LoadJalviewAlign(file);\r
@@ -848,11 +849,16 @@ public class Jalview2XML
           ex.printStackTrace();\r
             System.err.println("Exception whilst loading jalview XML file : " +\r
                 ex + "\n");\r
-             JOptionPane.showInternalMessageDialog(Desktop.desktop,\r
-                                      "Error loading  " + file,\r
-                                      "Error loading Jalview file",\r
-                                      JOptionPane.WARNING_MESSAGE);\r
+            javax.swing.SwingUtilities.invokeLater(new Runnable()\r
+            {\r
+              public void run()\r
+              {\r
 \r
+                JOptionPane.showInternalMessageDialog(Desktop.desktop,\r
+                    "Error loading  " + file,\r
+                    "Error loading Jalview file",\r
+                    JOptionPane.WARNING_MESSAGE);\r
+              }});\r
         }\r
 \r
         return af;\r
index bb5a1ac..d8dfe62 100755 (executable)
@@ -113,10 +113,8 @@ public class Jalview2XML_V1
                 for (int i = 0; i < entryCount; i++)\r
                 {\r
                     jarentry = jin.getNextJarEntry();\r
-\r
                   }\r
 \r
-\r
                   class NoDescIDResolver implements IDResolver\r
                   {\r
                     public Object resolve(String idref)\r