X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fjalview%2Fgui%2FAlignViewport.java;fp=src%2Fjalview%2Fgui%2FAlignViewport.java;h=80b3134369befaaefb97f5cfc5dc4a30c655f102;hb=a474ac9fbd7de4a6e77b3c445ea0205d3854af0f;hp=a44afa372af83745880ba19391ad06a606d8b2e6;hpb=05a1420df55d0f180ce3c0337133e9be98a643b7;p=jalview.git diff --git a/src/jalview/gui/AlignViewport.java b/src/jalview/gui/AlignViewport.java index a44afa3..80b3134 100755 --- a/src/jalview/gui/AlignViewport.java +++ b/src/jalview/gui/AlignViewport.java @@ -478,11 +478,6 @@ public class AlignViewport implements SelectionSource private boolean shownpfeats; /** - * consensus annotation includes all percentage for all symbols in column - */ - private boolean includeAllConsensusSymbols = true; - - /** * trigger update of conservation annotation */ public void updateConservation(final AlignmentPanel ap) @@ -558,10 +553,8 @@ public class AlignViewport implements SelectionSource hconsensus = new Hashtable[aWidth]; AAFrequency.calculate(alignment.getSequencesArray(), 0, alignment - .getWidth(), hconsensus, includeAllConsensusSymbols); - AAFrequency.completeConsensus(consensus, hconsensus, 0, aWidth, - ignoreGapsInConsensusCalculation, - includeAllConsensusSymbols); + .getWidth(), hconsensus, true); + updateAnnotation(true); if (globalColourScheme != null) { @@ -584,6 +577,26 @@ public class AlignViewport implements SelectionSource ap.paintAlignment(true); } } + + /** + * update the consensus annotation from the sequence profile data using + * current visualization settings. + */ + public void updateAnnotation() + { + updateAnnotation(false); + } + + protected void updateAnnotation(boolean immediate) + { + if (immediate + || (!updatingConsensus && consensus != null && hconsensus != null)) + { + AAFrequency.completeConsensus(consensus, hconsensus, 0, + hconsensus.length, ignoreGapsInConsensusCalculation, + showSequenceLogo); + } + } } /** @@ -2207,6 +2220,16 @@ public class AlignViewport implements SelectionSource */ public void setShowSequenceLogo(boolean showSequenceLogo) { + if (showSequenceLogo != this.showSequenceLogo) + { + // TODO: decouple settings setting from calculation when refactoring + // annotation update method from alignframe to viewport + this.showSequenceLogo = showSequenceLogo; + if (consensusThread != null) + { + consensusThread.updateAnnotation(); + } + } this.showSequenceLogo = showSequenceLogo; } @@ -2254,24 +2277,6 @@ public class AlignViewport implements SelectionSource } /** - * @return the includeAllConsensusSymbols - */ - public boolean isIncludeAllConsensusSymbols() - { - return includeAllConsensusSymbols; - } - - /** - * @param includeAllConsensusSymbols - * the includeAllConsensusSymbols to set - */ - public void setIncludeAllConsensusSymbols( - boolean includeAllConsensusSymbols) - { - this.includeAllConsensusSymbols = includeAllConsensusSymbols; - } - - /** * * @return flag to indicate if the consensus histogram should be rendered by * default