JAL-819 fix broken initConsensus features/r_2_11_2_JAL-819_undeleteAutoAnnotation
authorgmungoc <g.m.carstairs@dundee.ac.uk>
Fri, 22 Nov 2019 16:18:09 +0000 (16:18 +0000)
committergmungoc <g.m.carstairs@dundee.ac.uk>
Fri, 22 Nov 2019 16:18:09 +0000 (16:18 +0000)
src/jalview/viewmodel/AlignmentViewport.java

index 9de0b94..69cc645 100644 (file)
@@ -1993,7 +1993,9 @@ public abstract class AlignmentViewport
                           .getString("label.complement_consensus_descr"),
                   new Annotation[1], 0f, 100f,
                   AlignmentAnnotation.BAR_GRAPH);
-          initConsensus(complementConsensus);
+          complementConsensus.hasText = true;
+          complementConsensus.autoCalculated = true;
+          alignment.addAnnotation(complementConsensus);
           return true;
         }
       }
@@ -2007,21 +2009,9 @@ public abstract class AlignmentViewport
     consensus = new AlignmentAnnotation("Consensus",
             MessageManager.getString("label.consensus_descr"),
             new Annotation[1], 0f, 100f, AlignmentAnnotation.BAR_GRAPH);
-    initConsensus(consensus);
-  }
-
-  private void initConsensus(AlignmentAnnotation aa)
-  {
-    consensus = new AlignmentAnnotation("Consensus",
-            MessageManager.getString("label.consensus_descr"),
-            new Annotation[1], 0f, 100f, AlignmentAnnotation.BAR_GRAPH);
     consensus.hasText = true;
     consensus.autoCalculated = true;
-
-    if (showConsensus)
-    {
-      alignment.addAnnotation(consensus);
-    }
+    alignment.addAnnotation(consensus);
   }
 
   @Override