From 94fdc0bf7dfe9639a0eb8c53313f873b66f98eba Mon Sep 17 00:00:00 2001 From: jprocter Date: Fri, 9 Jan 2009 15:11:33 +0000 Subject: [PATCH] hack to completely disable calculation of consensus and conservation if autocalculate is not enabled --- src/jalview/gui/AlignViewport.java | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/src/jalview/gui/AlignViewport.java b/src/jalview/gui/AlignViewport.java index 587ce55..0536f8d 100755 --- a/src/jalview/gui/AlignViewport.java +++ b/src/jalview/gui/AlignViewport.java @@ -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(); -- 1.7.10.2