Correct mouse pressed bug
authoramwaterhouse <Andrew Waterhouse>
Thu, 8 Sep 2005 15:48:45 +0000 (15:48 +0000)
committeramwaterhouse <Andrew Waterhouse>
Thu, 8 Sep 2005 15:48:45 +0000 (15:48 +0000)
src/jalview/gui/AnnotationPanel.java

index 8a262d9..9c2aac0 100755 (executable)
@@ -92,6 +92,7 @@ public class AnnotationPanel extends JPanel implements MouseListener,
     public void adjustPanelHeight()\r
     {\r
         // setHeight of panels\r
+        image = null;\r
         AlignmentAnnotation[] aa = av.alignment.getAlignmentAnnotation();\r
         int height = 0;\r
 \r
@@ -332,7 +333,10 @@ public class AnnotationPanel extends JPanel implements MouseListener,
 \r
         for (int i = 0; i < aa.length; i++)\r
         {\r
-            height += aa[i].height;\r
+            if (aa[i].visible)\r
+            {\r
+              height += aa[i].height;\r
+            }\r
 \r
             if (evt.getY() < height)\r
             {\r
@@ -634,6 +638,7 @@ public class AnnotationPanel extends JPanel implements MouseListener,
                 continue;\r
             }\r
 \r
+\r
             if (row.isGraph)\r
             {\r
                 // this is so that we draw the characters below the graph\r
@@ -841,7 +846,7 @@ public class AnnotationPanel extends JPanel implements MouseListener,
     }\r
 \r
     // used by overview window\r
-    public void drawGraph(Graphics g, AlignmentAnnotation aa, int width, int y)\r
+    public void drawGraph(Graphics g, AlignmentAnnotation aa, int width, int y, int sRes, int eRes)\r
     {\r
         g.setColor(Color.white);\r
         g.fillRect(0, 0, width, y);\r
@@ -849,7 +854,7 @@ public class AnnotationPanel extends JPanel implements MouseListener,
 \r
         int x = 0;\r
 \r
-        for (int j = 0; j < aa.annotations.length; j++)\r
+        for (int j = sRes; j < eRes; j++)\r
         {\r
             g.setColor(new Color(0, 0, 180));\r
 \r