X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fjalview%2Fappletgui%2FAnnotationPanel.java;h=cb638dda875a1e6ef53157f53921785fb50051e2;hb=14bad6b2390493bb6ad030c6f3ea7cde4cba1b53;hp=92ee3a2b79f32926e1492b8ba46379bda2e736dd;hpb=645c2b050820af4a0cefd91ccb1db62bccb084c2;p=jalview.git diff --git a/src/jalview/appletgui/AnnotationPanel.java b/src/jalview/appletgui/AnnotationPanel.java index 92ee3a2..cb638dd 100755 --- a/src/jalview/appletgui/AnnotationPanel.java +++ b/src/jalview/appletgui/AnnotationPanel.java @@ -206,8 +206,6 @@ public class AnnotationPanel public void paint(Graphics g) { - g.setColor(Color.white); - g.fillRect(0,0, getSize().width, getSize().height); imgWidth = (av.endRes - av.startRes + 1) * av.charWidth; if (image == null || imgWidth != image.getWidth(this)) @@ -389,8 +387,8 @@ public class AnnotationPanel y + iconOffset + 3); } else if (((row.annotations[j - 1] == null) || - (row.annotations[j].displayCharacter != row.annotations[j - - 1].displayCharacter))) + (!row.annotations[j].displayCharacter.equals( + row.annotations[j - 1].displayCharacter)))) { g.drawString(row.annotations[j].displayCharacter, x+charOffset, y + iconOffset + 3); @@ -582,13 +580,6 @@ public class AnnotationPanel g.drawLine(x-av.charWidth,y2,(eRes-sRes)*av.charWidth,y2); - if(aa.threshold!=null) - { - g.setColor(aa.threshold.colour); - y2 = (int)(y - ((aa.threshold.value-min) / range)*graphHeight); - g.drawLine(x-av.charWidth,y2,(eRes-sRes)*av.charWidth,y2); - } - for (int j = sRes; j < eRes; j++) { if(aa.annotations[j]==null || aa.annotations[j-1]==null) @@ -602,6 +593,15 @@ public class AnnotationPanel g.drawLine(x-av.charWidth/2, y1, x+av.charWidth/2, y2); x += av.charWidth; } + + + if(aa.threshold!=null) + { + g.setColor(aa.threshold.colour); + y2 = (int)(y - ((aa.threshold.value-min) / range)*aa.graphHeight); + g.drawLine(0,y2,(eRes-sRes)*av.charWidth,y2); + } + } public void drawBarGraph(Graphics g, AlignmentAnnotation aa, @@ -619,13 +619,6 @@ public class AnnotationPanel float range = max - min; - if(aa.threshold!=null) - { - g.setColor(aa.threshold.colour); - y2 = (int)(y - ((aa.threshold.value-min) / range)*aa.graphHeight); - g.drawLine(x-av.charWidth,y2,(eRes-sRes)*av.charWidth,y2); - } - y1 = y2 = y; if(min<0) @@ -633,7 +626,7 @@ public class AnnotationPanel g.setColor(Color.gray); - g.drawLine(x,y2,(eRes-sRes+1)*av.charWidth,y2); + g.drawLine(x,y2,(eRes-sRes)*av.charWidth,y2); for (int j = sRes; j < eRes; j++) { @@ -655,6 +648,15 @@ public class AnnotationPanel x += av.charWidth; } + + if(aa.threshold!=null) + { + g.setColor(aa.threshold.colour); + y2 = (int)(y - ((aa.threshold.value-min) / range)*aa.graphHeight); + g.drawLine(0,y2,(eRes-sRes)*av.charWidth,y2); + } + + } // used by overview window