public void adjustPanelHeight()\r
{\r
// setHeight of panels\r
+ image = null;\r
AlignmentAnnotation[] aa = av.alignment.getAlignmentAnnotation();\r
int height = 0;\r
\r
if (activeRow == -1)\r
{\r
AlignmentAnnotation[] aa = av.alignment.getAlignmentAnnotation();\r
+ if(aa==null)\r
+ return;\r
\r
for (int j = 0; j < aa.length; j++)\r
{\r
if (activeRow == -1)\r
{\r
AlignmentAnnotation[] aa = av.alignment.getAlignmentAnnotation();\r
+ if(aa==null)\r
+ return;\r
\r
for (int j = 0; j < aa.length; j++)\r
{\r
\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
\r
imgWidth = (av.endRes - av.startRes + 1) * av.charWidth;\r
\r
- if (image != null && imgWidth == image.getWidth())\r
+ if (image == null || imgWidth != image.getWidth())\r
{\r
- //This will be called by a mouse over, tool tip etc\r
- // no need to redraw whole image\r
- g.drawImage(image, 0, 0, this);\r
- fastPaint = false;\r
- return;\r
+ image = new BufferedImage(imgWidth, ap.annotationPanel.getHeight(),\r
+ BufferedImage.TYPE_INT_RGB);\r
+ gg = (Graphics2D) image.getGraphics();\r
+ gg.setRenderingHint(RenderingHints.KEY_ANTIALIASING,\r
+ RenderingHints.VALUE_ANTIALIAS_ON);\r
+\r
+ gg.setFont(av.getFont());\r
+ fm = gg.getFontMetrics();\r
}\r
\r
- image = new BufferedImage(imgWidth, ap.annotationPanel.getHeight(),\r
- BufferedImage.TYPE_INT_RGB);\r
- gg = (Graphics2D) image.getGraphics();\r
- gg.setRenderingHint(RenderingHints.KEY_ANTIALIASING,\r
- RenderingHints.VALUE_ANTIALIAS_ON);\r
-\r
- gg.setFont(av.getFont());\r
- fm = gg.getFontMetrics();\r
-\r
drawComponent(gg, av.startRes, av.endRes + 1);\r
g.drawImage(image, 0, 0, this);\r
}\r
continue;\r
}\r
\r
+\r
if (row.isGraph)\r
{\r
// this is so that we draw the characters below the graph\r
}\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
g.setColor(new Color(0, 0, 180));\r
\r
- int x = 0;\r
\r
- for (int j = 0; j < aa.annotations.length; j++)\r
+ int x = 0, height;\r
+\r
+ for (int j = sRes; j < eRes; j++)\r
{\r
g.setColor(new Color(0, 0, 180));\r
\r
- int height = (int) ((aa.annotations[j].value / aa.graphMax) * GRAPH_HEIGHT);\r
+ height = (int) ((aa.annotations[j].value / aa.graphMax) * GRAPH_HEIGHT);\r
+ if(height>y)\r
+ height = y;\r
+\r
g.fillRect(x, y - height, av.charWidth, height);\r
x += av.charWidth;\r
}\r