conservation lock
authoramwaterhouse <Andrew Waterhouse>
Mon, 30 Oct 2006 16:30:57 +0000 (16:30 +0000)
committeramwaterhouse <Andrew Waterhouse>
Mon, 30 Oct 2006 16:30:57 +0000 (16:30 +0000)
src/jalview/gui/AlignViewport.java

index 0519569..7c3279e 100755 (executable)
@@ -264,10 +264,16 @@ public class AlignViewport
       {
         try
         {
-          while (updatingConservation)
+          updatingConservation = true;
+
+          while (UPDATING_CONSERVATION)
           {
             try
             {
+              if (ap != null)
+              {
+                ap.repaint();
+              }
               Thread.sleep(200);
             }
             catch (Exception ex)
@@ -276,7 +282,7 @@ public class AlignViewport
             }
           }
 
-          updatingConservation = true;
+          UPDATING_CONSERVATION = true;
 
 
           int alWidth = alignment.getWidth();
@@ -387,11 +393,14 @@ public class AlignViewport
 
         }
 
+        UPDATING_CONSERVATION = false;
+        updatingConservation = false;
+
         if(ap!=null)
         {
           ap.repaint();
         }
-        updatingConservation = false;
+
       }
     }
 
@@ -402,9 +411,13 @@ public class AlignViewport
 
     boolean consUpdateNeeded = false;
 
-    static boolean updatingConsensus = false;
+    static boolean UPDATING_CONSENSUS = false;
+
+    static boolean UPDATING_CONSERVATION = false;
 
-    static boolean updatingConservation = false;
+    boolean updatingConsensus = false;
+
+    boolean updatingConservation = false;
 
     /**
      * DOCUMENT ME!
@@ -437,10 +450,16 @@ public class AlignViewport
       }
       public void run()
       {
-        while (updatingConsensus)
+        updatingConsensus = true;
+        while (UPDATING_CONSENSUS)
         {
           try
           {
+            if (ap != null)
+            {
+              ap.repaint();
+            }
+
             Thread.sleep(200);
           }
           catch (Exception ex)
@@ -449,7 +468,8 @@ public class AlignViewport
           }
         }
 
-        updatingConsensus = true;
+
+        UPDATING_CONSENSUS = true;
 
         try
         {
@@ -517,14 +537,13 @@ public class AlignViewport
           System.out.println("Consensus calculation: " + error);
           System.gc();
         }
+        UPDATING_CONSENSUS = false;
+        updatingConsensus = false;
 
         if (ap != null)
         {
           ap.repaint();
         }
-
-
-        updatingConsensus = false;
       }
     }
     /**