xmlgraphics-fop-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From phanc...@apache.org
Subject svn commit: r1357514 - in /xmlgraphics/fop/branches/Temp_RoundedCorners/src/java/org/apache/fop: afp/ fo/ fo/extensions/ fo/properties/ render/ render/afp/ render/intermediate/ traits/
Date Thu, 05 Jul 2012 09:20:59 GMT
Author: phancock
Date: Thu Jul  5 09:20:58 2012
New Revision: 1357514

URL: http://svn.apache.org/viewvc?rev=1357514&view=rev
Log:
Minor cleanup

Modified:
    xmlgraphics/fop/branches/Temp_RoundedCorners/src/java/org/apache/fop/afp/AFPResourceManager.java
    xmlgraphics/fop/branches/Temp_RoundedCorners/src/java/org/apache/fop/fo/Constants.java
    xmlgraphics/fop/branches/Temp_RoundedCorners/src/java/org/apache/fop/fo/FOPropertyMapping.java
    xmlgraphics/fop/branches/Temp_RoundedCorners/src/java/org/apache/fop/fo/extensions/ExtensionElementMapping.java
    xmlgraphics/fop/branches/Temp_RoundedCorners/src/java/org/apache/fop/fo/properties/CommonBorderPaddingBackground.java
    xmlgraphics/fop/branches/Temp_RoundedCorners/src/java/org/apache/fop/render/AbstractPathOrientedRenderer.java
    xmlgraphics/fop/branches/Temp_RoundedCorners/src/java/org/apache/fop/render/afp/AFPDocumentHandler.java
    xmlgraphics/fop/branches/Temp_RoundedCorners/src/java/org/apache/fop/render/afp/AFPPainter.java
    xmlgraphics/fop/branches/Temp_RoundedCorners/src/java/org/apache/fop/render/intermediate/BorderPainter.java
    xmlgraphics/fop/branches/Temp_RoundedCorners/src/java/org/apache/fop/render/intermediate/IFSerializer.java
    xmlgraphics/fop/branches/Temp_RoundedCorners/src/java/org/apache/fop/traits/BorderProps.java

