From dd6cfbc651f3c57bbf492737ba790c6479a96b62 Mon Sep 17 00:00:00 2001 From: amwaterhouse Date: Mon, 15 May 2006 14:52:26 +0000 Subject: [PATCH] Brackets around orgin calculation --- src/jalview/appletgui/AnnotationPanel.java | 4 ++-- src/jalview/gui/AnnotationPanel.java | 8 ++++++-- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/src/jalview/appletgui/AnnotationPanel.java b/src/jalview/appletgui/AnnotationPanel.java index 1bf3d38..71f51ea 100755 --- a/src/jalview/appletgui/AnnotationPanel.java +++ b/src/jalview/appletgui/AnnotationPanel.java @@ -624,7 +624,7 @@ public class AnnotationPanel ////Draw origin if(min<0) - y2 = (int)(y - (0-min / range)*graphHeight); + y2 = y - (int)((0-min / range)*graphHeight); g.setColor(Color.gray); g.drawLine(x-av.charWidth,y2,(eRes-sRes)*av.charWidth,y2); @@ -672,7 +672,7 @@ public class AnnotationPanel y1 = y2 = y; if(min<0) - y2 = (int)(y - (0-min / (range))*aa.graphHeight); + y2 = y -(int)( (0-min / (range))*aa.graphHeight); g.setColor(Color.gray); diff --git a/src/jalview/gui/AnnotationPanel.java b/src/jalview/gui/AnnotationPanel.java index fc7232e..add3209 100755 --- a/src/jalview/gui/AnnotationPanel.java +++ b/src/jalview/gui/AnnotationPanel.java @@ -1018,7 +1018,7 @@ public class AnnotationPanel extends JPanel implements MouseListener, ////Draw origin if(min<0) - y2 = (int)(y - (0-min / range)*graphHeight); + y2 = y - (int)((0-min / range)*graphHeight); g.setColor(Color.gray); g.drawLine(x-av.charWidth,y2,(eRes-sRes+1)*av.charWidth,y2); @@ -1046,12 +1046,16 @@ public class AnnotationPanel extends JPanel implements MouseListener, continue; } + g.setColor(aa.annotations[column].colour); y1 = y - (int) (((aa.annotations[column-1].value-min) / range) * graphHeight); y2 = y - (int) (((aa.annotations[column].value-min) / range) * graphHeight); g.drawLine(x-av.charWidth/2, y1, x+av.charWidth/2, y2); x += av.charWidth; + if(aa.annotations[column].value==0) + System.out.println(y1+" "+y2); + column++; } @@ -1087,7 +1091,7 @@ public class AnnotationPanel extends JPanel implements MouseListener, y1 = y2 = y; if(min<0) - y2 = (int)(y - (0-min / (range))*aa.graphHeight); + y2 = y - (int)((0-min / (range))*aa.graphHeight); g.setColor(Color.gray); -- 1.7.10.2