(JAL-969) refactored alignmentViewport base class to own package and pulled up most...
[jalview.git] / src / jalview / appletgui / SequenceRenderer.java
index b6eeba3..afbc7e3 100755 (executable)
@@ -1,6 +1,6 @@
 /*
- * Jalview - A Sequence Alignment Editor and Viewer (Version 2.6)
- * Copyright (C) 2010 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  * 
  * This file is part of Jalview.
  * 
@@ -61,7 +61,7 @@ public class SequenceRenderer implements jalview.api.SequenceRenderer
 
   public Color getResidueBoxColour(SequenceI seq, int i)
   {
-    allGroups = av.alignment.findAllGroups(seq);
+    allGroups = av.getAlignment().findAllGroups(seq);
 
     if (inCurrentSequenceGroup(i))
     {
@@ -72,7 +72,7 @@ public class SequenceRenderer implements jalview.api.SequenceRenderer
     }
     else if (av.getShowBoxes())
     {
-      getBoxColour(av.globalColourScheme, seq, i);
+      getBoxColour(av.getGlobalColourScheme(), seq, i);
     }
 
     return resBoxColour;
@@ -98,24 +98,13 @@ public class SequenceRenderer implements jalview.api.SequenceRenderer
 
   public Color findSequenceColour(SequenceI seq, int i)
   {
-    allGroups = av.alignment.findAllGroups(seq);
+    allGroups = av.getAlignment().findAllGroups(seq);
     drawBoxes(seq, i, i, 0);
     return resBoxColour;
   }
 
-  /**
-   * draw coloured sequence to the current graphics cursor
-   * @param seq
-   * @param sg
-   * @param start
-   * @param end
-   * @param y1
-   * @param drawBox - draw background
-   * @param drawText - draw text (if shading style permits)
-   */
-
   public void drawSequence(SequenceI seq, SequenceGroup[] sg, int start,
-          int end, int y1, boolean drawBox, boolean drawText)
+          int end, int y1)
   {
     if (seq == null)
     {
@@ -123,11 +112,10 @@ public class SequenceRenderer implements jalview.api.SequenceRenderer
     }
 
     allGroups = sg;
-    if (drawBox) {
-      drawBoxes(seq, start, end, y1);
-    }
 
-    if (av.validCharWidth && drawText)
+    drawBoxes(seq, start, end, y1);
+
+    if (av.validCharWidth)
     {
       drawText(seq, start, end, y1);
     }
@@ -235,7 +223,7 @@ public class SequenceRenderer implements jalview.api.SequenceRenderer
         {
           // cheat - use this if we have a consensus for each group: s =
           // getDisplayChar(currentSequenceGroup.getConsensus(), i, s, '.');
-          s = getDisplayChar(av.consensus, i, s, '.');
+          s = getDisplayChar(av.getAlignmentConsensusAnnotation(), i, s, '.');
         }
       }
       else
@@ -257,9 +245,9 @@ public class SequenceRenderer implements jalview.api.SequenceRenderer
             graphics.setColor(resBoxColour);
           }
         }
-        if (av.getShowunconserved())
+        if (av.getShowUnconserved())
         {
-          s = getDisplayChar(av.consensus, i, s, '.');
+          s = getDisplayChar(av.getAlignmentConsensusAnnotation(), i, s, '.');
 
         }
       }