From: amwaterhouse Date: Thu, 16 Mar 2006 15:30:13 +0000 (+0000) Subject: -1 to drawGraphs X-Git-Tag: Root_VamJalview_2_07b+~38 X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=e25f63a72efddff9e071abdeff0ae5599431e4f8;p=jalview.git -1 to drawGraphs --- diff --git a/src/jalview/gui/AnnotationPanel.java b/src/jalview/gui/AnnotationPanel.java index 0213565..e962bdf 100755 --- a/src/jalview/gui/AnnotationPanel.java +++ b/src/jalview/gui/AnnotationPanel.java @@ -24,8 +24,6 @@ import java.awt.*; import java.awt.event.*; import java.awt.image.*; -import java.util.*; - import javax.swing.*; @@ -883,6 +881,8 @@ public class AnnotationPanel extends JPanel implements MouseListener, if(sRes>aa.annotations.length) return; + eRes = Math.min(eRes, aa.annotations.length); + int x = 0; //Adjustment for fastpaint to left @@ -916,7 +916,7 @@ public class AnnotationPanel extends JPanel implements MouseListener, new float[] { 5f, 3f }, 0f)); y2 = (int)(y - ((aa.threshold.value-min) / range)*graphHeight); - g.drawLine(x-av.charWidth,y2,(eRes-sRes+1)*av.charWidth,y2); + g.drawLine(x-av.charWidth,y2,(eRes-sRes)*av.charWidth,y2); g2.setStroke(new BasicStroke()); } @@ -963,6 +963,8 @@ public class AnnotationPanel extends JPanel implements MouseListener, if(sRes>aa.annotations.length) return; + eRes = Math.min(eRes, aa.annotations.length); + int x=0, y1, y2; float range = max - min; @@ -977,7 +979,7 @@ public class AnnotationPanel extends JPanel implements MouseListener, new float[] { 5f, 3f }, 0f)); y2 = (int)(y - ((aa.threshold.value-min) / range)*aa.graphHeight); - g.drawLine(x-av.charWidth,y2,(eRes-sRes+1)*av.charWidth,y2); + g.drawLine(x-av.charWidth,y2,(eRes-sRes)*av.charWidth,y2); g2.setStroke(new BasicStroke()); } @@ -988,7 +990,7 @@ public class AnnotationPanel extends JPanel implements MouseListener, g.setColor(Color.gray); - g.drawLine(x,y2,(eRes-sRes+1)*av.charWidth,y2); + g.drawLine(x,y2,(eRes-sRes)*av.charWidth,y2); int column = sRes;