- pg.drawString(
- seq.getDisplayId(av.getShowJVSuffix()),
- xPos,
- (((i - startSeq) * av.charHeight) + av.getCharHeight())
- - (av.getCharHeight() / 5));
- }
-
- pg.setFont(av.getFont());
-
- // draw main sequence panel
- pg.translate(idWidth, 0);
- seqPanel.seqCanvas.drawPanel(pg, startRes, endRes, startSeq, endSeq, 0);
-
- if (av.showAnnotation && (endSeq == av.getAlignment().getHeight()))
- {
- // draw annotation - need to offset for current scroll position
- int offset=-alabels.scrollOffset;
- pg.translate(0, offset);
- pg.translate(-idWidth - 3, (endSeq - startSeq) * av.charHeight + 3);
- alabels.drawComponent((Graphics2D) pg, idWidth);
- pg.translate(idWidth + 3, 0);
- annotationPanel.renderer.drawComponent(annotationPanel, av, (Graphics2D) pg, -1, startRes, endRes + 1);
- pg.translate(0, -offset);
+ idGraphics.drawString(displayId, xPos,
+ (((i - startSeq) * charHeight) + charHeight)
+ - (charHeight / 5));
+ }
+ idGraphics.setFont(av.getFont());
+ idGraphics.translate(0, -scaleHeight);
+
+ /*
+ * draw the sequences, offset for scale height, and id width (if using a
+ * single graphics context), then reset to (0, scale height)
+ */
+ alignmentGraphics.translate(alignmentGraphicsOffset, scaleHeight);
+ getSeqPanel().seqCanvas.drawPanel(alignmentGraphics, startRes, endRes,
+ startSeq, endSeq, 0);
+ alignmentGraphics.translate(-alignmentGraphicsOffset, 0);
+
+ if (av.isShowAnnotation() && (endSeq == alignmentHeight))
+ {
+ /*
+ * draw annotation labels; drawComponent() translates by
+ * getScrollOffset(), so compensate for that first;
+ * then reset to (0, scale height)
+ */
+ int offset = getAlabels().getScrollOffset();
+ idGraphics.translate(0, -offset);
+ idGraphics.translate(0, alignmentDrawnHeight);
+ getAlabels().drawComponent(idGraphics, idWidth);
+ idGraphics.translate(0, -alignmentDrawnHeight);
+
+ /*
+ * draw the annotations starting at
+ * (idOffset, alignmentHeight) from (0, scaleHeight)
+ */
+ alignmentGraphics.translate(alignmentGraphicsOffset, alignmentDrawnHeight);
+ getAnnotationPanel().renderer.drawComponent(getAnnotationPanel(), av,
+ alignmentGraphics, -1, startRes, endRes + 1);