JAL-813 fix - check whether conservation is applied to colourscheme before we set...
authorjprocter <jprocter@compbio.dundee.ac.uk>
Wed, 17 Aug 2011 10:35:00 +0000 (11:35 +0100)
committerjprocter <jprocter@compbio.dundee.ac.uk>
Wed, 17 Aug 2011 10:35:00 +0000 (11:35 +0100)
src/jalview/datamodel/SequenceGroup.java

index d253560..ba17cc9 100755 (executable)
@@ -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
    *