make sure references are intact when group annotation is accessed
[jalview.git] / src / jalview / datamodel / SequenceGroup.java
index 871e4cf..dcb0150 100755 (executable)
@@ -86,14 +86,14 @@ public class SequenceGroup
   /**
    * consensus calculation property
    */
-  private boolean showConsensusProfile=false;
+  private boolean showSequenceLogo=false;
 
   /**
    * @return the includeAllConsSymbols
    */
-  public boolean isIncludeAllConsSymbols()
+  public boolean isShowSequenceLogo()
   {
-    return showConsensusProfile;
+    return showSequenceLogo;
   }
 
 
@@ -470,7 +470,7 @@ public class SequenceGroup
     
     try
     {
-      Hashtable cnsns[] = AAFrequency.calculate(sequences, startRes, endRes + 1, showConsensusProfile);
+      Hashtable cnsns[] = AAFrequency.calculate(sequences, startRes, endRes + 1, showSequenceLogo);
       if (consensus != null)
       {
         _updateConsensusRow(cnsns);
@@ -545,7 +545,7 @@ public class SequenceGroup
     consensus.annotations = null;
     consensus.annotations = new Annotation[aWidth]; // should be alignment width
 
-    AAFrequency.completeConsensus(consensus,cnsns,startRes,endRes+1,ignoreGapsInConsensus, showConsensusProfile); // TODO: setting container for ignoreGapsInConsensusCalculation);
+    AAFrequency.completeConsensus(consensus,cnsns,startRes,endRes+1,ignoreGapsInConsensus, showSequenceLogo); // TODO: setting container for ignoreGapsInConsensusCalculation);
   }
 
   /**
@@ -953,10 +953,10 @@ public class SequenceGroup
     {
        consensus = new AlignmentAnnotation("","",
               new Annotation[1], 0f, 100f, AlignmentAnnotation.BAR_GRAPH);
-      consensus.hasText = true;
-      consensus.autoCalculated = true;
-      consensus.groupRef = this;
     }
+    consensus.hasText = true;
+    consensus.autoCalculated = true;
+    consensus.groupRef = this;
     consensus.label = "Consensus for "+getName();
     consensus.description = "Percent Identity";
     return consensus;
@@ -969,10 +969,11 @@ public class SequenceGroup
     if (conservation == null) {
       conservation = new AlignmentAnnotation("","", new Annotation[1], 0f, 11f,
             AlignmentAnnotation.BAR_GRAPH);
+    }
+    
     conservation.hasText = true;
     conservation.autoCalculated = true;
     conservation.groupRef = this;
-    }
     conservation.label = "Conservation for "+getName();
     conservation.description = "Conservation for group "+getName()+" less than " + consPercGaps
             + "% gaps";
@@ -1031,11 +1032,11 @@ public class SequenceGroup
    */
   public void setIncludeAllConsSymbols(boolean includeAllConsSymbols)
   {
-    if (this.showConsensusProfile!=includeAllConsSymbols && consensus!=null) {
-      this.showConsensusProfile = includeAllConsSymbols;
+    if (this.showSequenceLogo!=includeAllConsSymbols && consensus!=null) {
+      this.showSequenceLogo = includeAllConsSymbols;
       recalcConservation();
     }
-    this.showConsensusProfile = includeAllConsSymbols;
+    this.showSequenceLogo = includeAllConsSymbols;
   }