(JAL-969) refactored alignmentViewport base class to own package and pulled up most...
[jalview.git] / src / jalview / gui / IdCanvas.java
index 7d8ff70..2a2acfb 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.
  * 
@@ -123,7 +123,7 @@ public class IdCanvas extends JPanel
     gg.drawString(s.getDisplayId(av.getShowJVSuffix()), xPos,
             (((i - starty + 1) * charHeight) + ypos) - (charHeight / 5));
 
-    if (av.hasHiddenRows && av.showHiddenMarkers)
+    if (av.hasHiddenRows() && av.showHiddenMarkers)
     {
       drawMarker(i, starty, ypos);
     }
@@ -264,10 +264,10 @@ public class IdCanvas extends JPanel
 
     if (av.getWrapAlignment())
     {
-      int maxwidth = av.alignment.getWidth();
-      int alheight = av.alignment.getHeight();
+      int maxwidth = av.getAlignment().getWidth();
+      int alheight = av.getAlignment().getHeight();
 
-      if (av.hasHiddenColumns)
+      if (av.hasHiddenColumns())
       {
         maxwidth = av.getColumnSelection().findColumnPosition(maxwidth) - 1;
       }
@@ -304,8 +304,8 @@ public class IdCanvas extends JPanel
       {
         for (int i = starty; i < alheight; i++)
         {
-          SequenceI s = av.alignment.getSequenceAt(i);
-          if (av.hasHiddenRows)
+          SequenceI s = av.getAlignment().getSequenceAt(i);
+          if (av.hasHiddenRows())
           {
             setHiddenFont(s);
           }
@@ -338,14 +338,14 @@ public class IdCanvas extends JPanel
       // Now draw the id strings
       for (int i = starty; i < endy; i++)
       {
-        sequence = av.alignment.getSequenceAt(i);
+        sequence = av.getAlignment().getSequenceAt(i);
 
         if (sequence == null)
         {
           continue;
         }
 
-        if (av.hasHiddenRows)
+        if (av.hasHiddenRows())
         {
           setHiddenFont(sequence);
         }
@@ -357,8 +357,8 @@ public class IdCanvas extends JPanel
           currentTextColor = Color.white;
         }
         else if ((av.getSelectionGroup() != null)
-                && av.getSelectionGroup().getSequences(null).contains(
-                        sequence))
+                && av.getSelectionGroup().getSequences(null)
+                        .contains(sequence))
         {
           currentColor = Color.lightGray;
           currentTextColor = Color.black;
@@ -387,7 +387,7 @@ public class IdCanvas extends JPanel
                 (((i - starty) * av.charHeight) + av.charHeight)
                         - (av.charHeight / 5));
 
-        if (av.hasHiddenRows && av.showHiddenMarkers)
+        if (av.hasHiddenRows() && av.showHiddenMarkers)
         {
           drawMarker(i, starty, 0);
         }
@@ -400,7 +400,7 @@ public class IdCanvas extends JPanel
   void drawMarker(int i, int starty, int yoffset)
   {
 
-    SequenceI[] hseqs = av.alignment.getHiddenSequences().hiddenSequences;
+    SequenceI[] hseqs = av.getAlignment().getHiddenSequences().hiddenSequences;
     // Use this method here instead of calling hiddenSeq adjust
     // 3 times.
     int hSize = hseqs.length;
@@ -463,8 +463,7 @@ public class IdCanvas extends JPanel
     Font bold = new Font(av.getFont().getName(), Font.BOLD, av.getFont()
             .getSize());
 
-    if (av.hiddenRepSequences != null
-            && av.hiddenRepSequences.containsKey(seq))
+    if (av.isHiddenRepSequence(seq))
     {
       gg.setFont(bold);
     }