From be8ed26b63eec2546c415d23e58fce77d3e14f2c Mon Sep 17 00:00:00 2001 From: amwaterhouse Date: Fri, 24 Mar 2006 15:27:59 +0000 Subject: [PATCH] 1 too many in drawgraph --- src/jalview/appletgui/AnnotationPanel.java | 36 +++++++++++++++------------- 1 file changed, 19 insertions(+), 17 deletions(-) diff --git a/src/jalview/appletgui/AnnotationPanel.java b/src/jalview/appletgui/AnnotationPanel.java index ad2e6f0..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)) @@ -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 -- 1.7.10.2