From: amwaterhouse Date: Mon, 30 Oct 2006 16:30:57 +0000 (+0000) Subject: conservation lock X-Git-Tag: Release_2_2~198 X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=687c2f9012922fb62852d8cc55254a8bd5ca2ac0;p=jalview.git conservation lock --- diff --git a/src/jalview/gui/AlignViewport.java b/src/jalview/gui/AlignViewport.java index 0519569..7c3279e 100755 --- a/src/jalview/gui/AlignViewport.java +++ b/src/jalview/gui/AlignViewport.java @@ -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; } } /**