images moved
[jalview.git] / src / jalview / gui / SequenceRenderer.java
index 442239d..8cab563 100755 (executable)
@@ -3,9 +3,8 @@ package jalview.gui;
 import jalview.datamodel.*;\r
 import jalview.schemes.*;\r
 import java.awt.*;\r
-import java.util.*;\r
 \r
-public class SequenceRenderer implements RendererI\r
+public class SequenceRenderer\r
 {\r
   AlignViewport av;\r
   FontMetrics fm;\r
@@ -35,29 +34,29 @@ public class SequenceRenderer implements RendererI
   void getBoxColour(ColourSchemeI cs, SequenceI seq, int i)\r
   {\r
    if (cs != null)\r
-       resBoxColour = cs.findColour(seq.getSequence(i, i + 1), i, av.getConsensus(false));\r
+       resBoxColour = cs.findColour(seq.getSequence(i, i + 1), i);\r
    else\r
        resBoxColour = Color.white;\r
   }\r
 \r
-  public void drawSequence(Graphics g,SequenceI seq,SequenceGroup [] sg, int start, int end, int x1, int y1, int width, int height, Vector pid, int seqnum)\r
+  public void drawSequence(Graphics g,SequenceI seq,SequenceGroup [] sg, int start, int end, int x1, int y1, int width, int height)\r
   {\r
     allGroups = sg;\r
 \r
     graphics = g;\r
 \r
-    drawBoxes(seq, start, end, x1, y1, (int) width, height, pid);\r
+    drawBoxes(seq, start, end, x1, y1, (int) width, height);\r
 \r
     fm = g.getFontMetrics();\r
     drawText(seq,start,end,x1,y1,(int)width,height);\r
 \r
   }\r
 \r
-  public void drawBoxes(SequenceI seq,int start, int end, int x1, int y1, int width, int height,Vector freq) {\r
+  public void drawBoxes(SequenceI seq,int start, int end, int x1, int y1, int width, int height) {\r
     int i      = start;\r
     int length = seq.getLength();\r
 \r
-    int curStart = x1;\r
+    int curStart = -1;\r
     int curWidth = width;\r
 \r
     Color tempColour = null;\r
@@ -67,6 +66,8 @@ public class SequenceRenderer implements RendererI
       {\r
         if( currentSequenceGroup.getDisplayBoxes())\r
              getBoxColour(currentSequenceGroup.cs, seq, i);\r
+        else\r
+             resBoxColour = Color.white;\r
       }\r
       else if(av.getShowBoxes())\r
             getBoxColour(av.getGlobalColourScheme(), seq, i);\r
@@ -76,7 +77,8 @@ public class SequenceRenderer implements RendererI
 \r
       if (resBoxColour != tempColour)\r
       {\r
-        graphics.fillRect(x1+width*(curStart-start),y1,curWidth,height);\r
+        if(tempColour!=null)\r
+          graphics.fillRect(x1+width*(curStart-start),y1,curWidth,height);\r
         graphics.setColor(resBoxColour);\r
 \r
         curStart = i;\r
@@ -89,7 +91,9 @@ public class SequenceRenderer implements RendererI
 \r
       i++;\r
     }\r
-    graphics.fillRect(x1+width*(curStart-start),y1,curWidth,height);\r
+\r
+\r
+     graphics.fillRect(x1+width*(curStart-start),y1,curWidth,height);\r
   }\r
 \r
   public void drawText(SequenceI seq,int start, int end, int x1, int y1, int width, int height)\r
@@ -99,10 +103,12 @@ public class SequenceRenderer implements RendererI
     char s;\r
     // Need to find the sequence position here.\r
 \r
-    graphics.setColor(Color.black);\r
+\r
     String sequence  = seq.getSequence();\r
     for (int i = start; i <= end; i++)\r
     {\r
+        graphics.setColor(Color.black);\r
+\r
         if(i<sequence.length())\r
           s = sequence.charAt(i);\r
         else\r