You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@xmlgraphics.apache.org by je...@apache.org on 2010/06/15 11:05:14 UTC

svn commit: r954770 - in /xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/java2d/ps: AbstractPSDocumentGraphics2D.java EPSDocumentGraphics2D.java PSDocumentGraphics2D.java

Author: jeremias
Date: Tue Jun 15 09:05:14 2010
New Revision: 954770

URL: http://svn.apache.org/viewvc?rev=954770&view=rev
Log:
Moved writing the standard ProcSets to its own protected method so customization is easier.

Modified:
    xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/java2d/ps/AbstractPSDocumentGraphics2D.java
    xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/java2d/ps/EPSDocumentGraphics2D.java
    xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/java2d/ps/PSDocumentGraphics2D.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=954770&r1=954769&r2=954770&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 Jun 15 09:05:14 2010
@@ -27,6 +27,7 @@ import java.io.OutputStream;
 
 import org.apache.xmlgraphics.ps.DSCConstants;
 import org.apache.xmlgraphics.ps.PSGenerator;
+import org.apache.xmlgraphics.ps.PSProcSets;
 
 /**
  * This class is a wrapper for the <tt>PSGraphics2D</tt> that
@@ -196,6 +197,15 @@ public abstract class AbstractPSDocument
      */
     protected abstract void writePageTrailer() throws IOException;
 
+    /**
+     * Writes the ProcSets ending up in the prolog to the PostScript file. Override to add your
+     * own ProcSets if so desired.
+     * @throws IOException In case an I/O error occurs
+     */
+    protected void writeProcSets() throws IOException {
+        PSProcSets.writeStdProcSet(gen);
+        PSProcSets.writeEPSProcSet(gen);
+    }
 
     /** {@inheritDoc} */
     public void preparePainting() {

Modified: xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/java2d/ps/EPSDocumentGraphics2D.java
URL: http://svn.apache.org/viewvc/xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/java2d/ps/EPSDocumentGraphics2D.java?rev=954770&r1=954769&r2=954770&view=diff
==============================================================================
--- xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/java2d/ps/EPSDocumentGraphics2D.java (original)
+++ xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/java2d/ps/EPSDocumentGraphics2D.java Tue Jun 15 09:05:14 2010
@@ -22,7 +22,6 @@ package org.apache.xmlgraphics.java2d.ps
 import java.io.IOException;
 
 import org.apache.xmlgraphics.ps.DSCConstants;
-import org.apache.xmlgraphics.ps.PSProcSets;
 
 /**
  * This class is a wrapper for the <tt>AbstractPSDocumentGraphics2D</tt> that
@@ -69,8 +68,7 @@ public class EPSDocumentGraphics2D exten
 
         //Prolog
         gen.writeDSCComment(DSCConstants.BEGIN_PROLOG);
-        PSProcSets.writeStdProcSet(gen);
-        PSProcSets.writeEPSProcSet(gen);
+        writeProcSets();
         if (customTextHandler instanceof PSTextHandler) {
             ((PSTextHandler)customTextHandler).writeSetup();
         }

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=954770&r1=954769&r2=954770&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 Jun 15 09:05:14 2010
@@ -23,7 +23,6 @@ import java.io.IOException;
 import java.io.OutputStream;
 
 import org.apache.xmlgraphics.ps.DSCConstants;
-import org.apache.xmlgraphics.ps.PSProcSets;
 
 /**
  * This class is a wrapper for the <tt>PSGraphics2D</tt> that
@@ -104,8 +103,7 @@ public class PSDocumentGraphics2D extend
 
         //Setup
         gen.writeDSCComment(DSCConstants.BEGIN_SETUP);
-        PSProcSets.writeStdProcSet(gen);
-        PSProcSets.writeEPSProcSet(gen);
+        writeProcSets();
         if (customTextHandler instanceof PSTextHandler) {
             ((PSTextHandler)customTextHandler).writeSetup();
         }



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: commits-help@xmlgraphics.apache.org