+ /**\r
+ * DOCUMENT ME!\r
+ *\r
+ * @param starty DOCUMENT ME!\r
+ * @param endy DOCUMENT ME!\r
+ */\r
+ void drawIds(int starty, int endy)\r
+ {\r
+ if(av.seqNameItalics)\r
+ idfont = new Font(av.getFont().getName(), Font.ITALIC,\r
+ av.getFont().getSize());\r
+ else\r
+ idfont = av.getFont();\r
+\r
+ gg.setFont(idfont);\r
+ fm = gg.getFontMetrics();\r
+\r
+ if (av.antiAlias)\r
+ gg.setRenderingHint(RenderingHints.KEY_ANTIALIASING,\r
+ RenderingHints.VALUE_ANTIALIAS_ON);\r
+\r
+ Color currentColor = Color.white;\r
+ Color currentTextColor = Color.black;\r
+\r
+ if (av.getWrapAlignment())\r
+ {\r
+ int maxwidth = av.alignment.getWidth();\r
+ int alheight = av.alignment.getHeight();\r
+\r
+ if (av.hasHiddenColumns)\r
+ maxwidth = av.getColumnSelection().findColumnPosition(maxwidth) - 1;\r
+\r
+ int annotationHeight = 0;\r
+\r
+\r
+ if(av.showAnnotation)\r
+ {\r
+ if (ap == null)\r
+ ap = new AnnotationPanel(av);\r
+\r
+ annotationHeight = ap.adjustPanelHeight();\r
+ if (labels == null)\r
+ labels = new AnnotationLabels(av);\r
+ }\r
+\r
+ int hgap = av.charHeight;\r
+ if (av.scaleAboveWrapped)\r
+ hgap += av.charHeight;\r
+\r
+ int cHeight = alheight * av.charHeight\r
+ + hgap\r
+ + annotationHeight;\r
+\r
+ int rowSize = av.getEndRes() - av.getStartRes();\r
+\r
+\r
+ // Draw the rest of the panels\r
+ for (int ypos = hgap, row = av.startRes;\r
+ (ypos <= getHeight()) && (row < maxwidth);\r
+ ypos += cHeight, row += rowSize)\r
+ {\r
+ for (int i = starty; i < alheight; i++)\r
+ {\r
+ SequenceI s = av.alignment.getSequenceAt(i);\r
+ if (av.hasHiddenRows)\r
+ {\r
+ setHiddenFont(s);\r
+ }\r
+ else\r
+ gg.setFont(idfont);\r
+\r
+ drawIdString(gg, s, i, 0, ypos);\r
+ }\r
+\r
+ if(labels!=null && av.showAnnotation)\r
+ {\r
+ gg.translate(0, ypos+(alheight * av.charHeight));\r
+ labels.drawComponent(gg, getWidth());\r
+ gg.translate(0, -ypos-(alheight * av.charHeight));\r
+ }\r
+ }\r
+ }\r
+ else\r
+ {\r
+ //No need to hang on to labels if we're not wrapped\r
+ labels = null;\r
+\r
+ //Now draw the id strings\r
+ int panelWidth = getWidth();\r
+ int xPos = 0;\r
+\r
+ SequenceI sequence;\r
+ //Now draw the id strings\r
+ for (int i = starty; i < endy; i++)\r
+ {\r
+ sequence = av.alignment.getSequenceAt(i);\r
+\r
+ if(sequence==null)\r
+ continue;\r
+\r
+ if (av.hasHiddenRows)\r
+ {\r
+ setHiddenFont(sequence);\r
+ }\r
+\r
+ // Selected sequence colours\r
+ if ( (searchResults != null) &&\r
+ searchResults.contains(sequence))\r
+ {\r
+ currentColor = Color.black;\r
+ currentTextColor = Color.white;\r
+ }\r
+ else if ( (av.getSelectionGroup() != null) &&\r
+ av.getSelectionGroup().getSequences(null).contains(\r
+ sequence))\r
+ {\r
+ currentColor = Color.lightGray;\r
+ currentTextColor = Color.black;\r
+ }\r
+ else\r
+ {\r
+ currentColor = av.getSequenceColour(sequence);\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 = sequence.getDisplayId( av.getShowJVSuffix());\r
+\r
+\r
+ if(av.rightAlignIds)\r
+ {\r
+ xPos = panelWidth - fm.stringWidth(string) - 4;\r
+ }\r
+\r
+ gg.drawString(string, xPos,\r
+ (((i - starty) * av.charHeight) + av.charHeight) -\r
+ (av.charHeight / 5));\r
+\r
+ if(av.hasHiddenRows && av.showHiddenMarkers)\r
+ drawMarker(i, starty, 0);\r
+\r
+ }\r
+\r
+ }\r
+ }\r