fixes bug 0013013 but reveals lack of a 'features retrieved' flag that should be...
[jalview.git] / src / jalview / appletgui / SequenceRenderer.java
index c68e85c..0fa8b2e 100755 (executable)
@@ -33,6 +33,7 @@ public class SequenceRenderer
   SequenceGroup[] allGroups = null;\r
   Color resBoxColour;\r
   Graphics graphics;\r
+  boolean forOverview = false;\r
 \r
   public SequenceRenderer(AlignViewport av)\r
   {\r
@@ -69,13 +70,17 @@ public class SequenceRenderer
     {\r
       resBoxColour = cs.findColour(seq.getSequence(i, i + 1), i);\r
     }\r
+    else if(forOverview && !jalview.util.Comparison.isGap(seq.getCharAt(i)))\r
+    {\r
+        resBoxColour = Color.lightGray;\r
+    }\r
     else\r
     {\r
       resBoxColour = Color.white;\r
     }\r
+\r
   }\r
 \r
-  Image offscreen;\r
   public Color findSequenceColour(SequenceI seq, int i)\r
   {\r
     allGroups = av.alignment.findAllGroups(seq);\r
@@ -155,22 +160,22 @@ public class SequenceRenderer
   public void drawText(SequenceI seq, int start, int end, int x1, int y1,\r
                        int width, int height)\r
   {\r
-    int pady = height / 5;\r
-    int charOffset = 0;\r
-    char s=' ';\r
-    // Need to find the sequence position here.\r
 \r
-    String sequence = seq.getSequence();\r
+    y1 += height - height / 5;  // height/5 replaces pady\r
 \r
+    int charOffset = 0;\r
+\r
+    // Need to find the sequence position here.\r
     if(end+1>=seq.getLength())\r
           end = seq.getLength()-1;\r
 \r
+    char s = ' ';\r
+\r
     for (int i = start; i <= end; i++)\r
     {\r
       graphics.setColor(Color.black);\r
 \r
-      s = sequence.charAt(i);\r
-\r
+      s = seq.getCharAt(i);\r
       if (!renderGaps && jalview.util.Comparison.isGap(s))\r
       {\r
         continue;\r
@@ -212,8 +217,8 @@ public class SequenceRenderer
 \r
       charOffset = (width - fm.charWidth(s)) / 2;\r
       graphics.drawString(String.valueOf(s),\r
-                          charOffset + x1 + width * (i - start),\r
-                          y1 + height - pady);\r
+                         charOffset + x1 + width * (i - start),\r
+                        y1 );\r
     }\r
 \r
   }\r