\r
this.ap = ap;\r
av = ap.av;\r
- this.setLayout(null);\r
+ setLayout(null);\r
adjustPanelHeight();\r
\r
addMouseMotionListener(new MouseMotionAdapter()\r
}\r
\r
this.setSize(getSize().width, height);\r
- if(ap!=null)\r
- ap.annotationScroller.setSize(getSize().width, height);\r
-\r
\r
repaint();\r
\r
\r
public void paint(Graphics g)\r
{\r
+\r
+\r
imgWidth = (av.endRes - av.startRes + 1) * av.charWidth;\r
\r
if (image == null || imgWidth != image.getWidth(this))\r
}\r
\r
drawComponent(gg, av.startRes, av.endRes + 1);\r
+ g.setColor(Color.white);\r
+ g.fillRect(0, 0, getSize().width, getSize().height);\r
g.drawImage(image, 0, 0, this);\r
}\r
\r
g.setColor(Color.white);\r
g.fillRect(0, 0, getSize().width, getSize().height);\r
g.setColor(Color.black);\r
- g.drawString("Alignment has no annotations", 20, 15);\r
+ if(av.validCharWidth)\r
+ g.drawString("Alignment has no annotations", 20, 15);\r
\r
return;\r
}\r
\r
AlignmentAnnotation[] aa = av.alignment.getAlignmentAnnotation();\r
\r
- int j;\r
int x = 0;\r
int y = 0;\r
char lastSS;\r
x = (column - startRes) * av.charWidth;\r
\r
\r
- if (validRes &&\r
- (row.annotations[column].displayCharacter.length() > 0))\r
+ if (av.validCharWidth && validRes &&\r
+ (row.annotations[column].displayCharacter.length() > 0))\r
{\r
int charOffset = (av.charWidth -\r
fm.charWidth(row.annotations[column].displayCharacter.charAt(\r
column++;\r
}\r
\r
+ if(column>=row.annotations.length)\r
+ column = row.annotations.length-1;\r
+\r
x += av.charWidth;\r
\r
if (row.hasIcons)\r
case 'E':\r
g.setColor(SHEET_COLOUR);\r
\r
- if (row.annotations.length > endRes\r
- && row.annotations[endRes].secondaryStructure != 'E')\r
+ if (row.annotations[endRes] ==null\r
+ || row.annotations[endRes].secondaryStructure != 'E')\r
{\r
g.fillRect(lastSSX, y + 4 + iconOffset,\r
x - lastSSX - 4, 7);\r
\r
////Draw origin\r
if(min<0)\r
- y2 = (int)(y - (0-min / range)*graphHeight);\r
+ y2 = y - (int)((0-min / range)*graphHeight);\r
\r
g.setColor(Color.gray);\r
g.drawLine(x-av.charWidth,y2,(eRes-sRes)*av.charWidth,y2);\r
y1 = y2 = y;\r
\r
if(min<0)\r
- y2 = (int)(y - (0-min / (range))*aa.graphHeight);\r
+ y2 = y -(int)( (0-min / (range))*aa.graphHeight);\r
\r
g.setColor(Color.gray);\r
\r