From cb7c9583bac57478d63abcbba3bd41460faa50a1 Mon Sep 17 00:00:00 2001 From: jprocter Date: Wed, 17 Aug 2011 11:35:00 +0100 Subject: [PATCH] JAL-813 fix - check whether conservation is applied to colourscheme before we set conservation object (and so enable conservation) --- src/jalview/datamodel/SequenceGroup.java | 32 +++++++++++++++++++----------- 1 file changed, 20 insertions(+), 12 deletions(-) diff --git a/src/jalview/datamodel/SequenceGroup.java b/src/jalview/datamodel/SequenceGroup.java index d253560..ba17cc9 100755 --- a/src/jalview/datamodel/SequenceGroup.java +++ b/src/jalview/datamodel/SequenceGroup.java @@ -510,12 +510,15 @@ public class SequenceGroup } if (cs != null) { - cs.setConservation(c); - - if (cs instanceof ClustalxColourScheme) + if (cs.conservationApplied()) { - ((ClustalxColourScheme) cs) - .resetClustalX(sequences, getWidth()); + cs.setConservation(c); + + if (cs instanceof ClustalxColourScheme) + { + ((ClustalxColourScheme) cs).resetClustalX(sequences, + getWidth()); + } } } } @@ -998,17 +1001,19 @@ public class SequenceGroup private boolean showConsensusHistogram; /** - * set this alignmentAnnotation object as the one used to render consensus annotation + * set this alignmentAnnotation object as the one used to render consensus + * annotation + * * @param aan */ public void setConsensus(AlignmentAnnotation aan) { - if (consensus==null) + if (consensus == null) { - consensus=aan; + consensus = aan; } } - + /** * * @return automatically calculated consensus row @@ -1038,16 +1043,19 @@ public class SequenceGroup } /** - * set this alignmentAnnotation object as the one used to render consensus annotation + * set this alignmentAnnotation object as the one used to render consensus + * annotation + * * @param aan */ public void setConservationRow(AlignmentAnnotation aan) { - if (conservation==null) + if (conservation == null) { - conservation=aan; + conservation = aan; } } + /** * get the conservation annotation row for this group * -- 1.7.10.2