From 00386d5511d779b555e93dbf71f33675937e1570 Mon Sep 17 00:00:00 2001 From: amwaterhouse Date: Tue, 8 Mar 2005 14:49:41 +0000 Subject: [PATCH] getCharwidth directly --- src/jalview/gui/SeqCanvas.java | 38 ++++++++++++++++++-------------------- 1 file changed, 18 insertions(+), 20 deletions(-) diff --git a/src/jalview/gui/SeqCanvas.java b/src/jalview/gui/SeqCanvas.java index c33f3ed..507b7b0 100755 --- a/src/jalview/gui/SeqCanvas.java +++ b/src/jalview/gui/SeqCanvas.java @@ -128,8 +128,6 @@ public class SeqCanvas extends JPanel g.setFont(av.getFont()); - int charWidth = av.getCharWidth(); - int charHeight = av.getCharHeight(); RendererI sr = av.getRenderer(); /*Vector pid = av.getConsensus(false); @@ -174,17 +172,17 @@ public class SeqCanvas extends JPanel groups = av.alignment.findAllGroups( nextSeq ); sr.drawSequence(g, nextSeq, groups,x1,x2, - (x1 - startx) * charWidth, - offset + AlignmentUtil.getPixelHeight(starty, i, av.getCharHeight()), - charWidth,charHeight,null, i); + (x1 - startx) * av.charWidth, + offset + AlignmentUtil.getPixelHeight(starty, i, av.charHeight), + av.charWidth,av.charHeight,null, i); if(av.showSequenceFeatures) { fr.drawSequence(g, nextSeq, groups, x1, x2, - (x1 - startx) * charWidth, + (x1 - startx) * av.charWidth, offset + - AlignmentUtil.getPixelHeight(starty, i, av.getCharHeight()), - charWidth, charHeight, null, i); + AlignmentUtil.getPixelHeight(starty, i, av.charHeight), + av.charWidth, av.charHeight, null, i); } @@ -195,10 +193,10 @@ public class SeqCanvas extends JPanel g.setColor(Color.lightGray); - sx = (group.getStartRes()-startx)*charWidth; - sy = offset + AlignmentUtil.getPixelHeight(starty, i, av.getCharHeight()); - ex = (group.getEndRes()+1-startx)*charWidth; - ey = offset + AlignmentUtil.getPixelHeight(starty, i+1, av.getCharHeight()); + sx = (group.getStartRes()-startx)*av.charWidth; + sy = offset + AlignmentUtil.getPixelHeight(starty, i, av.charHeight); + ex = (group.getEndRes()+1-startx)*av.charWidth; + ey = offset + AlignmentUtil.getPixelHeight(starty, i+1, av.charHeight); if (!inGroup) @@ -229,12 +227,12 @@ public class SeqCanvas extends JPanel if( group != null && group.sequences.contains(nextSeq) ) { g.setColor(Color.RED.brighter()); - sx = (group.getStartRes() - startx) * charWidth; + sx = (group.getStartRes() - startx) * av.charWidth; sy = offset + - AlignmentUtil.getPixelHeight(starty, i, av.getCharHeight()); - ex = (group.getEndRes() + 1 - startx) * charWidth; + AlignmentUtil.getPixelHeight(starty, i, av.charHeight); + ex = (group.getEndRes() + 1 - startx) * av.charWidth; ey = offset + - AlignmentUtil.getPixelHeight(starty, i + 1, av.getCharHeight()); + AlignmentUtil.getPixelHeight(starty, i + 1, av.charHeight); if (!inRB) { @@ -278,12 +276,12 @@ public class SeqCanvas extends JPanel ssr.drawHighlightedText(av.getAlignment().getSequenceAt(searchSeq), searchStart, searchEnd, - (searchStart - startx) * charWidth, + (searchStart - startx) * av.charWidth, offset + AlignmentUtil.getPixelHeight(starty, searchSeq, - charHeight), - charWidth, - charHeight); + av.charHeight), + av.charWidth, + av.charHeight); } } } -- 1.7.10.2