JAL-535 refactored core code from PCA viewer to viewmodel.
[jalview.git] / src / jalview / appletgui / AlignViewport.java
index ab9a25d..e0a6a71 100644 (file)
@@ -61,19 +61,8 @@ 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;
-
-  boolean conservationColourSelected = false;
-
-  boolean abovePIDThreshold = false;
 
   int charHeight;
 
@@ -254,44 +243,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);
-        }
-      }
-
-      consensus = new AlignmentAnnotation("Consensus", "PID",
-              new Annotation[1], 0f, 100f, AlignmentAnnotation.BAR_GRAPH);
-      consensus.hasText = true;
-      consensus.autoCalculated = true;
-
-      if (showConsensus)
-      {
-        alignment.addAnnotation(consensus);
-      }
-    }
+    initAutoAnnotation();
 
   }
 
@@ -343,26 +295,6 @@ public class AlignViewport extends AlignmentViewport implements AlignViewportI,
     return sq;
   }
 
-  public boolean getConservationSelected()
-  {
-    return conservationColourSelected;
-  }
-
-  public void setConservationSelected(boolean b)
-  {
-    conservationColourSelected = b;
-  }
-
-  public boolean getAbovePIDThreshold()
-  {
-    return abovePIDThreshold;
-  }
-
-  public void setAbovePIDThreshold(boolean b)
-  {
-    abovePIDThreshold = b;
-  }
-
   public int getStartRes()
   {
     return startRes;
@@ -581,16 +513,6 @@ public class AlignViewport extends AlignmentViewport implements AlignViewportI,
     return currentTree;
   }
 
-  public void setColourAppliesToAllGroups(boolean b)
-  {
-    colourAppliesToAllGroups = b;
-  }
-
-  public boolean getColourAppliesToAllGroups()
-  {
-    return colourAppliesToAllGroups;
-  }
-
   public boolean getShowJVSuffix()
   {
     return showJVSuffix;
@@ -705,16 +627,14 @@ public class AlignViewport extends AlignmentViewport implements AlignViewportI,
 
   public void updateSequenceIdColours()
   {
-    Vector groups = alignment.getGroups();
-    for (int ig = 0, igSize = groups.size(); ig < igSize; ig++)
+    
+    for (SequenceGroup sg:alignment.getGroups())
     {
-      SequenceGroup sg = (SequenceGroup) groups.elementAt(ig);
       if (sg.idColour != null)
       {
-        Vector sqs = sg.getSequences(getHiddenRepSequences());
-        for (int s = 0, sSize = sqs.size(); s < sSize; s++)
+        for (SequenceI s:sg.getSequences(getHiddenRepSequences()))
         {
-          this.setSequenceColour((SequenceI) sqs.elementAt(s), sg.idColour);
+          this.setSequenceColour(s, sg.idColour);
         }
       }
     }