getCharwidth directly
authoramwaterhouse <Andrew Waterhouse>
Tue, 8 Mar 2005 14:49:41 +0000 (14:49 +0000)
committeramwaterhouse <Andrew Waterhouse>
Tue, 8 Mar 2005 14:49:41 +0000 (14:49 +0000)
src/jalview/gui/SeqCanvas.java

index c33f3ed..507b7b0 100755 (executable)
@@ -128,8 +128,6 @@ public class SeqCanvas extends JPanel
 \r
 \r
     g.setFont(av.getFont());\r
-    int            charWidth  = av.getCharWidth();\r
-    int            charHeight = av.getCharHeight();\r
     RendererI sr = av.getRenderer();\r
 \r
     /*Vector    pid    = av.getConsensus(false);\r
@@ -174,17 +172,17 @@ public class SeqCanvas extends JPanel
      groups = av.alignment.findAllGroups( nextSeq );\r
 \r
      sr.drawSequence(g, nextSeq, groups,x1,x2,\r
-                 (x1 - startx) * charWidth,\r
-                 offset + AlignmentUtil.getPixelHeight(starty, i, av.getCharHeight()),\r
-                 charWidth,charHeight,null, i);\r
+                 (x1 - startx) * av.charWidth,\r
+                 offset + AlignmentUtil.getPixelHeight(starty, i, av.charHeight),\r
+                 av.charWidth,av.charHeight,null, i);\r
 \r
      if(av.showSequenceFeatures)\r
      {\r
        fr.drawSequence(g, nextSeq, groups, x1, x2,\r
-                       (x1 - startx) * charWidth,\r
+                       (x1 - startx) * av.charWidth,\r
                        offset +\r
-                       AlignmentUtil.getPixelHeight(starty, i, av.getCharHeight()),\r
-                       charWidth, charHeight, null, i);\r
+                       AlignmentUtil.getPixelHeight(starty, i, av.charHeight),\r
+                       av.charWidth, av.charHeight, null, i);\r
      }\r
 \r
 \r
@@ -195,10 +193,10 @@ public class SeqCanvas extends JPanel
 \r
         g.setColor(Color.lightGray);\r
 \r
-        sx = (group.getStartRes()-startx)*charWidth;\r
-        sy = offset + AlignmentUtil.getPixelHeight(starty, i, av.getCharHeight());\r
-        ex = (group.getEndRes()+1-startx)*charWidth;\r
-        ey = offset + AlignmentUtil.getPixelHeight(starty, i+1, av.getCharHeight());\r
+        sx = (group.getStartRes()-startx)*av.charWidth;\r
+        sy = offset + AlignmentUtil.getPixelHeight(starty, i, av.charHeight);\r
+        ex = (group.getEndRes()+1-startx)*av.charWidth;\r
+        ey = offset + AlignmentUtil.getPixelHeight(starty, i+1, av.charHeight);\r
 \r
 \r
         if (!inGroup)\r
@@ -229,12 +227,12 @@ public class SeqCanvas extends JPanel
      if( group != null && group.sequences.contains(nextSeq) )\r
      {\r
          g.setColor(Color.RED.brighter());\r
-         sx = (group.getStartRes() - startx) * charWidth;\r
+         sx = (group.getStartRes() - startx) * av.charWidth;\r
          sy = offset +\r
-             AlignmentUtil.getPixelHeight(starty, i, av.getCharHeight());\r
-         ex = (group.getEndRes() + 1 - startx) * charWidth;\r
+             AlignmentUtil.getPixelHeight(starty, i, av.charHeight);\r
+         ex = (group.getEndRes() + 1 - startx) * av.charWidth;\r
          ey = offset +\r
-             AlignmentUtil.getPixelHeight(starty, i + 1, av.getCharHeight());\r
+             AlignmentUtil.getPixelHeight(starty, i + 1, av.charHeight);\r
 \r
          if (!inRB)\r
          {\r
@@ -278,12 +276,12 @@ public class SeqCanvas extends JPanel
           ssr.drawHighlightedText(av.getAlignment().getSequenceAt(searchSeq),\r
                                   searchStart,\r
                                   searchEnd,\r
-                                  (searchStart - startx) * charWidth,\r
+                                  (searchStart - startx) * av.charWidth,\r
                                   offset +\r
                                   AlignmentUtil.getPixelHeight(starty, searchSeq,\r
-              charHeight),\r
-                                  charWidth,\r
-                                  charHeight);\r
+              av.charHeight),\r
+                                  av.charWidth,\r
+                                  av.charHeight);\r
         }\r
       }\r
     }\r