Halfway to wrapalignment, shows swissprot file
authoramwaterhouse <Andrew Waterhouse>
Tue, 16 Nov 2004 15:17:07 +0000 (15:17 +0000)
committeramwaterhouse <Andrew Waterhouse>
Tue, 16 Nov 2004 15:17:07 +0000 (15:17 +0000)
src/jalview/gui/IdCanvas.java

index fee86cd..67fabf7 100755 (executable)
@@ -42,13 +42,12 @@ public class IdCanvas extends JPanel
 \r
       String string = ds.getName() + "/" + ds.getStart() + "-" + ds.getEnd();\r
 \r
-      gg.drawString(string,0,AlignmentUtil.getPixelHeight(starty,i,charHeight) + ypos + charHeight/2);\r
+      gg.drawString(string,0,AlignmentUtil.getPixelHeight(starty,i,charHeight) + ypos + charHeight-   (charHeight/5));\r
 \r
   }\r
 \r
   public void paintComponent(Graphics g) {\r
     AlignmentI da         = av.getAlignment();\r
-    int        charWidth  = (int)av.getCharWidth();\r
     int        charHeight = av.getCharHeight();\r
     Font       f          = av.getFont();\r
 \r
@@ -93,15 +92,17 @@ public class IdCanvas extends JPanel
 \r
 \r
 \r
-    if (av.getWrapAlignment()) {\r
+    if (av.getWrapAlignment())\r
+    {\r
        starty = starty%av.getChunkHeight();\r
 \r
        int ypos     = 0;\r
        int rowstart = starty;\r
 \r
-       if (starty == 0) {\r
+       if (starty == 0)\r
            ypos = 2*charHeight;\r
-       } else if (starty == 1) {\r
+       else if (starty == 1)\r
+       {\r
            starty = 0;\r
            ypos = charHeight;\r
        }\r
@@ -135,7 +136,7 @@ public class IdCanvas extends JPanel
 \r
            for (int i = starty; i < endy; i++) {\r
              SequenceI s = da.getSequenceAt(i);\r
-             drawIdString(gg,s,i,starty,ypos);\r
+             drawIdString(gg,s,i,starty,ypos);\r
            }\r
 \r
            ypos   += av.getChunkHeight();\r
@@ -160,14 +161,12 @@ public class IdCanvas extends JPanel
     {\r
 \r
       // Selected sequence colours\r
-\r
-      if (av.getSelection().contains(da.getSequenceAt(i))) {\r
-        if (currentColor != Color.gray) {\r
+      if (av.getSelection().contains(da.getSequenceAt(i)))\r
+      {\r
           currentColor     = Color.gray;\r
           currentTextColor = Color.black;\r
-        }\r
       }\r
-      else if (da.getSequenceAt(i).getColor() != null)\r
+      else\r
       {\r
         currentColor = da.getSequenceAt(i).getColor();\r
         currentTextColor = Color.black;\r
@@ -175,13 +174,12 @@ public class IdCanvas extends JPanel
 \r
       gg.setColor(currentColor);\r
 \r
-      if (currentColor != Color.BLACK)\r
-      {\r
-        gg.fillRect(0,\r
+\r
+\r
+      gg.fillRect(0,\r
                     AlignmentUtil.getPixelHeight(starty,i,charHeight),\r
                     getWidth(),\r
                     charHeight);\r
-      }\r
 \r
       gg.setColor(currentTextColor);\r
 \r