+ /**\r
+ * DOCUMENT ME!\r
+ *\r
+ * @param pg DOCUMENT ME!\r
+ * @param pwidth DOCUMENT ME!\r
+ * @param pheight DOCUMENT ME!\r
+ * @param pi DOCUMENT ME!\r
+ *\r
+ * @return DOCUMENT ME!\r
+ *\r
+ * @throws PrinterException DOCUMENT ME!\r
+ */\r
+ public int printUnwrapped(Graphics pg, int pwidth, int pheight, int pi)\r
+ throws PrinterException\r
+ {\r
+ int idWidth = calculateIdWidth().width + 4;\r
+ FontMetrics fm = getFontMetrics(av.getFont());\r
+ int scaleHeight = av.charHeight + fm.getDescent();\r
+\r
+ pg.setColor(Color.white);\r
+ pg.fillRect(0, 0, pwidth, pheight);\r
+ pg.setFont(av.getFont());\r
+\r
+ ////////////////////////////////////\r
+ /// How many sequences and residues can we fit on a printable page?\r
+ int totalRes = (pwidth - idWidth) / av.getCharWidth();\r
+\r
+ int totalSeq = (int) ((pheight - scaleHeight) / av.getCharHeight()) -\r
+ 1;\r
+\r
+ int pagesWide = (av.getAlignment().getWidth() / totalRes) + 1;\r
+\r
+ /////////////////////////////\r
+ /// Only print these sequences and residues on this page\r
+ int startRes;\r
+\r
+ /////////////////////////////\r
+ /// Only print these sequences and residues on this page\r
+ int endRes;\r
+\r
+ /////////////////////////////\r
+ /// Only print these sequences and residues on this page\r
+ int startSeq;\r
+\r
+ /////////////////////////////\r
+ /// Only print these sequences and residues on this page\r
+ int endSeq;\r
+ startRes = (pi % pagesWide) * totalRes;\r
+ endRes = (startRes + totalRes) - 1;\r
+\r
+ if (endRes > (av.getAlignment().getWidth() - 1))\r
+ {\r
+ endRes = av.getAlignment().getWidth() - 1;\r
+ }\r
+\r
+ startSeq = (pi / pagesWide) * totalSeq;\r
+ endSeq = startSeq + totalSeq;\r
+\r
+ if (endSeq > av.getAlignment().getHeight())\r
+ {\r
+ endSeq = av.getAlignment().getHeight();\r
+ }\r
+\r
+ int pagesHigh = ((av.alignment.getHeight() / totalSeq) + 1) * pheight;\r
+\r
+ if (av.showAnnotation)\r
+ {\r
+ pagesHigh += annotationPanel.getHeight();\r
+ }\r
+\r
+ pagesHigh /= pheight;\r
+\r
+ if (pi >= (pagesWide * pagesHigh))\r
+ {\r
+ return Printable.NO_SUCH_PAGE;\r
+ }\r
+\r
+ //draw Scale\r
+ pg.translate(idWidth, 0);\r
+ scalePanel.drawScale(pg, startRes, endRes, pwidth - idWidth, scaleHeight);\r
+ pg.translate(-idWidth, scaleHeight);\r
+\r
+ ////////////////\r
+ // Draw the ids\r
+ Color currentColor = null;\r
+ Color currentTextColor = null;\r
+\r
+ for (int i = startSeq; i < endSeq; i++)\r
+ {\r
+ if ((av.getSelectionGroup() != null) &&\r
+ av.getSelectionGroup().sequences.contains(\r
+ av.getAlignment().getSequenceAt(i)))\r
+ {\r
+ currentColor = Color.gray;\r
+ currentTextColor = Color.black;\r
+ }\r
+ else\r
+ {\r
+ currentColor = av.getAlignment().getSequenceAt(i).getColor();\r
+ currentTextColor = Color.black;\r
+ }\r