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/05/30 17:04:27 UTC

svn commit: r949526 - in /xmlgraphics/commons/trunk: src/java/org/apache/xmlgraphics/ps/PSGenerator.java status.xml

Author: jeremias
Date: Sun May 30 15:04:27 2010
New Revision: 949526

URL: http://svn.apache.org/viewvc?rev=949526&view=rev
Log:
Bugzilla #49250:
Added getter and setter for enabling/disabling comments in PSGenerator.
Submitted by: Julien Aymé <julien.ayme.at.gmail.com>

Modified:
    xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/ps/PSGenerator.java
    xmlgraphics/commons/trunk/status.xml

Modified: xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/ps/PSGenerator.java
URL: http://svn.apache.org/viewvc/xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/ps/PSGenerator.java?rev=949526&r1=949525&r2=949526&view=diff
==============================================================================
--- xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/ps/PSGenerator.java (original)
+++ xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/ps/PSGenerator.java Sun May 30 15:04:27 2010
@@ -102,6 +102,24 @@ public class PSGenerator implements PSCo
         this.compactMode = value;
     }
 
+    /**
+     * Indicates whether this instance allows to write comments. See
+     * {@link #setCommentsEnabled(boolean)} for details.
+     * @return true if comments are enabled (the default)
+     */
+    public boolean isCommentsEnabled() {
+        return this.commentsEnabled;
+    }
+
+    /**
+     * Controls whether this instance allows to write comments using the {@link #commentln(String)}
+     * method.
+     * @param value true to enable comments, false to disable them
+     */
+    public void setCommentsEnabled(boolean value) {
+        this.commentsEnabled = value;
+    }
+
     private void resetGraphicsState() {
         if (!this.graphicsStateStack.isEmpty()) {
             throw new IllegalStateException("Graphics state stack should be empty at this point");
@@ -206,7 +224,7 @@ public class PSGenerator implements PSCo
      * @exception IOException  In case of an I/O problem
      */
     public void commentln(String comment) throws IOException {
-        if (this.commentsEnabled) {
+        if (isCommentsEnabled()) {
             writeln(comment);
         }
     }

Modified: xmlgraphics/commons/trunk/status.xml
URL: http://svn.apache.org/viewvc/xmlgraphics/commons/trunk/status.xml?rev=949526&r1=949525&r2=949526&view=diff
==============================================================================
--- xmlgraphics/commons/trunk/status.xml (original)
+++ xmlgraphics/commons/trunk/status.xml Sun May 30 15:04:27 2010
@@ -40,6 +40,9 @@
   </contexts>
   <changes>
     <release version="Trunk" date="n/a">
+      <action context="Code" dev="JM" type="add" fixes-bug="49250" due-to="Julien Aymé">
+        Added getter and setter for enabling/disabling comments in PSGenerator.
+      </action>
       <action context="Code" dev="JM" type="add" fixes-bug="49056" due-to="Calixte Denizet">
         Small optimization which only generates code for a clipping area if an element is not
         fully inside the clipping area.



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