xmlgraphics-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jerem...@apache.org
Subject svn commit: r592340 - in /xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/java2d/ps: AbstractPSDocumentGraphics2D.java PSDocumentGraphics2D.java PSGraphics2D.java
Date Tue, 06 Nov 2007 09:04:05 GMT
Author: jeremias
Date: Tue Nov  6 01:04:04 2007
New Revision: 592340

URL: http://svn.apache.org/viewvc?rev=592340&view=rev
Log:
Page header wasn't generated in certain situations which resulted in the graphic being top-down.

Modified:
    xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/java2d/ps/AbstractPSDocumentGraphics2D.java
    xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/java2d/ps/PSDocumentGraphics2D.java
    xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/java2d/ps/PSGraphics2D.java

Modified: xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/java2d/ps/AbstractPSDocumentGraphics2D.java
URL: http://svn.apache.org/viewvc/xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/java2d/ps/AbstractPSDocumentGraphics2D.java?rev=592340&r1=592339&r2=592340&view=diff
==============================================================================
--- xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/java2d/ps/AbstractPSDocumentGraphics2D.java
(original)
+++ xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/java2d/ps/AbstractPSDocumentGraphics2D.java
Tue Nov  6 01:04:04 2007
@@ -22,8 +22,8 @@
 import java.awt.Color;
 import java.awt.Shape;
 import java.awt.geom.AffineTransform;
-import java.io.OutputStream;
 import java.io.IOException;
+import java.io.OutputStream;
 
 import org.apache.xmlgraphics.ps.DSCConstants;
 import org.apache.xmlgraphics.ps.PSGenerator;
@@ -251,7 +251,6 @@
     public AbstractPSDocumentGraphics2D(AbstractPSDocumentGraphics2D g) {
         super(g);
     }
-    
 
 }
 

Modified: xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/java2d/ps/PSDocumentGraphics2D.java
URL: http://svn.apache.org/viewvc/xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/java2d/ps/PSDocumentGraphics2D.java?rev=592340&r1=592339&r2=592340&view=diff
==============================================================================
--- xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/java2d/ps/PSDocumentGraphics2D.java
(original)
+++ xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/java2d/ps/PSDocumentGraphics2D.java
Tue Nov  6 01:04:04 2007
@@ -19,9 +19,8 @@
 
 package org.apache.xmlgraphics.java2d.ps;
 
-import java.awt.Graphics;
-import java.io.OutputStream;
 import java.io.IOException;
+import java.io.OutputStream;
 
 import org.apache.xmlgraphics.ps.DSCConstants;
 import org.apache.xmlgraphics.ps.PSProcSets;
@@ -90,6 +89,7 @@
         gen.writeDSCComment(DSCConstants.PAGES, DSCConstants.ATEND);
         gen.writeDSCComment(DSCConstants.BBOX, new Object[]
                 {ZERO, ZERO, pagewidth, pageheight});
+        gen.writeDSCComment(DSCConstants.LANGUAGE_LEVEL, new Integer(gen.getPSLevel()));
         gen.writeDSCComment(DSCConstants.END_COMMENTS);
         
         //Defaults
@@ -136,16 +136,6 @@
      */
     public PSDocumentGraphics2D(PSDocumentGraphics2D g) {
         super(g);
-    }
-
-    /**
-     * Creates a new <code>Graphics</code> object that is
-     * a copy of this <code>Graphics</code> object.
-     * @return     a new graphics context that is a copy of
-     * this graphics context.
-     */
-    public Graphics create() {
-        return new PSDocumentGraphics2D(this);
     }
 
 }

Modified: xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/java2d/ps/PSGraphics2D.java
URL: http://svn.apache.org/viewvc/xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/java2d/ps/PSGraphics2D.java?rev=592340&r1=592339&r2=592340&view=diff
==============================================================================
--- xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/java2d/ps/PSGraphics2D.java
(original)
+++ xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/java2d/ps/PSGraphics2D.java
Tue Nov  6 01:04:04 2007
@@ -37,7 +37,6 @@
 import java.awt.Shape;
 import java.awt.Stroke;
 import java.awt.TexturePaint;
-import java.awt.color.ColorSpace;
 import java.awt.geom.AffineTransform;
 import java.awt.geom.PathIterator;
 import java.awt.image.BufferedImage;
@@ -66,6 +65,8 @@
     
     private static final boolean DEBUG = false;
     
+    protected PSGraphics2D rootG2D;
+    
     /** the PostScript generator being created */
     protected PSGenerator gen;
 
@@ -109,6 +110,7 @@
     public PSGraphics2D(PSGraphics2D g) {
         super(g);
 
+        this.rootG2D = (g.rootG2D != null ? g.rootG2D : g);
         setPSGenerator(g.gen);
         this.clippingDisabled = g.clippingDisabled;
         this.fallbackTextHandler = g.fallbackTextHandler;
@@ -171,6 +173,7 @@
      * this graphics context.
      */
     public Graphics create() {
+        preparePainting();
         return new PSGraphics2D(this);
     }
 
@@ -189,6 +192,9 @@
      */
     public void preparePainting() {
         //nop, used by AbstractPSDocumentGraphics2D
+        if (rootG2D != null) {
+            rootG2D.preparePainting();
+        }
     }
 
     /**



---------------------------------------------------------------------
Apache XML Graphics Project URL: http://xmlgraphics.apache.org/
To unsubscribe, e-mail: commits-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: commits-help@xmlgraphics.apache.org


Mime
View raw message