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
g.setColor(Color.white);\r
g.fillRect(0, 0, getWidth(), getHeight());\r
\r
- if (fastPaint)\r
+ if (fastPaint && image!=null)\r
{\r
g.drawImage(image, 0, 0, this);\r
fastPaint = false;\r
*/\r
public void drawComponent(Graphics2D g, int startRes, int endRes)\r
{\r
+ if (fm == null)\r
+ fm = g.getFontMetrics();\r
+\r
+ if(fm==null)\r
+ fm = g.getFontMetrics();\r
+\r
g.setColor(Color.white);\r
g.fillRect(0, 0, (endRes - startRes) * av.charWidth, getHeight());\r
\r
g.fillRect(0, 0, width, y);\r
g.setColor(new Color(0, 0, 180));\r
\r
- int x = 0;\r
+\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