annoation in print version
authoramwaterhouse <Andrew Waterhouse>
Wed, 6 Apr 2005 17:11:08 +0000 (17:11 +0000)
committeramwaterhouse <Andrew Waterhouse>
Wed, 6 Apr 2005 17:11:08 +0000 (17:11 +0000)
src/jalview/gui/AlignmentPanel.java

index 04b596a..b3ad3ad 100755 (executable)
@@ -203,6 +203,8 @@ public class AlignmentPanel extends GAlignmentPanel implements AdjustmentListene
     scalePanelHolder.setVisible(!wrap);\r
     hscroll.setVisible(!wrap);\r
     idwidthAdjuster.setVisible(!wrap);\r
+\r
+    av.setShowAnnotation(!wrap);\r
     annotationScroller.setVisible(!wrap);\r
     annotationSpaceFillerHolder.setVisible(!wrap);\r
     idSpaceFillerPanel1.setVisible(!wrap);\r
@@ -360,10 +362,17 @@ public class AlignmentPanel extends GAlignmentPanel implements AdjustmentListene
     if(overviewPanel!=null)\r
       overviewPanel.setBoxPosition();\r
 \r
-    seqPanel.seqCanvas.fastPaint(av.getStartRes()-oldX, av.getStartSeq()-oldY);\r
-    idPanel.idCanvas.fastPaint( av.getStartSeq()-oldY );\r
-    scalePanel.repaint();\r
-    annotationPanel.fastPaint(av.getStartRes()-oldX);\r
+    if(av.getWrapAlignment())\r
+      repaint();\r
+    else\r
+    {\r
+      seqPanel.seqCanvas.fastPaint(av.getStartRes() - oldX,\r
+                                   av.getStartSeq() - oldY);\r
+      idPanel.idCanvas.fastPaint(av.getStartSeq() - oldY);\r
+      scalePanel.repaint();\r
+      if (av.getShowAnnotation())\r
+        annotationPanel.fastPaint(av.getStartRes() - oldX);\r
+    }\r
 \r
   }\r
 \r
@@ -454,9 +463,17 @@ public class AlignmentPanel extends GAlignmentPanel implements AdjustmentListene
 \r
     // draw main sequence panel\r
     pg.translate(idWidth,0);\r
-    pg.setClip(0,0,pwidth-idWidth, pheight);\r
     seqPanel.seqCanvas.drawPanel(pg,startRes,endRes,startSeq,endSeq,startRes,startSeq,0);\r
 \r
+\r
+    if(av.getShowAnnotation())\r
+      {\r
+        pg.translate(-idWidth,(endSeq-startSeq)*av.charHeight);\r
+        alabels.drawComponent((Graphics2D)pg);\r
+        pg.translate(idWidth,0);\r
+        annotationPanel.drawComponent((Graphics2D) pg, startRes, endRes+1);\r
+      }\r
+\r
     return Printable.PAGE_EXISTS;\r
   }\r
 \r
@@ -530,6 +547,10 @@ public class AlignmentPanel extends GAlignmentPanel implements AdjustmentListene
       height = (av.alignment.getHeight()+1) * av.charHeight + 30;\r
       width = idPanel.getWidth() + av.alignment.getWidth() * av.charWidth;\r
     }\r
+    if(av.getShowAnnotation())\r
+   {\r
+     height += annotationPanel.getPreferredSize().height;\r
+   }\r
 \r
     try\r
     {\r
@@ -573,7 +594,13 @@ public class AlignmentPanel extends GAlignmentPanel implements AdjustmentListene
         width = idPanel.getWidth() + av.alignment.getWidth() * av.charWidth;\r
       }\r
 \r
+      if(av.getShowAnnotation())\r
+      {\r
+        height += annotationPanel.getPreferredSize().height;\r
+      }\r
+\r
 \r
+System.out.println(width +" "+height);\r
 \r
     try\r
     {\r