JAL-3485 constants for CDNA_CONSENSUS, STRUCTURE_CONSENSUS added
authorgmungoc <g.m.carstairs@dundee.ac.uk>
Thu, 21 Nov 2019 13:37:05 +0000 (13:37 +0000)
committergmungoc <g.m.carstairs@dundee.ac.uk>
Thu, 21 Nov 2019 13:37:05 +0000 (13:37 +0000)
src/jalview/renderer/AnnotationRenderer.java
src/jalview/viewmodel/AlignmentViewport.java

index 05be67b..1e2cf76 100644 (file)
@@ -365,9 +365,11 @@ public class AnnotationRenderer
     //
     if (aa.autoCalculated
             && (aa.label.startsWith(AutoAnnotation.CONSENSUS.label)
-            || aa.label.startsWith("cDNA Consensus")))
+                    || aa.label.startsWith(
+                            AutoAnnotation.CDNA_CONSENSUS.label)))
     {
-      boolean forComplement = aa.label.startsWith("cDNA Consensus");
+      boolean forComplement = aa.label
+              .startsWith(AutoAnnotation.CDNA_CONSENSUS.label);
       if (aa.groupRef != null && aa.groupRef.consensusData != null
               && aa.groupRef.isShowSequenceLogo())
       {
@@ -394,7 +396,8 @@ public class AnnotationRenderer
     }
     else
     {
-      if (aa.autoCalculated && aa.label.startsWith("StrucConsensus"))
+      if (aa.autoCalculated && aa.label
+              .startsWith(AutoAnnotation.STRUCTURE_CONSENSUS.label))
       {
         // TODO implement group structure consensus
         /*
index 01c7bb2..268633f 100644 (file)
@@ -90,6 +90,8 @@ public abstract class AlignmentViewport
     CONSERVATION("Conservation", "SHOW_CONSERVATION"),
     QUALITY("Quality", "SHOW_QUALITY"),
     CONSENSUS("Consensus", "SHOW_IDENTITY"),
+    CDNA_CONSENSUS("cDNA Consensus", null),
+    STRUCTURE_CONSENSUS("StrucConsensus", null),
     OCCUPANCY("Occupancy", "SHOW_OCCUPANCY");
     
     public final String label;
@@ -1996,7 +1998,8 @@ public abstract class AlignmentViewport
         }
         if (doConsensus)
         {
-          complementConsensus = new AlignmentAnnotation("cDNA Consensus",
+          complementConsensus = new AlignmentAnnotation(
+                  AutoAnnotation.CDNA_CONSENSUS.label,
                   MessageManager
                           .getString("label.complement_consensus_descr"),
                   new Annotation[1], 0f, 100f,
@@ -2075,7 +2078,8 @@ public abstract class AlignmentViewport
   {
     if (alignment.hasRNAStructure() && strucConsensus == null)
     {
-      strucConsensus = new AlignmentAnnotation("StrucConsensus",
+      strucConsensus = new AlignmentAnnotation(
+              AutoAnnotation.STRUCTURE_CONSENSUS.label,
               MessageManager.getString("label.strucconsensus_descr"),
               new Annotation[1], 0f, 100f, AlignmentAnnotation.BAR_GRAPH);
       strucConsensus.hasText = true;