From b27f973bd368619235ff19f706afb28b81c731e7 Mon Sep 17 00:00:00 2001 From: amwaterhouse Date: Tue, 4 Apr 2006 13:09:28 +0000 Subject: [PATCH] Draw threshold over graph --- src/jalview/gui/AnnotationPanel.java | 54 ++++++++++++++++------------------ 1 file changed, 25 insertions(+), 29 deletions(-) diff --git a/src/jalview/gui/AnnotationPanel.java b/src/jalview/gui/AnnotationPanel.java index c5708ee..1b4a230 100755 --- a/src/jalview/gui/AnnotationPanel.java +++ b/src/jalview/gui/AnnotationPanel.java @@ -958,21 +958,6 @@ public class AnnotationPanel extends JPanel implements MouseListener, g.setColor(Color.gray); g.drawLine(x-av.charWidth,y2,(eRes-sRes+1)*av.charWidth,y2); - - if(aa.threshold!=null) - { - g.setColor(aa.threshold.colour); - Graphics2D g2 = (Graphics2D)g; - g2.setStroke(new BasicStroke(1, - BasicStroke.CAP_SQUARE, - BasicStroke.JOIN_ROUND, 3f, - new float[] { 5f, 3f }, 0f)); - - y2 = (int)(y - ((aa.threshold.value-min) / range)*graphHeight); - g.drawLine(x-av.charWidth,y2,(eRes-sRes)*av.charWidth,y2); - g2.setStroke(new BasicStroke()); - } - eRes = Math.min(eRes, aa.annotations.length); int column = sRes; @@ -1006,6 +991,19 @@ public class AnnotationPanel extends JPanel implements MouseListener, g.drawLine(x-av.charWidth/2, y1, x+av.charWidth/2, y2); x += av.charWidth; } + if(aa.threshold!=null) + { + g.setColor(aa.threshold.colour); + Graphics2D g2 = (Graphics2D)g; + g2.setStroke(new BasicStroke(1, + BasicStroke.CAP_SQUARE, + BasicStroke.JOIN_ROUND, 3f, + new float[] { 5f, 3f }, 0f)); + + y2 = (int)(y - ((aa.threshold.value-min) / range)*graphHeight); + g.drawLine(0,y2,(eRes-sRes)*av.charWidth,y2); + g2.setStroke(new BasicStroke()); + } } public void drawBarGraph(Graphics g, AlignmentAnnotation aa, @@ -1022,20 +1020,6 @@ public class AnnotationPanel extends JPanel implements MouseListener, float range = max - min; - if(aa.threshold!=null) - { - g.setColor(aa.threshold.colour); - Graphics2D g2 = (Graphics2D)g; - g2.setStroke(new BasicStroke(1, - BasicStroke.CAP_SQUARE, - BasicStroke.JOIN_ROUND, 3f, - new float[] { 5f, 3f }, 0f)); - - y2 = (int)(y - ((aa.threshold.value-min) / range)*aa.graphHeight); - g.drawLine(x-av.charWidth,y2,(eRes-sRes)*av.charWidth,y2); - g2.setStroke(new BasicStroke()); - } - y1 = y2 = y; if(min<0) @@ -1082,7 +1066,19 @@ public class AnnotationPanel extends JPanel implements MouseListener, x += av.charWidth; } + if(aa.threshold!=null) + { + g.setColor(aa.threshold.colour); + Graphics2D g2 = (Graphics2D)g; + g2.setStroke(new BasicStroke(1, + BasicStroke.CAP_SQUARE, + BasicStroke.JOIN_ROUND, 3f, + new float[] { 5f, 3f }, 0f)); + y2 = (int)(y - ((aa.threshold.value-min) / range)*aa.graphHeight); + g.drawLine(0,y2,(eRes-sRes)*av.charWidth,y2); + g2.setStroke(new BasicStroke()); + } } // used by overview window -- 1.7.10.2