set PNG antialiasing on
authoramwaterhouse <Andrew Waterhouse>
Mon, 18 Apr 2005 16:02:27 +0000 (16:02 +0000)
committeramwaterhouse <Andrew Waterhouse>
Mon, 18 Apr 2005 16:02:27 +0000 (16:02 +0000)
src/jalview/gui/AlignmentPanel.java

index 02330a5..f1874b1 100755 (executable)
@@ -285,6 +285,8 @@ public class AlignmentPanel extends GAlignmentPanel implements AdjustmentListene
 \r
   public void setScrollValues(int x, int y)\r
   {\r
+    av.setEndRes(x + seqPanel.seqCanvas.getWidth()/av.getCharWidth()-1);\r
+\r
     hextent = seqPanel.seqCanvas.getWidth()/av.charWidth;\r
     vextent = seqPanel.seqCanvas.getHeight()/av.charHeight;\r
 \r
@@ -308,6 +310,8 @@ public class AlignmentPanel extends GAlignmentPanel implements AdjustmentListene
     hscroll.setValues(x,hextent,0,av.getAlignment().getWidth());\r
     vscroll.setValues(y,vextent,0,av.getAlignment().getHeight() );\r
 \r
+\r
+\r
   }\r
 \r
 \r
@@ -339,7 +343,6 @@ public class AlignmentPanel extends GAlignmentPanel implements AdjustmentListene
       }\r
     }\r
 \r
-\r
     if(overviewPanel!=null)\r
       overviewPanel.setBoxPosition();\r
 \r
@@ -515,15 +518,14 @@ public class AlignmentPanel extends GAlignmentPanel implements AdjustmentListene
 \r
     ////////////////\r
     // Draw the ids\r
-    pg.setClip(0,0,pwidth, noChunksOnPage*chunkHeight);\r
+//    pg.setClip(0,0,pwidth, noChunksOnPage*chunkHeight);\r
 \r
     pg.setColor(Color.black);\r
 \r
     int rowSize =  av.getEndRes() - av.getStartRes();\r
-    // Draw the rest of the panels\r
-\r
-    for(int ypos=2*av.charHeight, row=av.getEndRes(); row<av.alignment.getWidth();\r
-        ypos += av.chunkHeight, row+=rowSize )\r
+    for(int ypos=2*av.charHeight, row=av.getEndRes()-rowSize;\r
+              ypos <= pheight && row<av.alignment.getWidth();\r
+              ypos += av.chunkHeight, row+=rowSize )\r
     {\r
       for (int i = 0; i < endy; i++)\r
       {\r
@@ -611,7 +613,6 @@ public class AlignmentPanel extends GAlignmentPanel implements AdjustmentListene
       }\r
 \r
 \r
-System.out.println(width +" "+height);\r
 \r
     try\r
     {\r
@@ -629,8 +630,9 @@ System.out.println(width +" "+height);
       FileOutputStream out = new FileOutputStream(chooser.getSelectedFile());\r
 \r
       BufferedImage bi = new BufferedImage(width, height, BufferedImage.TYPE_INT_RGB);\r
-      Graphics png = bi.getGraphics();\r
+      Graphics2D png = (Graphics2D)bi.getGraphics();\r
 \r
+      png.setRenderingHint(RenderingHints.KEY_ANTIALIASING,RenderingHints.VALUE_ANTIALIAS_ON);\r
 \r
         if (av.getWrapAlignment())\r
           printWrappedAlignment(png, width, height, 0);\r