JAL-1085 - ensure sequence fetching client waits around until feature retrieval has...
[jalview.git] / src / jalview / ws / DasSequenceFeatureFetcher.java
index 2a5476b..bef6425 100644 (file)
@@ -221,6 +221,7 @@ public class DasSequenceFeatureFetcher
   }\r
   private void _startFetching()\r
   {\r
+    running=true;\r
     new Thread(new FetchSeqFeatures()).start();\r
   }\r
   class FetchSeqFeatures implements Runnable\r
@@ -235,6 +236,7 @@ public class DasSequenceFeatureFetcher
   {\r
     public void run()\r
     {\r
+      running=true;\r
       new DBRefFetcher(sequences, af).fetchDBRefs(true);\r
       startFetching();\r
       setGuiFetchComplete();\r
@@ -246,6 +248,7 @@ public class DasSequenceFeatureFetcher
    */\r
   void startFetching()\r
   {\r
+    running=true;\r
     cancelled = false;\r
     startTime = System.currentTimeMillis();\r
     if (af != null)\r
@@ -546,10 +549,10 @@ public class DasSequenceFeatureFetcher
   }\r
 \r
   int sourcesRemaining = 0;\r
-\r
+  private boolean running=false;\r
   private void setGuiFetchComplete()\r
   {\r
-\r
+    running=false;\r
     if (!cancelled && af != null)\r
     {\r
       // only update the progress bar if we've completed the fetch normally\r
@@ -879,4 +882,9 @@ public class DasSequenceFeatureFetcher
     return type.getContent();\r
   }\r
 \r
+  public boolean isRunning()\r
+  {\r
+    return running;\r
+  }\r
+\r
 }\r