-
- // draw Scale
- pg.translate(idWidth, 0);
- scalePanel.drawScale(pg, startRes, endRes, pwidth - idWidth,
- scaleHeight);
- pg.translate(-idWidth, scaleHeight);
-
- // //////////////
- // Draw the ids
- Color currentColor = null;
- Color currentTextColor = null;
-
- pg.setFont(idPanel.idCanvas.idfont);
-
- SequenceI seq;
- for (int i = startSeq; i < endSeq; i++)
+ final int alignmentDrawnHeight = (endSeq - startSeq) * charHeight + 3;
+
+ /*
+ * draw the Scale at horizontal offset, then reset to top left (0, 0)
+ */
+ alignmentGraphics.translate(alignmentGraphicsOffset, 0);
+ getScalePanel().drawScale(alignmentGraphics, startRes, endRes,
+ pageWidth - idWidth, scaleHeight);
+ alignmentGraphics.translate(-alignmentGraphicsOffset, 0);
+
+ /*
+ * Draw the sequence ids, offset for scale height,
+ * then reset to top left (0, 0)
+ */
+ idGraphics.translate(0, scaleHeight);
+ IdCanvas idCanvas = getIdPanel().getIdCanvas();
+ List<SequenceI> selection = av.getSelectionGroup() == null ? null
+ : av.getSelectionGroup().getSequences(null);
+ idCanvas.drawIds((Graphics2D) idGraphics, av, startSeq, endSeq - 1,
+ selection);
+
+ 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.drawPanelForPrinting(alignmentGraphics, startRes,
+ endRes, startSeq, endSeq - 1);
+ alignmentGraphics.translate(-alignmentGraphicsOffset, 0);
+
+ if (av.isShowAnnotation() && (endSeq == alignmentHeight))