-\r
- // Selected sequence colours\r
- if (av.getSelection().contains(da.getSequenceAt(i)))\r
- {\r
- currentColor = Color.gray;\r
- currentTextColor = Color.black;\r
- }\r
- else\r
- {\r
- currentColor = da.getSequenceAt(i).getColor();\r
- currentTextColor = Color.black;\r
- }\r
-\r
- gg.setColor(currentColor);\r
-\r
-\r
-\r
- gg.fillRect(0,\r
- AlignmentUtil.getPixelHeight(starty,i,charHeight),\r
- getWidth(),\r
- charHeight);\r
-\r
- gg.setColor(currentTextColor);\r
-\r
- String string = da.getSequenceAt(i).getDisplayId();\r
-\r
- gg.drawString(string,0,AlignmentUtil.getPixelHeight(starty,i,charHeight) + charHeight- (charHeight/5));\r
- }\r
+ Color currentColor = Color.white;\r
+ Color currentTextColor = Color.black;\r
+\r
+ if (av.getWrapAlignment())\r
+ {\r
+ int rowSize = av.getEndRes() - av.getStartRes();\r
+\r
+ // Draw the rest of the panels\r
+ for (int ypos = 2 * av.charHeight, row = av.startRes;\r
+ (ypos <= getHeight()) && (row < av.alignment.getWidth());\r
+ ypos += av.chunkHeight, row += rowSize)\r
+ {\r
+ for (int i = starty; i < av.alignment.getHeight(); i++)\r
+ {\r
+ SequenceI s = av.alignment.getSequenceAt(i);\r
+ drawIdString(gg, s, i, 0, ypos);\r
+ }\r
+ }\r
+ }\r
+ else\r
+ {\r
+ //Now draw the id strings\r
+ for (int i = starty; i < endy; i++)\r
+ {\r
+ // Selected sequence colours\r
+ if ((searchResults != null) &&\r
+ searchResults.contains(av.alignment.getSequenceAt(i)))\r
+ {\r
+ gg.setColor(Color.black);\r
+ currentColor = Color.black;\r
+ currentTextColor = Color.white;\r
+ }\r
+ else if ((av.getSelectionGroup() != null) &&\r
+ av.getSelectionGroup().sequences.contains(\r
+ av.alignment.getSequenceAt(i)))\r
+ {\r
+ currentColor = Color.lightGray;\r
+ currentTextColor = Color.black;\r
+ }\r
+ else\r
+ {\r
+ currentColor = av.alignment.getSequenceAt(i).getColor();\r
+ currentTextColor = Color.black;\r
+ }\r
+\r
+ gg.setColor(currentColor);\r
+\r
+ gg.fillRect(0, (i - starty) * av.charHeight, getWidth(),\r
+ av.charHeight);\r
+\r
+ gg.setColor(currentTextColor);\r
+\r
+ String string = av.alignment.getSequenceAt(i).getName();\r
+\r
+ if (av.getShowFullId())\r
+ {\r
+ string = av.alignment.getSequenceAt(i).getDisplayId();\r
+ }\r
+\r
+ gg.drawString(string, 0,\r
+ (((i - starty) * av.charHeight) + av.charHeight) -\r
+ (av.charHeight / 5));\r
+ }\r
+\r
+ // add a border\r
+ gg.setColor(Color.white);\r
+ gg.fillRect(getWidth() - 4, 0, 4, getHeight());\r
+ }\r