Java 1.5 bug note
authoramwaterhouse <Andrew Waterhouse>
Wed, 2 Nov 2005 16:56:37 +0000 (16:56 +0000)
committeramwaterhouse <Andrew Waterhouse>
Wed, 2 Nov 2005 16:56:37 +0000 (16:56 +0000)
src/jalview/io/SequenceFeatureFetcher.java
src/jalview/io/WSWUBlastClient.java

index 108fe08..2bfbfd9 100755 (executable)
@@ -57,7 +57,7 @@ public class SequenceFeatureFetcher implements Runnable
     {\r
       // 1. Load the mapping information from the file\r
       Mapping map = new Mapping(uni.getClass().getClassLoader());\r
-      java.net.URL url = uni.getClass().getResource("/uniprot_mapping.xml");\r
+      java.net.URL url = getClass().getResource("/uniprot_mapping.xml");\r
       map.loadMapping(url);\r
 \r
       // 2. Unmarshal the data\r
@@ -156,19 +156,29 @@ public class SequenceFeatureFetcher implements Runnable
 \r
     }\r
 \r
-    if (unknownSequences.size() > 0)\r
-    {\r
-      int reply = javax.swing.JOptionPane.showInternalConfirmDialog(\r
-          Desktop.desktop, "Couldn't find a match for "+unknownSequences.size()+" sequences."\r
-              +"\nPerform blast for unknown sequences?",\r
-                  "Blast for Unidentified Sequences",\r
-                   javax.swing.JOptionPane.YES_NO_OPTION, javax.swing.JOptionPane.QUESTION_MESSAGE);\r
-\r
-      if(reply == javax.swing.JOptionPane.YES_OPTION)\r
-       new WSWUBlastClient(ap, align, unknownSequences);\r
-    }\r
-    else\r
-       ((Alignment)dataset).featuresAdded = true;\r
+    promptBeforeBlast();\r
+\r
+  }\r
+\r
+\r
+  void promptBeforeBlast()\r
+   {\r
+     // This must be outside the run() body as java 1.5\r
+     // will not return any value from the OptionPane to the expired thread.\r
+      if (unknownSequences.size() > 0)\r
+      {\r
+        int reply = javax.swing.JOptionPane.showConfirmDialog(\r
+            Desktop.desktop, "Couldn't find a match for "+unknownSequences.size()+" sequences."\r
+                +"\nPerform blast for unknown sequences?",\r
+                    "Blast for Unidentified Sequences",\r
+                     javax.swing.JOptionPane.YES_NO_OPTION, javax.swing.JOptionPane.QUESTION_MESSAGE);\r
+\r
+        System.out.println("response ?? "+reply);\r
+        if(reply == javax.swing.JOptionPane.YES_OPTION)\r
+         new WSWUBlastClient(ap, align, unknownSequences);\r
+      }\r
+      else\r
+         ((Alignment)dataset).featuresAdded = true;\r
 \r
 \r
     ap.repaint();\r
index 36e5dfd..41729ce 100755 (executable)
@@ -141,6 +141,8 @@ public class WSWUBlastClient
 \r
     void updateIds()\r
     {\r
+        // This must be outside the run() body as java 1.5\r
+     // will not return any value from the OptionPane to the expired thread.\r
       int reply = JOptionPane.showConfirmDialog(\r
           Desktop.desktop, "Automatically update suggested ids?",\r
           "Auto replace sequence ids", JOptionPane.YES_NO_OPTION);\r