hack to completely disable calculation of consensus and conservation if autocalculate...
authorjprocter <Jim Procter>
Fri, 9 Jan 2009 15:11:33 +0000 (15:11 +0000)
committerjprocter <Jim Procter>
Fri, 9 Jan 2009 15:11:33 +0000 (15:11 +0000)
src/jalview/gui/AlignViewport.java

index 587ce55..0536f8d 100755 (executable)
@@ -342,7 +342,7 @@ public class AlignViewport implements SelectionSource
           alignment.addAnnotation(quality);
         }
       }
-
+      // TODO: add menu option action that nulls or creates consensus object depending on if the user wants to see the annotation or not in a specific alignment
       consensus = new AlignmentAnnotation("Consensus", "PID",
               new Annotation[1], 0f, 100f, AlignmentAnnotation.BAR_GRAPH);
       consensus.hasText = true;
@@ -560,7 +560,8 @@ public class AlignViewport implements SelectionSource
    */
   public void updateConservation(final AlignmentPanel ap)
   {
-    if (alignment.isNucleotide() || conservation == null)
+    // see note in mantis : issue number 8585
+    if (alignment.isNucleotide() || conservation == null || !autoCalculateConsensus)
     {
       return;
     }
@@ -574,6 +575,11 @@ public class AlignViewport implements SelectionSource
    */
   public void updateConsensus(final AlignmentPanel ap)
   {
+    // see note in mantis : issue number 8585
+    if (consensus == null || !autoCalculateConsensus)
+    {
+      return;
+    }
     consensusThread = new ConsensusThread(ap);
     consensusThread.start();
   }
@@ -1883,9 +1889,12 @@ public class AlignViewport implements SelectionSource
     }
     if (hconsensus != null && autoCalculateConsensus)
     {
-      updateConsensus(ap);
       updateConservation(ap);
     }
+    if (autoCalculateConsensus)
+    {
+      updateConsensus(ap);
+    }
 
     // Reset endRes of groups if beyond alignment width
     int alWidth = alignment.getWidth();