- x = 0;\r
- while(x < endRes-startRes)\r
- {\r
- if (av.hasHiddenColumns)\r
- {\r
- column = av.getColumnSelection().adjustForHiddenColumns(startRes+x);\r
- if (column > row.annotations.length-1)\r
- {\r
- break;\r
- }\r
- }\r
- else\r
- column = startRes+x;\r
-\r
- if ( (row.annotations.length <= column) ||\r
- (row.annotations[column] == null))\r
- {\r
- validRes = false;\r
- }\r
- else\r
- {\r
- validRes = true;\r
- }\r
-\r
-\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
- 0))) / 2;\r
- g.setColor(row.annotations[column].colour);\r
-\r
- if (column == 0 || row.graph>0)\r
- {\r
- g.drawString(row.annotations[column].displayCharacter,\r
- (x*av.charWidth)+charOffset,\r
- y + iconOffset + 3);\r
- }\r
- else if (\r
- row.annotations[column - 1] == null\r
- ||(!row.annotations[column].displayCharacter.equals(\r
- row.annotations[column - 1].displayCharacter)\r
- ||\r
- (row.annotations[column].displayCharacter.length() <2 &&\r
- row.annotations[column].secondaryStructure==' ')))\r
- {\r
- g.drawString(row.annotations[column].displayCharacter,\r
- (x*av.charWidth)+charOffset,\r
- y + iconOffset + 3);\r
- }\r
- }\r
-\r
- if (row.hasIcons)\r
- {\r
- if (!validRes ||\r
- (row.annotations[column].secondaryStructure != lastSS))\r
- {\r
- switch (lastSS)\r
- {\r
- case 'H':\r
- g.setColor(HELIX_COLOUR);\r
- if (MAC)\r
- {\r
- //Off by 1 offset when drawing rects and ovals\r
- //to offscreen image on the MAC\r
- g.fillRoundRect(lastSSX, y + 4 + iconOffset,\r
- (x*av.charWidth) - lastSSX, 7, 8, 8);\r
- break;\r
- }\r
-\r
- int sCol = (lastSSX / av.charWidth) + startRes;\r
- int x1 = lastSSX;\r
- int x2 = (x*av.charWidth);\r
-\r
- if(sCol==0 ||\r
- row.annotations[sCol-1]==null ||\r
- row.annotations[sCol-1].secondaryStructure!='H')\r
- {\r
- g.fillArc(lastSSX, y+4+iconOffset, av.charWidth, 8, 90,180) ;\r
- x1 += av.charWidth/2;\r
- }\r
-\r
- if(row.annotations[column]==null ||\r
- row.annotations[column].secondaryStructure!='H')\r
- {\r
- g.fillArc((x*av.charWidth)-av.charWidth,\r
- y+4+iconOffset, av.charWidth, 8, 270,180);\r
- x2 -= av.charWidth/2;\r
- }\r
-\r
- g.fillRect(x1, y+4+iconOffset, x2-x1, 8);\r
- break;\r
-\r
- case 'E':\r
- g.setColor(SHEET_COLOUR);\r
- g.fillRect(lastSSX, y + 4 + iconOffset,\r
- (x*av.charWidth) - lastSSX - 4, 7);\r
- g.fillPolygon(new int[] { (x*av.charWidth) - 4,\r
- (x*av.charWidth) - 4,\r
- (x*av.charWidth) },\r
- new int[]\r
- {\r
- y + iconOffset, y + 14 + iconOffset,\r
- y + 8 + iconOffset\r
- }, 3);\r
-\r
- break;\r
-\r
-\r
- default:\r
- g.setColor(Color.gray);\r
- g.fillRect(lastSSX, y + 6 + iconOffset,\r
- (x*av.charWidth) - lastSSX, 2);\r
-\r
- break;\r
- }\r
-\r
- if (validRes)\r
- {\r
- lastSS = row.annotations[column].secondaryStructure;\r
- }\r
- else\r
- {\r
- lastSS = ' ';\r
- }\r
-\r
- lastSSX = (x*av.charWidth);\r
- }\r
- }\r