JAL-969 - refactor initialisation of automatic annotation rows to base class
[jalview.git] / src / jalview / appletgui / AlignViewport.java
index 95aafab..e094d7d 100644 (file)
@@ -61,12 +61,6 @@ public class AlignViewport extends AlignmentViewport implements AlignViewportI,
 
   boolean showAnnotation = true;
 
-  boolean showConservation = true;
-
-  boolean showQuality = true;
-
-  boolean showConsensus = true;
-
   boolean upperCasebold = false;
 
   boolean colourAppliesToAllGroups = true;
@@ -254,56 +248,7 @@ public class AlignViewport extends AlignmentViewport implements AlignViewportI,
                 .getParameter("userDefinedColour"));
       }
     }
-    if (hconsensus == null)
-    {
-      if (!alignment.isNucleotide())
-      {
-        conservation = new AlignmentAnnotation("Conservation",
-                "Conservation of total alignment less than " + getConsPercGaps()
-                        + "% gaps", new Annotation[1], 0f, 11f,
-                AlignmentAnnotation.BAR_GRAPH);
-        conservation.hasText = true;
-        conservation.autoCalculated = true;
-
-        if (showConservation)
-        {
-          alignment.addAnnotation(conservation);
-        }
-
-        if (showQuality)
-        {
-          quality = new AlignmentAnnotation("Quality",
-                  "Alignment Quality based on Blosum62 scores",
-                  new Annotation[1], 0f, 11f, AlignmentAnnotation.BAR_GRAPH);
-          quality.hasText = true;
-          quality.autoCalculated = true;
-
-          alignment.addAnnotation(quality);
-        }
-      } else {
-        if (alignment.hasRNAStructure())
-        {
-          strucConsensus = new AlignmentAnnotation("StrucConsensus", "PID",
-                  new Annotation[1], 0f, 100f, AlignmentAnnotation.BAR_GRAPH);
-          strucConsensus.hasText = true;
-          strucConsensus.autoCalculated = true;
-        }
-      }
-
-      consensus = new AlignmentAnnotation("Consensus", "PID",
-              new Annotation[1], 0f, 100f, AlignmentAnnotation.BAR_GRAPH);
-      consensus.hasText = true;
-      consensus.autoCalculated = true;
-
-      if (showConsensus)
-      {
-        alignment.addAnnotation(consensus);
-        if (strucConsensus!=null)
-        {
-          alignment.addAnnotation(strucConsensus);
-        }
-      }
-    }
+    initAutoAnnotation();
 
   }