From: amwaterhouse Date: Tue, 16 Nov 2004 15:17:07 +0000 (+0000) Subject: Halfway to wrapalignment, shows swissprot file X-Git-Tag: Release_2_0~932 X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=dad44a64adbed84c9bf40a49fc8fa01e9e6074f0;p=jalview.git Halfway to wrapalignment, shows swissprot file --- diff --git a/src/jalview/gui/IdCanvas.java b/src/jalview/gui/IdCanvas.java index fee86cd..67fabf7 100755 --- a/src/jalview/gui/IdCanvas.java +++ b/src/jalview/gui/IdCanvas.java @@ -42,13 +42,12 @@ public class IdCanvas extends JPanel String string = ds.getName() + "/" + ds.getStart() + "-" + ds.getEnd(); - gg.drawString(string,0,AlignmentUtil.getPixelHeight(starty,i,charHeight) + ypos + charHeight/2); + gg.drawString(string,0,AlignmentUtil.getPixelHeight(starty,i,charHeight) + ypos + charHeight- (charHeight/5)); } public void paintComponent(Graphics g) { AlignmentI da = av.getAlignment(); - int charWidth = (int)av.getCharWidth(); int charHeight = av.getCharHeight(); Font f = av.getFont(); @@ -93,15 +92,17 @@ public class IdCanvas extends JPanel - if (av.getWrapAlignment()) { + if (av.getWrapAlignment()) + { starty = starty%av.getChunkHeight(); int ypos = 0; int rowstart = starty; - if (starty == 0) { + if (starty == 0) ypos = 2*charHeight; - } else if (starty == 1) { + else if (starty == 1) + { starty = 0; ypos = charHeight; } @@ -135,7 +136,7 @@ public class IdCanvas extends JPanel for (int i = starty; i < endy; i++) { SequenceI s = da.getSequenceAt(i); - drawIdString(gg,s,i,starty,ypos); + drawIdString(gg,s,i,starty,ypos); } ypos += av.getChunkHeight(); @@ -160,14 +161,12 @@ public class IdCanvas extends JPanel { // Selected sequence colours - - if (av.getSelection().contains(da.getSequenceAt(i))) { - if (currentColor != Color.gray) { + if (av.getSelection().contains(da.getSequenceAt(i))) + { currentColor = Color.gray; currentTextColor = Color.black; - } } - else if (da.getSequenceAt(i).getColor() != null) + else { currentColor = da.getSequenceAt(i).getColor(); currentTextColor = Color.black; @@ -175,13 +174,12 @@ public class IdCanvas extends JPanel gg.setColor(currentColor); - if (currentColor != Color.BLACK) - { - gg.fillRect(0, + + + gg.fillRect(0, AlignmentUtil.getPixelHeight(starty,i,charHeight), getWidth(), charHeight); - } gg.setColor(currentTextColor);