Modified: xmlgraphics/fop/branches/Temp_RoundedCorners/src/java/org/apache/fop/afp/AFPResourceManager.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_RoundedCorners/src/java/org/apache/fop/afp/AFPResourceManager.java?rev=1357514&r1=1357513&r2=1357514&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_RoundedCorners/src/java/org/apache/fop/afp/AFPResourceManager.java
(original)
+++ xmlgraphics/fop/branches/Temp_RoundedCorners/src/java/org/apache/fop/afp/AFPResourceManager.java
Thu Jul  5 09:20:58 2012
@@ -70,7 +70,6 @@ public class AFPResourceManager {
     /** Mapping of resourceInfo to AbstractCachedObject */
     private final Map<AFPResourceInfo, AbstractCachedObject> includeObjectCache
             = new java.util.HashMap<AFPResourceInfo, AbstractCachedObject>();
-
     private AFPResourceLevelDefaults resourceLevelDefaults = new AFPResourceLevelDefaults();
 
     /**
@@ -427,9 +426,7 @@ public class AFPResourceManager {
         resourceInfo.setName(resourceName);
         resourceInfo.setUri(uri.toASCIIString());
 
-        AbstractCachedObject cachedObject = (AbstractCachedObject)
-                includeObjectCache.get(resourceInfo);
-        
+        AbstractCachedObject cachedObject = (AbstractCachedObject) includeObjectCache.get(resourceInfo);
         if (cachedObject == null) {
 
             ResourceGroup resourceGroup = streamer.getResourceGroup(resourceLevel);
@@ -457,7 +454,6 @@ public class AFPResourceManager {
                 @Override
                 protected void writeEnd(OutputStream os) throws IOException { }
             };
-
             resourceGroup.addObject(resourceObject);
             cachedObject = new CachedObject(resourceName, null);
             includeObjectCache.put(resourceInfo, cachedObject);

Modified: xmlgraphics/fop/branches/Temp_RoundedCorners/src/java/org/apache/fop/fo/Constants.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_RoundedCorners/src/java/org/apache/fop/fo/Constants.java?rev=1357514&r1=1357513&r2=1357514&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_RoundedCorners/src/java/org/apache/fop/fo/Constants.java
(original)
+++ xmlgraphics/fop/branches/Temp_RoundedCorners/src/java/org/apache/fop/fo/Constants.java
Thu Jul  5 09:20:58 2012
@@ -779,7 +779,6 @@ public interface Constants {
     /** Property constant - FOP proprietary prototype (in XSL-FO 2.0 Requirements) */
     int PR_X_XML_BASE = 275;
 
-
     /** Property constant FOP proprietary*/
     int PR_X_BORDER_BEFORE_RADIUS_START = 276;
 

Modified: xmlgraphics/fop/branches/Temp_RoundedCorners/src/java/org/apache/fop/fo/FOPropertyMapping.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_RoundedCorners/src/java/org/apache/fop/fo/FOPropertyMapping.java?rev=1357514&r1=1357513&r2=1357514&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_RoundedCorners/src/java/org/apache/fop/fo/FOPropertyMapping.java
(original)
+++ xmlgraphics/fop/branches/Temp_RoundedCorners/src/java/org/apache/fop/fo/FOPropertyMapping.java
Thu Jul  5 09:20:58 2012
@@ -212,7 +212,6 @@ public final class FOPropertyMapping imp
         genericCondCornerRadius.setPercentBase(LengthBase.CONTAINING_BLOCK_HEIGHT);
         genericCondCornerRadius.addShorthand(generics[PR_X_BORDER_RADIUS]);
 
-
         // GenericBreak
         genericBreak = new EnumProperty.Maker(0);
         genericBreak.setInherited(false);

Modified: xmlgraphics/fop/branches/Temp_RoundedCorners/src/java/org/apache/fop/fo/extensions/ExtensionElementMapping.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_RoundedCorners/src/java/org/apache/fop/fo/extensions/ExtensionElementMapping.java?rev=1357514&r1=1357513&r2=1357514&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_RoundedCorners/src/java/org/apache/fop/fo/extensions/ExtensionElementMapping.java
(original)
+++ xmlgraphics/fop/branches/Temp_RoundedCorners/src/java/org/apache/fop/fo/extensions/ExtensionElementMapping.java
Thu Jul  5 09:20:58 2012
@@ -52,7 +52,6 @@ public class ExtensionElementMapping ext
         PROPERTY_ATTRIBUTES.add("disable-column-balancing");
         //These are FOP's extension properties for accessibility
         PROPERTY_ATTRIBUTES.add("alt-text");
-
         //fox:border-*-radius-*
         PROPERTY_ATTRIBUTES.add("border-before-radius-start");
         PROPERTY_ATTRIBUTES.add("border-before-radius-end");

Modified: xmlgraphics/fop/branches/Temp_RoundedCorners/src/java/org/apache/fop/fo/properties/CommonBorderPaddingBackground.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_RoundedCorners/src/java/org/apache/fop/fo/properties/CommonBorderPaddingBackground.java?rev=1357514&r1=1357513&r2=1357514&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_RoundedCorners/src/java/org/apache/fop/fo/properties/CommonBorderPaddingBackground.java
(original)
+++ xmlgraphics/fop/branches/Temp_RoundedCorners/src/java/org/apache/fop/fo/properties/CommonBorderPaddingBackground.java
Thu Jul  5 09:20:58 2012
@@ -216,18 +216,15 @@ public class CommonBorderPaddingBackgrou
             if (this == obj) {
                 return true;
             }
-            if (obj instanceof BorderInfo) {
-                BorderInfo bi = (BorderInfo)obj;
-                return (this.mColor == bi.mColor
-                        && this.mStyle == bi.mStyle
-                        && this.mWidth == bi.mWidth
-                        && this.radiusStart == bi.radiusStart
-                        && this.radiusEnd == bi.radiusEnd);
+            if (!(obj instanceof BorderInfo)) {
+                return false;
             }
-            BorderInfo other = (BorderInfo) obj;
-            return CompareUtil.equal(mColor, other.mColor)
-                    && mStyle == other.mStyle
-                    && CompareUtil.equal(mWidth, other.mWidth);
+            BorderInfo bi = (BorderInfo)obj;
+            return (this.mColor == bi.mColor
+                    && this.mStyle == bi.mStyle
+                    && this.mWidth == bi.mWidth
+                    && this.radiusStart == bi.radiusStart
+                    && this.radiusEnd == bi.radiusEnd);
         }
 
         @Override
@@ -252,12 +249,9 @@ public class CommonBorderPaddingBackgrou
      * A border info with style "none". Used as a singleton, in the collapsing-border model,
      * for elements which don't specify any border on some of their sides.
      */
-    private static final BorderInfo DEFAULT_BORDER_INFO
-    = BorderInfo.getInstance(Constants.EN_NONE, new ConditionalNullLength(), null,
-            new ConditionalNullLength(), new ConditionalNullLength());
-
-
-
+    private static final BorderInfo DEFAULT_BORDER_INFO  = BorderInfo.getInstance(
+            Constants.EN_NONE, new ConditionalNullLength(), null, new ConditionalNullLength(),
+            new ConditionalNullLength());
 
     /**
      * A conditional length of value 0. Returned by the

Modified: xmlgraphics/fop/branches/Temp_RoundedCorners/src/java/org/apache/fop/render/AbstractPathOrientedRenderer.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_RoundedCorners/src/java/org/apache/fop/render/AbstractPathOrientedRenderer.java?rev=1357514&r1=1357513&r2=1357514&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_RoundedCorners/src/java/org/apache/fop/render/AbstractPathOrientedRenderer.java
(original)
+++ xmlgraphics/fop/branches/Temp_RoundedCorners/src/java/org/apache/fop/render/AbstractPathOrientedRenderer.java
Thu Jul  5 09:20:58 2012
@@ -173,7 +173,6 @@ public abstract class AbstractPathOrient
         drawBackground(startx, starty, width, height,
                 (Trait.Background) backgroundArea.getTrait(Trait.BACKGROUND),
                 bpsBefore, bpsAfter, bpsStart, bpsEnd, backgroundArea.getBidiLevel());
-
         // TODO what is the default bg color?   Should we serialize it?
         Color bg = Color.white;
         if (backgroundTrait != null &&  backgroundTrait.getColor() != null) {
@@ -328,6 +327,7 @@ public abstract class AbstractPathOrient
      * @param bpsAfter the border-after traits
      * @param bpsStart the border-start traits
      * @param bpsEnd the border-end traits
+     * @param innerBackgroundColor the background color of the block
      */
     protected void clipBackground (float startx, float starty,
             float width, float height,

Modified: xmlgraphics/fop/branches/Temp_RoundedCorners/src/java/org/apache/fop/render/afp/AFPDocumentHandler.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_RoundedCorners/src/java/org/apache/fop/render/afp/AFPDocumentHandler.java?rev=1357514&r1=1357513&r2=1357514&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_RoundedCorners/src/java/org/apache/fop/render/afp/AFPDocumentHandler.java
(original)
+++ xmlgraphics/fop/branches/Temp_RoundedCorners/src/java/org/apache/fop/render/afp/AFPDocumentHandler.java
Thu Jul  5 09:20:58 2012
@@ -23,8 +23,8 @@ import java.awt.Color;
 import java.awt.Dimension;
 import java.awt.geom.AffineTransform;
 import java.io.IOException;
-import java.util.HashMap;
 import java.net.URI;
+import java.util.HashMap;
 import java.util.Iterator;
 import java.util.List;
 import java.util.Map;

Modified: xmlgraphics/fop/branches/Temp_RoundedCorners/src/java/org/apache/fop/render/afp/AFPPainter.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_RoundedCorners/src/java/org/apache/fop/render/afp/AFPPainter.java?rev=1357514&r1=1357513&r2=1357514&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_RoundedCorners/src/java/org/apache/fop/render/afp/AFPPainter.java
(original)
+++ xmlgraphics/fop/branches/Temp_RoundedCorners/src/java/org/apache/fop/render/afp/AFPPainter.java
Thu Jul  5 09:20:58 2012
@@ -354,7 +354,6 @@ public class AFPPainter extends Abstract
                         = new Area[]{new Area(), new Area(), new Area(), new Area()};
 
                 if (roundCorner[TOP_LEFT]) {
-
                     AffineTransform transform =  new AffineTransform();
                     int beforeRadius = (int)(esf * bpsBefore.getRadiusStart());
                     int startRadius = (int)(esf * bpsStart.getRadiusStart());

Modified: xmlgraphics/fop/branches/Temp_RoundedCorners/src/java/org/apache/fop/render/intermediate/BorderPainter.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_RoundedCorners/src/java/org/apache/fop/render/intermediate/BorderPainter.java?rev=1357514&r1=1357513&r2=1357514&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_RoundedCorners/src/java/org/apache/fop/render/intermediate/BorderPainter.java
(original)
+++ xmlgraphics/fop/branches/Temp_RoundedCorners/src/java/org/apache/fop/render/intermediate/BorderPainter.java
Thu Jul  5 09:20:58 2012
@@ -101,30 +101,33 @@ public abstract class BorderPainter {
         int width = borderRect.width;
         int height = borderRect.height;
         boolean[] b = new boolean[] {
-            (bpsTop != null), (bpsRight != null),
-            (bpsBottom != null), (bpsLeft != null)};
-        if (!b[0] && !b[1] && !b[2] && !b[3]) {
+                (bpsTop != null), (bpsRight != null),
+                (bpsBottom != null), (bpsLeft != null)};
+        if (!b[TOP] && !b[RIGHT] && !b[BOTTOM] && !b[LEFT]) {
             return;
         }
         int[] bw = new int[] {
-            (b[0] ? bpsTop.width : 0),
-            (b[1] ? bpsRight.width : 0),
-            (b[2] ? bpsBottom.width : 0),
-            (b[3] ? bpsLeft.width : 0)};
+                (b[TOP] ? bpsTop.width : 0),
+                (b[RIGHT] ? bpsRight.width : 0),
+                (b[BOTTOM] ? bpsBottom.width : 0),
+                (b[LEFT] ? bpsLeft.width : 0)};
         int[] clipw = new int[] {
-            BorderProps.getClippedWidth(bpsTop),
-            BorderProps.getClippedWidth(bpsRight),
-            BorderProps.getClippedWidth(bpsBottom),
-            BorderProps.getClippedWidth(bpsLeft)};
-        starty += clipw[0];
-        height -= clipw[0];
-        height -= clipw[2];
-        startx += clipw[3];
-        width -= clipw[3];
-        width -= clipw[1];
+                BorderProps.getClippedWidth(bpsTop),
+                BorderProps.getClippedWidth(bpsRight),
+                BorderProps.getClippedWidth(bpsBottom),
+                BorderProps.getClippedWidth(bpsLeft)};
+        starty += clipw[TOP];
+        height -= clipw[TOP];
+        height -= clipw[BOTTOM];
+        startx += clipw[LEFT];
+        width -= clipw[LEFT];
+        width -= clipw[RIGHT];
 
         boolean[] slant = new boolean[] {
-            (b[3] && b[0]), (b[0] && b[1]), (b[1] && b[2]), (b[2]
&& b[3])};
+                (b[LEFT] && b[TOP]),
+                (b[TOP] && b[RIGHT]),
+                (b[RIGHT] && b[BOTTOM]),
+                (b[BOTTOM] && b[LEFT])};
         if (bpsTop != null) {
             int sx1 = startx;
             int sx2 = (slant[TOP_LEFT] ? sx1 + bw[LEFT] - clipw[LEFT] : sx1);
@@ -142,10 +145,10 @@ public abstract class BorderPainter {
             int ex1a = ex1;
             if (bpsTop.mode == BorderProps.COLLAPSE_OUTER) {
                 if (bpsLeft != null && bpsLeft.mode == BorderProps.COLLAPSE_OUTER)
{
-                    sx1a -= clipw[3];
+                    sx1a -= clipw[LEFT];
                 }
                 if (bpsRight != null && bpsRight.mode == BorderProps.COLLAPSE_OUTER)
{
-                    ex1a += clipw[1];
+                    ex1a += clipw[RIGHT];
                 }
                 lineTo(sx1a, outery);
                 lineTo(ex1a, outery);
@@ -167,7 +170,6 @@ public abstract class BorderPainter {
             int outerx = startx + width + clipw[RIGHT];
             int clipx = outerx - clipw[RIGHT];
             int innerx = outerx - bw[RIGHT];
-
             saveGraphicsState();
             moveTo(clipx, sy1);
             int sy1a = sy1;
@@ -199,7 +201,6 @@ public abstract class BorderPainter {
             int outery = starty + height + clipw[BOTTOM];
             int clipy = outery - clipw[BOTTOM];
             int innery = outery - bw[BOTTOM];
-
             saveGraphicsState();
             moveTo(ex1, clipy);
             int sx1a = sx1;
@@ -231,7 +232,7 @@ public abstract class BorderPainter {
             int outerx = startx - clipw[LEFT];
             int clipx = outerx + clipw[LEFT];
             int innerx = outerx + bw[LEFT];
-
+            
             saveGraphicsState();
 
             moveTo(clipx, ey1);
@@ -286,7 +287,6 @@ public abstract class BorderPainter {
                 (b[RIGHT] ? bpsEnd.width : 0),
                 (b[BOTTOM] ? bpsAfter.width : 0),
                 (b[LEFT] ? bpsStart.width : 0)};
-
         int[] clipw = new int[] {
                 BorderProps.getClippedWidth(bpsBefore),
                 BorderProps.getClippedWidth(bpsEnd),
@@ -301,7 +301,6 @@ public abstract class BorderPainter {
         boolean[] slant = new boolean[] {
                 (b[LEFT] && b[TOP]), (b[TOP] && b[RIGHT]),
                 (b[RIGHT] && b[BOTTOM]), (b[LEFT] && b[BOTTOM])};
-
         //Determine scale factor if any adjacent elliptic corners overlap
         double esf = cornerScaleFactor(width, height, bpsBefore, bpsAfter, bpsStart, bpsEnd);
 

Modified: xmlgraphics/fop/branches/Temp_RoundedCorners/src/java/org/apache/fop/render/intermediate/IFSerializer.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_RoundedCorners/src/java/org/apache/fop/render/intermediate/IFSerializer.java?rev=1357514&r1=1357513&r2=1357514&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_RoundedCorners/src/java/org/apache/fop/render/intermediate/IFSerializer.java
(original)
+++ xmlgraphics/fop/branches/Temp_RoundedCorners/src/java/org/apache/fop/render/intermediate/IFSerializer.java
Thu Jul  5 09:20:58 2012
@@ -31,6 +31,7 @@ import java.util.Locale;
 import java.util.Map;
 
 import org.w3c.dom.Document;
+
 import org.xml.sax.SAXException;
 import org.xml.sax.helpers.AttributesImpl;
 

Modified: xmlgraphics/fop/branches/Temp_RoundedCorners/src/java/org/apache/fop/traits/BorderProps.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_RoundedCorners/src/java/org/apache/fop/traits/BorderProps.java?rev=1357514&r1=1357513&r2=1357514&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_RoundedCorners/src/java/org/apache/fop/traits/BorderProps.java
(original)
+++ xmlgraphics/fop/branches/Temp_RoundedCorners/src/java/org/apache/fop/traits/BorderProps.java
Thu Jul  5 09:20:58 2012
@@ -51,10 +51,9 @@ public class BorderProps implements Seri
     public int width;                                           // CSOK: VisibilityModifier
 
     private int radiusStart = 0;
+    
     private int radiusEnd = 0;
-
-
-
+    
     /** Border mode (one of SEPARATE, COLLAPSE_INNER and COLLAPSE_OUTER) */
     public int mode;                                            // CSOK: VisibilityModifier
 



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


Mime
View raw message