public class AlignmentPanel extends GAlignmentPanel\r
implements AdjustmentListener, Printable\r
{\r
- AlignViewport av;\r
+ public AlignViewport av;\r
OverviewPanel overviewPanel;\r
SeqPanel seqPanel;\r
IdPanel idPanel;\r
});\r
}\r
\r
+\r
/**\r
* DOCUMENT ME!\r
*/\r
\r
if (av.showAnnotation)\r
{\r
- pagesHigh += annotationPanel.getHeight();\r
+ pagesHigh += annotationPanel.adjustPanelHeight()+3;\r
}\r
\r
pagesHigh /= pheight;\r
\r
if (av.showAnnotation && (endSeq == av.alignment.getHeight()))\r
{\r
- pg.translate(-idWidth, (endSeq - startSeq) * av.charHeight);\r
+ pg.translate(-idWidth, (endSeq - startSeq) * av.charHeight +3);\r
alabels.drawComponent((Graphics2D) pg);\r
pg.translate(idWidth, 0);\r
annotationPanel.drawComponent((Graphics2D) pg, startRes, endRes +\r
public int printWrappedAlignment(Graphics pg, int pwidth, int pheight,\r
int pi) throws PrinterException\r
{\r
- int idWidth = calculateIdWidth().width + 4;\r
+\r
+ int annotationHeight = 0;\r
+ if (av.showAnnotation)\r
+ annotationHeight = annotationPanel.adjustPanelHeight();\r
+\r
+ int hgap = av.charHeight;\r
+ if (av.scaleAboveWrapped)\r
+ hgap += av.charHeight;\r
+\r
+ int cHeight = av.getAlignment().getHeight() * av.charHeight\r
+ + hgap\r
+ + annotationHeight;\r
+\r
+\r
+ int idWidth = calculateIdWidth().width + 4;\r
\r
int resWidth = seqPanel.seqCanvas.getWrappedCanvasWidth(pwidth -\r
idWidth);\r
- int totalHeight = totalHeight = (av.alignment.getHeight() + 2) * ((av.alignment.getWidth() / resWidth) +\r
- 1) * av.charHeight;\r
+\r
+ int totalHeight = cHeight * (av.alignment.getWidth() / resWidth +1);\r
\r
pg.setColor(Color.white);\r
pg.fillRect(0, 0, pwidth, pheight);\r
pg.setFont(av.getFont());\r
\r
+\r
////////////////\r
// Draw the ids\r
pg.setColor(Color.black);\r
\r
pg.setClip(0, pi * pheight, pwidth, pheight);\r
\r
- int ypos = 2 * av.charHeight;\r
+ int ypos = hgap;\r
\r
do\r
{\r
(av.charHeight / 5));\r
}\r
\r
- ypos += ((av.alignment.getHeight() + 2) * av.charHeight);\r
+ ypos += cHeight;\r
}\r
while (ypos < totalHeight);\r
\r
if ((pi * pheight) < totalHeight)\r
{\r
return Printable.PAGE_EXISTS;\r
+\r
}\r
- else\r
+ else\r
{\r
return Printable.NO_SUCH_PAGE;\r
}\r
chooser.getSelectedFile().getParent());\r
}\r
\r
+\r
int height = ( (av.alignment.getHeight() + 1) * av.charHeight) + 30;\r
int width = idPanel.getWidth() + (av.alignment.getWidth() * av.charWidth);\r
\r
+\r
if (av.getWrapAlignment())\r
{\r
- height = ( (av.alignment.getWidth() / av.getChunkWidth()) + 1) *\r
- av.chunkHeight;\r
+ height = getWrappedHeight();\r
width = seqPanel.getWidth() + idPanel.getWidth();\r
-\r
}\r
-\r
-\r
- if (av.getShowAnnotation())\r
+ else if (av.getShowAnnotation())\r
{\r
- height += annotationPanel.getPreferredSize().height;\r
+ height += annotationPanel.adjustPanelHeight()+3;\r
}\r
\r
+\r
try\r
{\r
FileOutputStream out = new FileOutputStream(epsFile);\r
\r
}\r
\r
+ int getWrappedHeight()\r
+ {\r
+\r
+ int chunkWidth = seqPanel.seqCanvas.getWrappedCanvasWidth(\r
+ seqPanel.seqCanvas.getWidth());\r
+\r
+ int hgap = av.charHeight;\r
+ if (av.scaleAboveWrapped)\r
+ hgap += av.charHeight;\r
+\r
+ int annotationHeight = 0;\r
+ if (av.showAnnotation)\r
+ {\r
+ annotationHeight = annotationPanel.adjustPanelHeight();\r
+ }\r
+\r
+ int cHeight = av.getAlignment().getHeight() * av.charHeight\r
+ + hgap\r
+ + annotationHeight;\r
+\r
+\r
+ int height = ( (av.alignment.getWidth() / chunkWidth) + 1) * cHeight;\r
+\r
+ return height;\r
+ }\r
+\r
/**\r
* DOCUMENT ME!\r
*/\r
\r
if (av.getWrapAlignment())\r
{\r
- height = ( (av.alignment.getWidth() / av.getChunkWidth()) + 1) *\r
- av.chunkHeight;\r
+ height = getWrappedHeight();\r
width = seqPanel.getWidth() + idPanel.getWidth();\r
-\r
}\r
-\r
-\r
- if (av.getShowAnnotation())\r
+ else if (av.getShowAnnotation())\r
{\r
- height += annotationPanel.getPreferredSize().height;\r
+ height += annotationPanel.adjustPanelHeight()+3;\r
}\r
\r
try\r