xmlgraphics-fop-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From phanc...@apache.org
Subject svn commit: r1343285 [10/24] - in /xmlgraphics/fop/branches/Temp_URI_Unification: ./ conf/ examples/embedding/ examples/embedding/java/embedding/ examples/embedding/java/embedding/tools/ lib/ src/codegen/java/org/apache/fop/tools/ src/codegen/unicode/j...
Date Mon, 28 May 2012 15:31:36 GMT
Modified: xmlgraphics/fop/branches/Temp_URI_Unification/src/java/org/apache/fop/fo/flow/Block.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_URI_Unification/src/java/org/apache/fop/fo/flow/Block.java?rev=1343285&r1=1343284&r2=1343285&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_URI_Unification/src/java/org/apache/fop/fo/flow/Block.java (original)
+++ xmlgraphics/fop/branches/Temp_URI_Unification/src/java/org/apache/fop/fo/flow/Block.java Mon May 28 15:30:46 2012
@@ -54,7 +54,7 @@ public class Block extends FObjMixed imp
     private boolean blockOrInlineItemFound = false;
     private boolean initialPropertySetFound = false;
 
-    // The value of properties relevant for fo:block.
+    // The value of FO traits (refined properties) that apply to fo:block.
     private CommonAccessibility commonAccessibility;
     private CommonBorderPaddingBackground commonBorderPaddingBackground;
     private CommonFont commonFont;
@@ -91,7 +91,7 @@ public class Block extends FObjMixed imp
     //     private Length textDepth;
     //     private Length textAltitude;
     //     private int visibility;
-    // End of property values
+    // End of FO trait values
 
     /**
      * Base constructor
@@ -177,87 +177,87 @@ public class Block extends FObjMixed imp
         return commonHyphenation;
     }
 
-    /** @return the "break-after" property. */
+    /** @return the "break-after" trait. */
     public int getBreakAfter() {
         return breakAfter;
     }
 
-    /** @return the "break-before" property. */
+    /** @return the "break-before" trait. */
     public int getBreakBefore() {
         return breakBefore;
     }
 
-    /** @return the "hyphenation-ladder-count" property.  */
+    /** @return the "hyphenation-ladder-count" trait.  */
     public Numeric getHyphenationLadderCount() {
         return hyphenationLadderCount;
     }
 
-    /** @return the "keep-with-next" property.  */
+    /** @return the "keep-with-next" trait.  */
     public KeepProperty getKeepWithNext() {
         return keepWithNext;
     }
 
-    /** @return the "keep-with-previous" property.  */
+    /** @return the "keep-with-previous" trait.  */
     public KeepProperty getKeepWithPrevious() {
         return keepWithPrevious;
     }
 
-    /** @return the "keep-together" property.  */
+    /** @return the "keep-together" trait.  */
     public KeepProperty getKeepTogether() {
         return keepTogether;
     }
 
-    /** @return the "orphans" property.  */
+    /** @return the "orphans" trait.  */
     public int getOrphans() {
         return orphans.getValue();
     }
 
-    /** @return the "widows" property.  */
+    /** @return the "widows" trait.  */
     public int getWidows() {
         return widows.getValue();
     }
 
-    /** @return the "line-stacking-strategy" property.  */
+    /** @return the "line-stacking-strategy" trait.  */
     public int getLineStackingStrategy() {
         return lineStackingStrategy;
     }
 
-    /** @return the "color" property */
+    /** @return the "color" trait */
     public Color getColor() {
         return color;
     }
 
-    /** @return the "line-height" property */
+    /** @return the "line-height" trait */
     public SpaceProperty getLineHeight() {
         return lineHeight;
     }
 
-    /** @return the "span" property */
+    /** @return the "span" trait */
     public int getSpan() {
         return this.span;
     }
 
-    /** @return the "text-align" property */
+    /** @return the "text-align" trait */
     public int getTextAlign() {
         return textAlign;
     }
 
-    /** @return the "text-align-last" property */
+    /** @return the "text-align-last" trait */
     public int getTextAlignLast() {
         return textAlignLast;
     }
 
-    /** @return the "text-indent" property */
+    /** @return the "text-indent" trait */
     public Length getTextIndent() {
         return textIndent;
     }
 
-    /** @return the "last-line-end-indent" property */
+    /** @return the "last-line-end-indent" trait */
     public Length getLastLineEndIndent() {
         return lastLineEndIndent;
     }
 
-    /** @return the "wrap-option" property */
+    /** @return the "wrap-option" trait */
     public int getWrapOption() {
         return wrapOption;
     }
@@ -295,17 +295,17 @@ public class Block extends FObjMixed imp
         }
     }
 
-    /** @return the "linefeed-treatment" property */
+    /** @return the "linefeed-treatment" trait */
     public int getLinefeedTreatment() {
         return linefeedTreatment;
     }
 
-    /** @return the "white-space-treatment" property */
+    /** @return the "white-space-treatment" trait */
     public int getWhitespaceTreatment() {
         return whiteSpaceTreatment;
     }
 
-    /** @return the "white-space-collapse" property */
+    /** @return the "white-space-collapse" trait */
     public int getWhitespaceCollapse() {
         return whiteSpaceCollapse;
     }
@@ -315,17 +315,17 @@ public class Block extends FObjMixed imp
         return this.commonRelativePosition;
     }
 
-    /** @return the "hyphenation-keep" property */
+    /** @return the "hyphenation-keep" trait */
     public int getHyphenationKeep() {
         return this.hyphenationKeep;
     }
 
-    /** @return the "intrusion-displace" property */
+    /** @return the "intrusion-displace" trait */
     public int getIntrusionDisplace() {
         return this.intrusionDisplace;
     }
 
-    /** @return the "line-height-shift-adjustment" property */
+    /** @return the "line-height-shift-adjustment" trait */
     public int getLineHeightShiftAdjustment() {
         return this.lineHeightShiftAdjustment;
     }
@@ -335,9 +335,9 @@ public class Block extends FObjMixed imp
      * {@link org.apache.fop.fo.Constants#EN_TRUE},
      * {@link org.apache.fop.fo.Constants#EN_FALSE}
      */
-     public int getDisableColumnBalancing() {
-         return disableColumnBalancing;
-     }
+    public int getDisableColumnBalancing() {
+        return disableColumnBalancing;
+    }
 
 
     /** {@inheritDoc} */
@@ -350,10 +350,10 @@ public class Block extends FObjMixed imp
         return "block";
     }
 
-     /**
-      * {@inheritDoc}
-      * @return {@link org.apache.fop.fo.Constants#FO_BLOCK}
-      */
+    /**
+     * {@inheritDoc}
+     * @return {@link org.apache.fop.fo.Constants#FO_BLOCK}
+     */
     public int getNameId() {
         return FO_BLOCK;
     }

Modified: xmlgraphics/fop/branches/Temp_URI_Unification/src/java/org/apache/fop/fo/flow/BlockContainer.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_URI_Unification/src/java/org/apache/fop/fo/flow/BlockContainer.java?rev=1343285&r1=1343284&r2=1343285&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_URI_Unification/src/java/org/apache/fop/fo/flow/BlockContainer.java (original)
+++ xmlgraphics/fop/branches/Temp_URI_Unification/src/java/org/apache/fop/fo/flow/BlockContainer.java Mon May 28 15:30:46 2012
@@ -19,6 +19,8 @@
 
 package org.apache.fop.fo.flow;
 
+import org.xml.sax.Locator;
+
 import org.apache.fop.apps.FOPException;
 import org.apache.fop.datatypes.Numeric;
 import org.apache.fop.fo.FONode;
@@ -31,14 +33,17 @@ import org.apache.fop.fo.properties.Comm
 import org.apache.fop.fo.properties.CommonMarginBlock;
 import org.apache.fop.fo.properties.KeepProperty;
 import org.apache.fop.fo.properties.LengthRangeProperty;
-import org.xml.sax.Locator;
+import org.apache.fop.traits.Direction;
+import org.apache.fop.traits.WritingMode;
+import org.apache.fop.traits.WritingModeTraits;
+import org.apache.fop.traits.WritingModeTraitsGetter;
 
 /**
  * Class modelling the <a href="http://www.w3.org/TR/xsl/#fo_block-container">
  * <code>fo:block-container</code></a> object.
  */
-public class BlockContainer extends FObj implements BreakPropertySet {
-    // The value of properties relevant for fo:block-container.
+public class BlockContainer extends FObj implements BreakPropertySet, WritingModeTraitsGetter {
+    // The value of FO traits (refined properties) that apply to fo:block-container.
     private CommonAbsolutePosition commonAbsolutePosition;
     private CommonBorderPaddingBackground commonBorderPaddingBackground;
     private CommonMarginBlock commonMarginBlock;
@@ -55,11 +60,11 @@ public class BlockContainer extends FObj
     private Numeric referenceOrientation;
     private int span;
     private int disableColumnBalancing;
-    private int writingMode;
+    private WritingModeTraits writingModeTraits;
     // Unused but valid items, commented out for performance:
     //     private int intrusionDisplace;
     //     private Numeric zIndex;
-    // End of property values
+    // End of FO trait values
 
     /** used for FO validation */
     private boolean blockItemFound = false;
@@ -92,7 +97,8 @@ public class BlockContainer extends FObj
         overflow = pList.get(PR_OVERFLOW).getEnum();
         referenceOrientation = pList.get(PR_REFERENCE_ORIENTATION).getNumeric();
         span = pList.get(PR_SPAN).getEnum();
-        writingMode = pList.get(PR_WRITING_MODE).getEnum();
+        writingModeTraits = new WritingModeTraits
+            ( WritingMode.valueOf(pList.get(PR_WRITING_MODE).getEnum()) );
         disableColumnBalancing = pList.get(PR_X_DISABLE_COLUMN_BALANCING).getEnum();
     }
 
@@ -161,58 +167,58 @@ public class BlockContainer extends FObj
     }
 
     /**
-     * @return the "block-progression-dimension" property.
+     * @return the "block-progression-dimension" FO trait.
      */
     public LengthRangeProperty getBlockProgressionDimension() {
         return blockProgressionDimension;
     }
 
-    /** @return the "display-align" property. */
+    /** @return the "display-align" FO trait. */
     public int getDisplayAlign() {
         return displayAlign;
     }
 
-    /** @return the "break-after" property. */
+    /** @return the "break-after" FO trait. */
     public int getBreakAfter() {
         return breakAfter;
     }
 
-    /** @return the "break-before" property. */
+    /** @return the "break-before" FO trait. */
     public int getBreakBefore() {
         return breakBefore;
     }
 
-    /** @return the "keep-with-next" property.  */
+    /** @return the "keep-with-next" FO trait.  */
     public KeepProperty getKeepWithNext() {
         return keepWithNext;
     }
 
-    /** @return the "keep-with-previous" property.  */
+    /** @return the "keep-with-previous" FO trait.  */
     public KeepProperty getKeepWithPrevious() {
         return keepWithPrevious;
     }
 
-    /** @return the "keep-together" property.  */
+    /** @return the "keep-together" FO trait.  */
     public KeepProperty getKeepTogether() {
         return keepTogether;
     }
 
-    /** @return the "inline-progression-dimension" property */
+    /** @return the "inline-progression-dimension" FO trait */
     public LengthRangeProperty getInlineProgressionDimension() {
         return inlineProgressionDimension;
     }
 
-    /** @return the "overflow" property */
+    /** @return the "overflow" FO trait */
     public int getOverflow() {
         return overflow;
     }
 
-    /** @return the "reference-orientation" property */
+    /** @return the "reference-orientation" FO trait */
     public int getReferenceOrientation() {
         return referenceOrientation.getValue();
     }
 
-    /** @return the "span" property */
+    /** @return the "span" FO trait */
     public int getSpan() {
         return this.span;
     }
@@ -226,10 +232,52 @@ public class BlockContainer extends FObj
         return disableColumnBalancing;
     }
 
+    /**
+     * Obtain inline progression direction.
+     * @return the inline progression direction
+     */
+    public Direction getInlineProgressionDirection() {
+        return writingModeTraits.getInlineProgressionDirection();
+    }
+
+    /**
+     * Obtain block progression direction.
+     * @return the block progression direction
+     */
+    public Direction getBlockProgressionDirection() {
+        return writingModeTraits.getBlockProgressionDirection();
+    }
+
+    /**
+     * Obtain column progression direction.
+     * @return the column progression direction
+     */
+    public Direction getColumnProgressionDirection() {
+        return writingModeTraits.getColumnProgressionDirection();
+    }
+
+    /**
+     * Obtain row progression direction.
+     * @return the row progression direction
+     */
+    public Direction getRowProgressionDirection() {
+        return writingModeTraits.getRowProgressionDirection();
+    }
+
+    /**
+     * Obtain (baseline) shift direction.
+     * @return the (baseline) shift direction
+     */
+    public Direction getShiftDirection() {
+        return writingModeTraits.getShiftDirection();
+    }
 
-    /** @return the "writing-mode" property */
-    public int getWritingMode() {
-        return writingMode;
+    /**
+     * Obtain writing mode.
+     * @return the writing mode
+     */
+    public WritingMode getWritingMode() {
+        return writingModeTraits.getWritingMode();
     }
 
     /** {@inheritDoc} */

Modified: xmlgraphics/fop/branches/Temp_URI_Unification/src/java/org/apache/fop/fo/flow/Character.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_URI_Unification/src/java/org/apache/fop/fo/flow/Character.java?rev=1343285&r1=1343284&r2=1343285&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_URI_Unification/src/java/org/apache/fop/fo/flow/Character.java (original)
+++ xmlgraphics/fop/branches/Temp_URI_Unification/src/java/org/apache/fop/fo/flow/Character.java Mon May 28 15:30:46 2012
@@ -21,11 +21,13 @@ package org.apache.fop.fo.flow;
 
 import java.awt.Color;
 import java.util.NoSuchElementException;
+import java.util.Stack;
 
 import org.xml.sax.Locator;
 
 import org.apache.fop.accessibility.StructureTreeElement;
 import org.apache.fop.apps.FOPException;
+import org.apache.fop.complexscripts.bidi.DelimitedTextRange;
 import org.apache.fop.datatypes.Length;
 import org.apache.fop.fo.CharIterator;
 import org.apache.fop.fo.FONode;
@@ -233,6 +235,19 @@ public class Character extends FObj impl
         return FO_CHARACTER;
     }
 
+    @Override
+    public boolean isDelimitedTextRangeBoundary ( int boundary ) {
+        return false;
+    }
+
+    @Override
+    protected Stack collectDelimitedTextRanges ( Stack ranges, DelimitedTextRange currentRange ) {
+        if ( currentRange != null ) {
+            currentRange.append ( charIterator(), this );
+        }
+        return ranges;
+    }
+
     private class FOCharIterator extends CharIterator {
 
         private boolean bFirst = true;

Modified: xmlgraphics/fop/branches/Temp_URI_Unification/src/java/org/apache/fop/fo/flow/Inline.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_URI_Unification/src/java/org/apache/fop/fo/flow/Inline.java?rev=1343285&r1=1343284&r2=1343285&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_URI_Unification/src/java/org/apache/fop/fo/flow/Inline.java (original)
+++ xmlgraphics/fop/branches/Temp_URI_Unification/src/java/org/apache/fop/fo/flow/Inline.java Mon May 28 15:30:46 2012
@@ -116,9 +116,9 @@ public class Inline extends InlineLevel 
                 }
             } else if (!isBlockOrInlineItem(nsURI, localName)) {
                 invalidChildError(loc, nsURI, localName);
-            } else if (!canHaveBlockLevelChildren && isBlockItem(nsURI, localName)) {
-                invalidChildError(loc, getParent().getName(), nsURI, getName(),
-                                  "rule.inlineContent");
+            } else if (!canHaveBlockLevelChildren && isBlockItem(nsURI, localName)
+                       && !isNeutralItem(nsURI, localName)) {
+                invalidChildError(loc, getName(), nsURI, localName, "rule.inlineContent");
             } else {
                 blockOrInlineItemFound = true;
             }

Modified: xmlgraphics/fop/branches/Temp_URI_Unification/src/java/org/apache/fop/fo/flow/InlineContainer.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_URI_Unification/src/java/org/apache/fop/fo/flow/InlineContainer.java?rev=1343285&r1=1343284&r2=1343285&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_URI_Unification/src/java/org/apache/fop/fo/flow/InlineContainer.java (original)
+++ xmlgraphics/fop/branches/Temp_URI_Unification/src/java/org/apache/fop/fo/flow/InlineContainer.java Mon May 28 15:30:46 2012
@@ -33,6 +33,9 @@ import org.apache.fop.fo.properties.Comm
 import org.apache.fop.fo.properties.KeepProperty;
 import org.apache.fop.fo.properties.LengthRangeProperty;
 import org.apache.fop.fo.properties.SpaceProperty;
+import org.apache.fop.traits.Direction;
+import org.apache.fop.traits.WritingMode;
+import org.apache.fop.traits.WritingModeTraits;
 
 /**
  * Class modelling the <a href="http://www.w3.org/TR/xsl/#fo_inline-container">
@@ -40,7 +43,7 @@ import org.apache.fop.fo.properties.Spac
  */
 public class InlineContainer extends FObj {
 
-    // The value of properties relevant for fo:inline-container.
+    // The value of FO traits (refined properties) that apply to fo:inline-container.
     private Length alignmentAdjust;
     private int alignmentBaseline;
     private Length baselineShift;
@@ -54,7 +57,7 @@ public class InlineContainer extends FOb
     private SpaceProperty lineHeight;
     private int overflow;
     private Numeric referenceOrientation;
-    private int writingMode;
+    private WritingModeTraits writingModeTraits;
     // Unused but valid items, commented out for performance:
     //     private CommonRelativePosition commonRelativePosition;
     //     private int displayAlign;
@@ -62,7 +65,7 @@ public class InlineContainer extends FOb
     //     private KeepProperty keepWithNext;
     //     private KeepProperty keepWithPrevious;
     //     private Length width;
-    // End of property values
+    // End of FO trait values
 
     /** used for FO validation */
     private boolean blockItemFound = false;
@@ -92,7 +95,8 @@ public class InlineContainer extends FOb
         lineHeight = pList.get(PR_LINE_HEIGHT).getSpace();
         overflow = pList.get(PR_OVERFLOW).getEnum();
         referenceOrientation = pList.get(PR_REFERENCE_ORIENTATION).getNumeric();
-        writingMode = pList.get(PR_WRITING_MODE).getEnum();
+        writingModeTraits = new WritingModeTraits
+            ( WritingMode.valueOf(pList.get(PR_WRITING_MODE).getEnum()) );
     }
 
     /**
@@ -121,27 +125,27 @@ public class InlineContainer extends FOb
         }
     }
 
-    /** @return the "alignment-adjust" property */
+    /** @return the "alignment-adjust" FO trait */
     public Length getAlignmentAdjust() {
         return alignmentAdjust;
     }
 
-    /** @return the "alignment-baseline" property */
+    /** @return the "alignment-baseline" FO trait */
     public int getAlignmentBaseline() {
         return alignmentBaseline;
     }
 
-    /** @return the "baseline-shift" property */
+    /** @return the "baseline-shift" FO trait */
     public Length getBaselineShift() {
         return baselineShift;
     }
 
-    /** @return the "block-progression-dimension" property */
+    /** @return the "block-progression-dimension" FO trait */
     public LengthRangeProperty getBlockProgressionDimension() {
         return blockProgressionDimension;
     }
 
-    /** @return the "clip" property */
+    /** @return the "clip" FO trait */
     public int getClip() {
         return clip;
     }
@@ -156,39 +160,82 @@ public class InlineContainer extends FOb
         return this.commonMarginInline;
     }
 
-    /** @return the "dominant-baseline" property */
+    /** @return the "dominant-baseline" FO trait */
     public int getDominantBaseline() {
         return dominantBaseline;
     }
 
-    /** @return the "keep-together" property */
+    /** @return the "keep-together" FO trait */
     public KeepProperty getKeepTogether() {
         return keepTogether;
     }
 
-    /** @return the "inline-progression-dimension" property */
+    /** @return the "inline-progression-dimension" FO trait */
     public LengthRangeProperty getInlineProgressionDimension() {
         return inlineProgressionDimension;
     }
 
-    /** @return the "line-height" property */
+    /** @return the "line-height" FO trait */
     public SpaceProperty getLineHeight() {
         return lineHeight;
     }
 
-    /** @return the "overflow" property */
+    /** @return the "overflow" FO trait */
     public int getOverflow() {
         return overflow;
     }
 
-    /** @return the "reference-orientation" property */
+    /** @return the "reference-orientation" FO trait */
     public int getReferenceOrientation() {
         return referenceOrientation.getValue();
     }
 
-    /** @return the "writing-mode" property */
-    public int getWritingMode() {
-        return writingMode;
+    /**
+     * Obtain inline progression direction.
+     * @return the inline progression direction
+     */
+    public Direction getInlineProgressionDirection() {
+        return writingModeTraits.getInlineProgressionDirection();
+    }
+
+    /**
+     * Obtain block progression direction.
+     * @return the block progression direction
+     */
+    public Direction getBlockProgressionDirection() {
+        return writingModeTraits.getBlockProgressionDirection();
+    }
+
+    /**
+     * Obtain column progression direction.
+     * @return the column progression direction
+     */
+    public Direction getColumnProgressionDirection() {
+        return writingModeTraits.getColumnProgressionDirection();
+    }
+
+    /**
+     * Obtain row progression direction.
+     * @return the row progression direction
+     */
+    public Direction getRowProgressionDirection() {
+        return writingModeTraits.getRowProgressionDirection();
+    }
+
+    /**
+     * Obtain (baseline) shift direction.
+     * @return the (baseline) shift direction
+     */
+    public Direction getShiftDirection() {
+        return writingModeTraits.getShiftDirection();
+    }
+
+    /**
+     * Obtain writing mode.
+     * @return the writing mode
+     */
+    public WritingMode getWritingMode() {
+        return writingModeTraits.getWritingMode();
     }
 
     /** {@inheritDoc} */
@@ -204,4 +251,9 @@ public class InlineContainer extends FOb
         return FO_INLINE_CONTAINER;
     }
 
+    @Override
+    public boolean isDelimitedTextRangeBoundary ( int boundary ) {
+        return false;
+    }
+
 }

Modified: xmlgraphics/fop/branches/Temp_URI_Unification/src/java/org/apache/fop/fo/flow/InlineLevel.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_URI_Unification/src/java/org/apache/fop/fo/flow/InlineLevel.java?rev=1343285&r1=1343284&r2=1343285&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_URI_Unification/src/java/org/apache/fop/fo/flow/InlineLevel.java (original)
+++ xmlgraphics/fop/branches/Temp_URI_Unification/src/java/org/apache/fop/fo/flow/InlineLevel.java Mon May 28 15:30:46 2012
@@ -39,7 +39,7 @@ import org.apache.fop.fo.properties.Spac
  */
 public abstract class InlineLevel extends FObjMixed implements CommonAccessibilityHolder {
 
-    // The value of properties relevant for inline-level FOs.
+    // The value of FO traits (refined properties) that apply to inline level FOs.
     private CommonAccessibility commonAccessibility;
     private CommonBorderPaddingBackground commonBorderPaddingBackground;
     private CommonMarginInline commonMarginInline;
@@ -48,7 +48,7 @@ public abstract class InlineLevel extend
     private KeepProperty keepWithNext;
     private KeepProperty keepWithPrevious;
     private SpaceProperty lineHeight;
-    // End of property values
+    // End of trait values
 
     /**
      * Base constructor
@@ -92,24 +92,29 @@ public abstract class InlineLevel extend
         return commonFont;
     }
 
-    /** @return the "color" property */
+    /** @return the "color" trait */
     public Color getColor() {
         return color;
     }
 
-    /** @return the "line-height" property */
+    /** @return the "line-height" trait */
     public SpaceProperty getLineHeight() {
         return lineHeight;
     }
 
-    /** @return the "keep-with-next" property */
+    /** @return the "keep-with-next" trait */
     public KeepProperty getKeepWithNext() {
         return keepWithNext;
     }
 
-    /** @return the "keep-with-previous" property */
+    /** @return the "keep-with-previous" trait */
     public KeepProperty getKeepWithPrevious() {
         return keepWithPrevious;
     }
 
+    @Override
+    public boolean isDelimitedTextRangeBoundary ( int boundary ) {
+        return false;
+    }
+
 }

Modified: xmlgraphics/fop/branches/Temp_URI_Unification/src/java/org/apache/fop/fo/flow/Leader.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_URI_Unification/src/java/org/apache/fop/fo/flow/Leader.java?rev=1343285&r1=1343284&r2=1343285&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_URI_Unification/src/java/org/apache/fop/fo/flow/Leader.java (original)
+++ xmlgraphics/fop/branches/Temp_URI_Unification/src/java/org/apache/fop/fo/flow/Leader.java Mon May 28 15:30:46 2012
@@ -19,18 +19,24 @@
 
 package org.apache.fop.fo.flow;
 
+import java.util.Stack;
+
+import org.xml.sax.Locator;
+
 import org.apache.fop.apps.FOPException;
+import org.apache.fop.complexscripts.bidi.DelimitedTextRange;
 import org.apache.fop.datatypes.Length;
 import org.apache.fop.fo.FONode;
 import org.apache.fop.fo.PropertyList;
+import org.apache.fop.fo.ValidationException;
 import org.apache.fop.fo.properties.LengthRangeProperty;
+import org.apache.fop.util.CharUtilities;
 
 /**
  * Class modelling the <a href="http://www.w3.org/TR/xsl/#fo_leader">
  * <code>fo:leader</code></a> object.
  * The main property of <code>fo:leader</code> is leader-pattern.
  * The following patterns are treated: rule, space, dots and use-content.
- * TODO implement validateChildNode()
  */
 public class Leader extends InlineLevel {
     // The value of properties relevant for fo:leader.
@@ -73,7 +79,8 @@ public class Leader extends InlineLevel 
         leaderLength = pList.get(PR_LEADER_LENGTH).getLengthRange();
         leaderPattern = pList.get(PR_LEADER_PATTERN).getEnum();
         leaderPatternWidth = pList.get(PR_LEADER_PATTERN_WIDTH).getLength();
-        ruleThickness = pList.get(PR_RULE_THICKNESS).getLength();
+        // use default rule thickness as a default
+        ruleThickness = getPropertyMakerFor(PR_RULE_THICKNESS).make(pList).getLength();
         switch(leaderPattern) {
         case EN_SPACE:
             // use Space
@@ -82,6 +89,8 @@ public class Leader extends InlineLevel 
             // the following properties only apply
             // for leader-pattern = "rule"
             ruleStyle = pList.get(PR_RULE_STYLE).getEnum();
+            // use specified rule thickness to override default (established above)
+            ruleThickness = pList.get(PR_RULE_THICKNESS).getLength();
             break;
         case EN_DOTS:
             break;
@@ -96,6 +105,28 @@ public class Leader extends InlineLevel 
         // textShadow = pList.get(PR_TEXT_SHADOW);
     }
 
+    /**
+     * {@inheritDoc}
+     * <br>XSL Content Model: (#PCDATA|%inline;)*
+     * <br><i>Additionally: "The content must not contain an
+     * fo:leader, fo:inline-container, fo:block-container, fo:float,
+     * fo:footnote, or fo:marker either as a direct child or as a
+     * descendant."</i>
+     */
+    protected void validateChildNode(Locator loc, String nsURI, String localName)
+        throws ValidationException {
+        if (FO_URI.equals(nsURI)) {
+            if ( localName.equals("leader")
+                 || localName.equals("inline-container")
+                 || localName.equals("block-container")
+                 || localName.equals("float")
+                 || localName.equals("marker")
+                 || !isInlineItem(nsURI, localName) ) {
+                invalidChildError(loc, nsURI, localName);
+            }
+        }
+    }
+
     /** @return the "rule-style" property */
     public int getRuleStyle() {
         return ruleStyle;
@@ -170,4 +201,17 @@ public class Leader extends InlineLevel 
         super.endOfNode();
         getFOEventHandler().endLeader(this);
     }
+
+    @Override
+    protected Stack collectDelimitedTextRanges ( Stack ranges, DelimitedTextRange currentRange ) {
+        if ( currentRange != null ) {
+            if ( leaderPattern == EN_USECONTENT ) {
+                ranges = super.collectDelimitedTextRanges ( ranges, currentRange );
+            } else {
+                currentRange.append ( CharUtilities.OBJECT_REPLACEMENT_CHARACTER, this );
+            }
+        }
+        return ranges;
+    }
+
 }

Modified: xmlgraphics/fop/branches/Temp_URI_Unification/src/java/org/apache/fop/fo/flow/ListItem.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_URI_Unification/src/java/org/apache/fop/fo/flow/ListItem.java?rev=1343285&r1=1343284&r2=1343285&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_URI_Unification/src/java/org/apache/fop/fo/flow/ListItem.java (original)
+++ xmlgraphics/fop/branches/Temp_URI_Unification/src/java/org/apache/fop/fo/flow/ListItem.java Mon May 28 15:30:46 2012
@@ -19,9 +19,12 @@
 
 package org.apache.fop.fo.flow;
 
+import java.util.Stack;
+
 import org.xml.sax.Locator;
 
 import org.apache.fop.apps.FOPException;
+import org.apache.fop.complexscripts.bidi.DelimitedTextRange;
 import org.apache.fop.fo.FONode;
 import org.apache.fop.fo.FObj;
 import org.apache.fop.fo.PropertyList;
@@ -201,5 +204,19 @@ public class ListItem extends FObj imple
     public int getNameId() {
         return FO_LIST_ITEM;
     }
+
+    @Override
+    protected Stack collectDelimitedTextRanges ( Stack ranges, DelimitedTextRange currentRange ) {
+        ListItemLabel label = getLabel();
+        if ( label != null ) {
+            ranges = label.collectDelimitedTextRanges ( ranges );
+        }
+        ListItemBody body = getBody();
+        if ( body != null ) {
+            ranges = body.collectDelimitedTextRanges ( ranges );
+        }
+        return ranges;
+    }
+
 }
 

Modified: xmlgraphics/fop/branches/Temp_URI_Unification/src/java/org/apache/fop/fo/flow/Marker.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_URI_Unification/src/java/org/apache/fop/fo/flow/Marker.java?rev=1343285&r1=1343284&r2=1343285&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_URI_Unification/src/java/org/apache/fop/fo/flow/Marker.java (original)
+++ xmlgraphics/fop/branches/Temp_URI_Unification/src/java/org/apache/fop/fo/flow/Marker.java Mon May 28 15:30:46 2012
@@ -59,7 +59,7 @@ public class Marker extends FObjMixed {
     /** {@inheritDoc} */
     public void bind(PropertyList pList) throws FOPException {
         if (findAncestor(FO_FLOW) < 0) {
-            invalidChildError(locator, getParent().getName(), FO_URI, getName(),
+            invalidChildError(locator, getParent().getName(), FO_URI, getLocalName(),
                 "rule.markerDescendantOfFlow");
         }
 
@@ -357,8 +357,8 @@ public class Marker extends FObjMixed {
     /** Convenience inner class */
     public static final class MarkerAttribute {
 
-        private static PropertyCache attributeCache
-                = new PropertyCache(MarkerAttribute.class);
+        private static final PropertyCache<MarkerAttribute> CACHE
+                = new PropertyCache<MarkerAttribute>();
 
         /** namespace */
         protected String namespace;
@@ -398,7 +398,7 @@ public class Marker extends FObjMixed {
         private static MarkerAttribute getInstance(
                                             String namespace, String qname,
                                             String name, String value) {
-            return attributeCache.fetch(
+            return CACHE.fetch(
                     new MarkerAttribute(namespace, qname, name, value));
         }
 

Modified: xmlgraphics/fop/branches/Temp_URI_Unification/src/java/org/apache/fop/fo/flow/PageNumber.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_URI_Unification/src/java/org/apache/fop/fo/flow/PageNumber.java?rev=1343285&r1=1343284&r2=1343285&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_URI_Unification/src/java/org/apache/fop/fo/flow/PageNumber.java (original)
+++ xmlgraphics/fop/branches/Temp_URI_Unification/src/java/org/apache/fop/fo/flow/PageNumber.java Mon May 28 15:30:46 2012
@@ -199,4 +199,10 @@ public class PageNumber extends FObj
     public int getNameId() {
         return FO_PAGE_NUMBER;
     }
+
+    @Override
+    public boolean isDelimitedTextRangeBoundary ( int boundary ) {
+        return false;
+    }
+
 }

Modified: xmlgraphics/fop/branches/Temp_URI_Unification/src/java/org/apache/fop/fo/flow/RetrieveMarker.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_URI_Unification/src/java/org/apache/fop/fo/flow/RetrieveMarker.java?rev=1343285&r1=1343284&r2=1343285&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_URI_Unification/src/java/org/apache/fop/fo/flow/RetrieveMarker.java (original)
+++ xmlgraphics/fop/branches/Temp_URI_Unification/src/java/org/apache/fop/fo/flow/RetrieveMarker.java Mon May 28 15:30:46 2012
@@ -19,11 +19,12 @@
 
 package org.apache.fop.fo.flow;
 
+import org.xml.sax.Attributes;
+import org.xml.sax.Locator;
+
 import org.apache.fop.apps.FOPException;
 import org.apache.fop.fo.FONode;
 import org.apache.fop.fo.PropertyList;
-import org.xml.sax.Locator;
-import org.xml.sax.Attributes;
 
 /**
  * Class modelling the <a href="http://www.w3.org/TR/xsl/#fo_retrieve-marker">
@@ -59,7 +60,7 @@ public class RetrieveMarker extends Abst
                             PropertyList pList)
             throws FOPException {
         if (findAncestor(FO_STATIC_CONTENT) < 0) {
-            invalidChildError(locator, getParent().getName(), FO_URI, getName(),
+            invalidChildError(locator, getParent().getName(), FO_URI, getLocalName(),
                 "rule.retrieveMarkerDescendantOfStaticContent");
         } else {
             super.processNode(elementName, locator, attlist, pList);
@@ -110,4 +111,4 @@ public class RetrieveMarker extends Abst
     public int getNameId() {
         return FO_RETRIEVE_MARKER;
     }
-}
\ No newline at end of file
+}

Modified: xmlgraphics/fop/branches/Temp_URI_Unification/src/java/org/apache/fop/fo/flow/RetrieveTableMarker.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_URI_Unification/src/java/org/apache/fop/fo/flow/RetrieveTableMarker.java?rev=1343285&r1=1343284&r2=1343285&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_URI_Unification/src/java/org/apache/fop/fo/flow/RetrieveTableMarker.java (original)
+++ xmlgraphics/fop/branches/Temp_URI_Unification/src/java/org/apache/fop/fo/flow/RetrieveTableMarker.java Mon May 28 15:30:46 2012
@@ -19,11 +19,12 @@
 
 package org.apache.fop.fo.flow;
 
+import org.xml.sax.Attributes;
+import org.xml.sax.Locator;
+
+import org.apache.fop.apps.FOPException;
 import org.apache.fop.fo.FONode;
 import org.apache.fop.fo.PropertyList;
-import org.apache.fop.apps.FOPException;
-import org.xml.sax.Locator;
-import org.xml.sax.Attributes;
 
 /**
  * Class modelling the <a href="http://www.w3.org/TR/xsl/#fo_retrieve-table-marker">

Modified: xmlgraphics/fop/branches/Temp_URI_Unification/src/java/org/apache/fop/fo/flow/Wrapper.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_URI_Unification/src/java/org/apache/fop/fo/flow/Wrapper.java?rev=1343285&r1=1343284&r2=1343285&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_URI_Unification/src/java/org/apache/fop/fo/flow/Wrapper.java (original)
+++ xmlgraphics/fop/branches/Temp_URI_Unification/src/java/org/apache/fop/fo/flow/Wrapper.java Mon May 28 15:30:46 2012
@@ -135,5 +135,11 @@ public class Wrapper extends FObjMixed {
     public int getNameId() {
         return FO_WRAPPER;
     }
+
+    @Override
+    public boolean isDelimitedTextRangeBoundary ( int boundary ) {
+        return false;
+    }
+
 }
 

Modified: xmlgraphics/fop/branches/Temp_URI_Unification/src/java/org/apache/fop/fo/flow/table/ConditionalBorder.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_URI_Unification/src/java/org/apache/fop/fo/flow/table/ConditionalBorder.java?rev=1343285&r1=1343284&r2=1343285&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_URI_Unification/src/java/org/apache/fop/fo/flow/table/ConditionalBorder.java (original)
+++ xmlgraphics/fop/branches/Temp_URI_Unification/src/java/org/apache/fop/fo/flow/table/ConditionalBorder.java Mon May 28 15:30:46 2012
@@ -60,6 +60,7 @@ public class ConditionalBorder {
     private ConditionalBorder(BorderSpecification normal,
             BorderSpecification leadingTrailing, BorderSpecification rest,
             CollapsingBorderModel collapsingBorderModel) {
+        assert collapsingBorderModel != null;
         this.normal = normal;
         this.leadingTrailing = leadingTrailing;
         this.rest = rest;
@@ -74,14 +75,10 @@ public class ConditionalBorder {
      */
     ConditionalBorder(BorderSpecification borderSpecification,
             CollapsingBorderModel collapsingBorderModel) {
-        normal = borderSpecification;
-        leadingTrailing = normal;
-        if (borderSpecification.getBorderInfo().getWidth().isDiscard()) {
-            rest = BorderSpecification.getDefaultBorder();
-        } else {
-            rest = leadingTrailing;
-        }
-        this.collapsingBorderModel = collapsingBorderModel;
+        this ( borderSpecification, borderSpecification,
+               borderSpecification.getBorderInfo().getWidth().isDiscard()
+                 ? BorderSpecification.getDefaultBorder() : borderSpecification,
+               collapsingBorderModel );
     }
 
     /**

Modified: xmlgraphics/fop/branches/Temp_URI_Unification/src/java/org/apache/fop/fo/flow/table/PendingSpan.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_URI_Unification/src/java/org/apache/fop/fo/flow/table/PendingSpan.java?rev=1343285&r1=1343284&r2=1343285&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_URI_Unification/src/java/org/apache/fop/fo/flow/table/PendingSpan.java (original)
+++ xmlgraphics/fop/branches/Temp_URI_Unification/src/java/org/apache/fop/fo/flow/table/PendingSpan.java Mon May 28 15:30:46 2012
@@ -55,4 +55,4 @@ class PendingSpan {
         }
     }
 
-}
\ No newline at end of file
+}

Modified: xmlgraphics/fop/branches/Temp_URI_Unification/src/java/org/apache/fop/fo/flow/table/Table.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_URI_Unification/src/java/org/apache/fop/fo/flow/table/Table.java?rev=1343285&r1=1343284&r2=1343285&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_URI_Unification/src/java/org/apache/fop/fo/flow/table/Table.java (original)
+++ xmlgraphics/fop/branches/Temp_URI_Unification/src/java/org/apache/fop/fo/flow/table/Table.java Mon May 28 15:30:46 2012
@@ -20,11 +20,14 @@
 package org.apache.fop.fo.flow.table;
 
 import java.util.ArrayList;
+import java.util.Iterator;
 import java.util.List;
+import java.util.Stack;
 
 import org.xml.sax.Locator;
 
 import org.apache.fop.apps.FOPException;
+import org.apache.fop.complexscripts.bidi.DelimitedTextRange;
 import org.apache.fop.datatypes.Length;
 import org.apache.fop.datatypes.ValidationPercentBaseContext;
 import org.apache.fop.fo.FONode;
@@ -40,15 +43,19 @@ import org.apache.fop.fo.properties.Keep
 import org.apache.fop.fo.properties.LengthPairProperty;
 import org.apache.fop.fo.properties.LengthRangeProperty;
 import org.apache.fop.fo.properties.TableColLength;
+import org.apache.fop.traits.Direction;
+import org.apache.fop.traits.WritingMode;
+import org.apache.fop.traits.WritingModeTraits;
+import org.apache.fop.traits.WritingModeTraitsGetter;
 
 /**
  * Class modelling the <a href="http://www.w3.org/TR/xsl/#fo_table">
  * <code>fo:table</code></a> object.
  */
-public class Table extends TableFObj implements ColumnNumberManagerHolder, BreakPropertySet,
+public class Table extends TableFObj implements ColumnNumberManagerHolder, BreakPropertySet, WritingModeTraitsGetter,
         CommonAccessibilityHolder {
 
-    /** properties */
+    // The value of FO traits (refined properties) that apply to fo:table.
     private CommonAccessibility commonAccessibility;
     private CommonBorderPaddingBackground commonBorderPaddingBackground;
     private CommonMarginBlock commonMarginBlock;
@@ -64,11 +71,12 @@ public class Table extends TableFObj imp
     private int tableLayout;
     private int tableOmitFooterAtBreak;
     private int tableOmitHeaderAtBreak;
+    private WritingModeTraits writingModeTraits;
     // Unused but valid items, commented out for performance:
     //     private CommonAural commonAural;
     //     private CommonRelativePosition commonRelativePosition;
     //     private int intrusionDisplace;
-    //     private int writingMode;
+    // End of FO trait values
 
     /** extension properties */
     private Length widowContentLimit;
@@ -130,6 +138,8 @@ public class Table extends TableFObj imp
         tableLayout = pList.get(PR_TABLE_LAYOUT).getEnum();
         tableOmitFooterAtBreak = pList.get(PR_TABLE_OMIT_FOOTER_AT_BREAK).getEnum();
         tableOmitHeaderAtBreak = pList.get(PR_TABLE_OMIT_HEADER_AT_BREAK).getEnum();
+        writingModeTraits = new WritingModeTraits
+            ( WritingMode.valueOf(pList.get(PR_WRITING_MODE).getEnum()) );
 
         //Bind extension properties
         widowContentLimit = pList.get(PR_X_WIDOW_CONTENT_LIMIT).getLength();
@@ -145,13 +155,19 @@ public class Table extends TableFObj imp
             getFOValidationEventProducer().unimplementedFeature(this, getName(),
                     "table-layout=\"auto\"", getLocator());
         }
-        if (!isSeparateBorderModel()
-                && getCommonBorderPaddingBackground().hasPadding(
-                        ValidationPercentBaseContext.getPseudoContext())) {
-            //See "17.6.2 The collapsing border model" in CSS2
-            TableEventProducer eventProducer = TableEventProducer.Provider.get(
-                    getUserAgent().getEventBroadcaster());
-            eventProducer.noTablePaddingWithCollapsingBorderModel(this, getLocator());
+        if (!isSeparateBorderModel()) {
+            if (borderCollapse == EN_COLLAPSE_WITH_PRECEDENCE) {
+                getFOValidationEventProducer().unimplementedFeature(this, getName(),
+                    "border-collapse=\"collapse-with-precedence\"; defaulting to \"collapse\"", getLocator());
+                borderCollapse = EN_COLLAPSE;
+            }
+            if (getCommonBorderPaddingBackground().hasPadding(
+                            ValidationPercentBaseContext.getPseudoContext())) {
+                //See "17.6.2 The collapsing border model" in CSS2
+                TableEventProducer eventProducer = TableEventProducer.Provider.get(
+                        getUserAgent().getEventBroadcaster());
+                eventProducer.noTablePaddingWithCollapsingBorderModel(this, getLocator());
+            }
         }
 
         /* Store reference to the property list, so
@@ -336,7 +352,6 @@ public class Table extends TableFObj imp
         TableColumn implicitColumn = new TableColumn(this, true);
         PropertyList pList = new StaticPropertyList(
                                 implicitColumn, this.propList);
-        pList.setWritingMode();
         implicitColumn.bind(pList);
         implicitColumn.setColumnWidth(new TableColLength(1.0, implicitColumn));
         implicitColumn.setColumnNumber(colNumber);
@@ -433,14 +448,14 @@ public class Table extends TableFObj imp
     }
 
     /**
-     * @return the "inline-progression-dimension" property.
+     * @return the "inline-progression-dimension" FO trait.
      */
     public LengthRangeProperty getInlineProgressionDimension() {
         return inlineProgressionDimension;
     }
 
     /**
-     * @return the "block-progression-dimension" property.
+     * @return the "block-progression-dimension" FO trait.
      */
     public LengthRangeProperty getBlockProgressionDimension() {
         return blockProgressionDimension;
@@ -460,27 +475,27 @@ public class Table extends TableFObj imp
         return commonBorderPaddingBackground;
     }
 
-    /** @return the "break-after" property. */
+    /** @return the "break-after" FO trait. */
     public int getBreakAfter() {
         return breakAfter;
     }
 
-    /** @return the "break-before" property. */
+    /** @return the "break-before" FO trait. */
     public int getBreakBefore() {
         return breakBefore;
     }
 
-    /** @return the "keep-with-next" property.  */
+    /** @return the "keep-with-next" FO trait.  */
     public KeepProperty getKeepWithNext() {
         return keepWithNext;
     }
 
-    /** @return the "keep-with-previous" property.  */
+    /** @return the "keep-with-previous" FO trait.  */
     public KeepProperty getKeepWithPrevious() {
         return keepWithPrevious;
     }
 
-    /** @return the "keep-together" property.  */
+    /** @return the "keep-together" FO trait.  */
     public KeepProperty getKeepTogether() {
         return keepTogether;
     }
@@ -494,7 +509,7 @@ public class Table extends TableFObj imp
                 || !getKeepTogether().getWithinColumn().isAuto();
     }
 
-    /** @return the "border-collapse" property. */
+    /** @return the "border-collapse" FO trait. */
     public int getBorderCollapse() {
         return borderCollapse;
     }
@@ -504,17 +519,47 @@ public class Table extends TableFObj imp
         return (getBorderCollapse() == EN_SEPARATE);
     }
 
-    /** @return the "border-separation" property. */
+    /** @return the "border-separation" FO trait. */
     public LengthPairProperty getBorderSeparation() {
         return borderSeparation;
     }
 
-    /** @return the "fox:widow-content-limit" extension property */
+    /** {@inheritDoc} */
+    public Direction getInlineProgressionDirection() {
+        return writingModeTraits.getInlineProgressionDirection();
+    }
+
+    /** {@inheritDoc} */
+    public Direction getBlockProgressionDirection() {
+        return writingModeTraits.getBlockProgressionDirection();
+    }
+
+    /** {@inheritDoc} */
+    public Direction getColumnProgressionDirection() {
+        return writingModeTraits.getColumnProgressionDirection();
+    }
+
+    /** {@inheritDoc} */
+    public Direction getRowProgressionDirection() {
+        return writingModeTraits.getRowProgressionDirection();
+    }
+
+    /** {@inheritDoc} */
+    public Direction getShiftDirection() {
+        return writingModeTraits.getShiftDirection();
+    }
+
+    /** {@inheritDoc} */
+    public WritingMode getWritingMode() {
+        return writingModeTraits.getWritingMode();
+    }
+
+    /** @return the "fox:widow-content-limit" extension FO trait */
     public Length getWidowContentLimit() {
         return widowContentLimit;
     }
 
-    /** @return the "fox:orphan-content-limit" extension property */
+    /** @return the "fox:orphan-content-limit" extension FO trait */
     public Length getOrphanContentLimit() {
         return orphanContentLimit;
     }
@@ -555,4 +600,24 @@ public class Table extends TableFObj imp
     RowGroupBuilder getRowGroupBuilder() {
         return rowGroupBuilder;
     }
+
+    @Override
+    protected Stack collectDelimitedTextRanges ( Stack ranges, DelimitedTextRange currentRange ) {
+        // header sub-tree
+        TableHeader header = getTableHeader();
+        if ( header != null ) {
+            ranges = header.collectDelimitedTextRanges ( ranges );
+        }
+        // footer sub-tree
+        TableFooter footer = getTableFooter();
+        if ( footer != null ) {
+            ranges = footer.collectDelimitedTextRanges ( ranges );
+        }
+        // body sub-tree
+        for ( Iterator it = getChildNodes(); ( it != null ) && it.hasNext();) {
+            ranges = ( (FONode) it.next() ).collectDelimitedTextRanges ( ranges );
+        }
+        return ranges;
+    }
+
 }

Modified: xmlgraphics/fop/branches/Temp_URI_Unification/src/java/org/apache/fop/fo/flow/table/TableBody.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_URI_Unification/src/java/org/apache/fop/fo/flow/table/TableBody.java?rev=1343285&r1=1343284&r2=1343285&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_URI_Unification/src/java/org/apache/fop/fo/flow/table/TableBody.java (original)
+++ xmlgraphics/fop/branches/Temp_URI_Unification/src/java/org/apache/fop/fo/flow/table/TableBody.java Mon May 28 15:30:46 2012
@@ -19,8 +19,8 @@
 
 package org.apache.fop.fo.flow.table;
 
-import org.apache.fop.fo.FONode;
 import org.apache.fop.apps.FOPException;
+import org.apache.fop.fo.FONode;
 
 /**
  * Class modelling the <a href="http://www.w3.org/TR/xsl/#fo_table-body">

Modified: xmlgraphics/fop/branches/Temp_URI_Unification/src/java/org/apache/fop/fo/flow/table/VariableColRowGroupBuilder.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_URI_Unification/src/java/org/apache/fop/fo/flow/table/VariableColRowGroupBuilder.java?rev=1343285&r1=1343284&r2=1343285&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_URI_Unification/src/java/org/apache/fop/fo/flow/table/VariableColRowGroupBuilder.java (original)
+++ xmlgraphics/fop/branches/Temp_URI_Unification/src/java/org/apache/fop/fo/flow/table/VariableColRowGroupBuilder.java Mon May 28 15:30:46 2012
@@ -40,7 +40,7 @@ class VariableColRowGroupBuilder extends
      * Each event is recorded and will be played once the table is finished, and the final
      * number of columns known.
      */
-    private static interface Event {
+    private interface Event {
         /**
          * Plays this event
          *

Modified: xmlgraphics/fop/branches/Temp_URI_Unification/src/java/org/apache/fop/fo/pagination/AbstractPageSequence.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_URI_Unification/src/java/org/apache/fop/fo/pagination/AbstractPageSequence.java?rev=1343285&r1=1343284&r2=1343285&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_URI_Unification/src/java/org/apache/fop/fo/pagination/AbstractPageSequence.java (original)
+++ xmlgraphics/fop/branches/Temp_URI_Unification/src/java/org/apache/fop/fo/pagination/AbstractPageSequence.java Mon May 28 15:30:46 2012
@@ -24,6 +24,8 @@ import org.apache.fop.datatypes.Numeric;
 import org.apache.fop.fo.FONode;
 import org.apache.fop.fo.FObj;
 import org.apache.fop.fo.PropertyList;
+import org.apache.fop.fo.properties.CommonAccessibility;
+import org.apache.fop.fo.properties.CommonAccessibilityHolder;
 
 /**
  * Abstract base class for the <a href="http://www.w3.org/TR/xsl/#fo_page-sequence">
@@ -31,9 +33,8 @@ import org.apache.fop.fo.PropertyList;
  * <a href="http://xmlgraphics.apache.org/fop/0.95/extensions.html#external-document">
  * <code>fox:external-document</code></a> extension object.
  */
-public abstract class AbstractPageSequence extends FObj {
+public abstract class AbstractPageSequence extends FObj implements CommonAccessibilityHolder {
 
-    // The value of properties relevant for fo:page-sequence.
     /** initial page number */
     protected Numeric initialPageNumber;
     /** forced page count */
@@ -42,8 +43,12 @@ public abstract class AbstractPageSequen
     private int letterValue;
     private char groupingSeparator;
     private int groupingSize;
-    private Numeric referenceOrientation; //XSL 1.1
-    // End of property values
+    private Numeric referenceOrientation;
+    private String language;
+    private String country;
+    private String numberConversionFeatures;
+
+    private CommonAccessibility commonAccessibility;
 
     private PageNumberGenerator pageNumberGenerator;
 
@@ -70,12 +75,17 @@ public abstract class AbstractPageSequen
         groupingSeparator = pList.get(PR_GROUPING_SEPARATOR).getCharacter();
         groupingSize = pList.get(PR_GROUPING_SIZE).getNumber().intValue();
         referenceOrientation = pList.get(PR_REFERENCE_ORIENTATION).getNumeric();
+        language = pList.get(PR_LANGUAGE).getString();
+        country = pList.get(PR_COUNTRY).getString();
+        numberConversionFeatures = pList.get(PR_X_NUMBER_CONVERSION_FEATURES).getString();
+        commonAccessibility = CommonAccessibility.getInstance(pList);
     }
 
     /** {@inheritDoc} */
     protected void startOfNode() throws FOPException {
         this.pageNumberGenerator = new PageNumberGenerator(
-                format, groupingSeparator, groupingSize, letterValue);
+                format, groupingSeparator, groupingSize, letterValue,
+                numberConversionFeatures, language, country);
 
     }
 
@@ -123,6 +133,10 @@ public abstract class AbstractPageSequen
         return pageNumberGenerator.makeFormattedPageNumber(pageNumber);
     }
 
+    public CommonAccessibility getCommonAccessibility() {
+        return commonAccessibility;
+    }
+
     /**
      * Public accessor for the ancestor Root.
      * @return the ancestor Root

Modified: xmlgraphics/fop/branches/Temp_URI_Unification/src/java/org/apache/fop/fo/pagination/ColorProfile.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_URI_Unification/src/java/org/apache/fop/fo/pagination/ColorProfile.java?rev=1343285&r1=1343284&r2=1343285&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_URI_Unification/src/java/org/apache/fop/fo/pagination/ColorProfile.java (original)
+++ xmlgraphics/fop/branches/Temp_URI_Unification/src/java/org/apache/fop/fo/pagination/ColorProfile.java Mon May 28 15:30:46 2012
@@ -19,14 +19,14 @@
 
 package org.apache.fop.fo.pagination;
 
+import org.xml.sax.Locator;
+
 import org.apache.fop.apps.FOPException;
 import org.apache.fop.fo.FONode;
 import org.apache.fop.fo.FObj;
 import org.apache.fop.fo.PropertyList;
 import org.apache.fop.fo.ValidationException;
 
-import org.xml.sax.Locator;
-
 /**
  * Class modelling the <a href="http://www.w3.org/TR/xsl/#fo_color-profile">
  * <code>fo:color-profile</code></a> object.

Modified: xmlgraphics/fop/branches/Temp_URI_Unification/src/java/org/apache/fop/fo/pagination/Flow.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_URI_Unification/src/java/org/apache/fop/fo/pagination/Flow.java?rev=1343285&r1=1343284&r2=1343285&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_URI_Unification/src/java/org/apache/fop/fo/pagination/Flow.java (original)
+++ xmlgraphics/fop/branches/Temp_URI_Unification/src/java/org/apache/fop/fo/pagination/Flow.java Mon May 28 15:30:46 2012
@@ -26,16 +26,19 @@ import org.apache.fop.fo.FONode;
 import org.apache.fop.fo.FObj;
 import org.apache.fop.fo.PropertyList;
 import org.apache.fop.fo.ValidationException;
+import org.apache.fop.fo.properties.CommonAccessibility;
+import org.apache.fop.fo.properties.CommonAccessibilityHolder;
 
 /**
  * Class modelling the <a href="http://www.w3.org/TR/xsl/#fo_flow">
  * <code>fo:flow</code></a> object.
  *
  */
-public class Flow extends FObj {
-    // The value of properties relevant for fo:flow.
+public class Flow extends FObj implements CommonAccessibilityHolder {
+
     private String flowName;
-    // End of property values
+
+    private CommonAccessibility commonAccessibility;
 
     /** used for FO validation */
     private boolean blockItemFound = false;
@@ -52,6 +55,7 @@ public class Flow extends FObj {
     public void bind(PropertyList pList) throws FOPException {
         super.bind(pList);
         flowName = pList.get(PR_FLOW_NAME).getString();
+        commonAccessibility = CommonAccessibility.getInstance(pList);
     }
 
     /** {@inheritDoc} */
@@ -120,6 +124,10 @@ public class Flow extends FObj {
         return flowName;
     }
 
+    public CommonAccessibility getCommonAccessibility() {
+        return commonAccessibility;
+    }
+
     /** {@inheritDoc} */
     public String getLocalName() {
         return "flow";

Modified: xmlgraphics/fop/branches/Temp_URI_Unification/src/java/org/apache/fop/fo/pagination/PageNumberGenerator.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_URI_Unification/src/java/org/apache/fop/fo/pagination/PageNumberGenerator.java?rev=1343285&r1=1343284&r2=1343285&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_URI_Unification/src/java/org/apache/fop/fo/pagination/PageNumberGenerator.java (original)
+++ xmlgraphics/fop/branches/Temp_URI_Unification/src/java/org/apache/fop/fo/pagination/PageNumberGenerator.java Mon May 28 15:30:46 2012
@@ -19,84 +19,38 @@
 
 package org.apache.fop.fo.pagination;
 
+import org.apache.fop.complexscripts.util.NumberConverter;
+
+// CSOFF: LineLengthCheck
+
 /**
- * This class uses the 'format', 'groupingSeparator', 'groupingSize',
+ * <p>This class uses the 'format', 'groupingSeparator', 'groupingSize',
  * and 'letterValue' properties on fo:page-sequence to return a String
- * corresponding to the supplied integer page number.
+ * corresponding to the supplied integer page number.</p>
+ *
+ * <p>In addition, (now) uses 'language' parameter and new 'fox:page-number-features'
+ * parameter to express applicable language and number conversion features.</p>
+ *
+ * <p>This work was authored by Glenn Adams (gadams@apache.org), based on a
+ * rewrite of prior work to use the new <code>NumberConverter</code> utility class.</p>
+ * @see NumberConverter
  */
 public class PageNumberGenerator {
 
-    private String format;
-    private char groupingSeparator;
-    private int groupingSize;
-    private int letterValue;
-
-    // constants
-    private static final int DECIMAL = 1;       // '0*1'
-    private static final int LOWERALPHA = 2;    // 'a'
-    private static final int UPPERALPHA = 3;    // 'A'
-    private static final int LOWERROMAN = 4;    // 'i'
-    private static final int UPPERROMAN = 5;    // 'I'
-
-    // flags
-    private int formatType = DECIMAL;
-    private int minPadding = 0;    // for decimal formats
-
-    // preloaded strings of zeros
-    private String[] zeros = {
-        "", "0", "00", "000", "0000", "00000"
-    };
+    private NumberConverter converter;
 
     /**
-     * Main constructor. For further information on the parameters see the XSLT
-     * specs (Number to String Conversion Attributes).
-     * @param format format for the page number
-     * @param groupingSeparator grouping separator
-     * @param groupingSize grouping size
+     * Main constructor. For further information on the parameters see {@link NumberConverter}.
+     * @param format format for the page number (may be null or empty, which is treated as null)
+     * @param groupingSeparator grouping separator (if zero, then no grouping separator applies)
+     * @param groupingSize grouping size (if zero or negative, then no grouping size applies)
      * @param letterValue letter value
+     * @param features features (feature sub-parameters)
+     * @param language (may be null or empty, which is treated as null)
+     * @param country (may be null or empty, which is treated as null)
      */
-    public PageNumberGenerator(String format, char groupingSeparator,
-                               int groupingSize, int letterValue) {
-        this.format = format;
-        this.groupingSeparator = groupingSeparator;
-        this.groupingSize = groupingSize;
-        this.letterValue = letterValue;
-
-        // the only accepted format strings are currently '0*1' 'a', 'A', 'i'
-        // and 'I'
-        int fmtLen = format.length();
-        if (fmtLen == 1) {
-            if (format.equals("1")) {
-                formatType = DECIMAL;
-                minPadding = 0;
-            } else if (format.equals("a")) {
-                formatType = LOWERALPHA;
-            } else if (format.equals("A")) {
-                formatType = UPPERALPHA;
-            } else if (format.equals("i")) {
-                formatType = LOWERROMAN;
-            } else if (format.equals("I")) {
-                formatType = UPPERROMAN;
-            } else {
-                // token not handled
-                //getLogger().debug("'format' token not recognized; using '1'");
-                formatType = DECIMAL;
-                minPadding = 0;
-            }
-        } else {
-            // only accepted token is '0+1'at this stage. Because of the
-            // wonderful regular expression support in Java, we will resort to a
-            // loop
-            for (int i = 0; i < fmtLen - 1; i++) {
-                if (format.charAt(i) != '0') {
-                    //getLogger().debug("'format' token not recognized; using '1'");
-                    formatType = DECIMAL;
-                    minPadding = 0;
-                } else {
-                    minPadding = fmtLen - 1;
-                }
-            }
-        }
+    public PageNumberGenerator ( String format, int groupingSeparator, int groupingSize, int letterValue, String features, String language, String country ) {
+        this.converter = new NumberConverter ( format, groupingSeparator, groupingSize, letterValue, features, language, country );
     }
 
     /**
@@ -104,70 +58,9 @@ public class PageNumberGenerator {
      * @param number page number to format
      * @return the formatted page number as a String
      */
-    public String makeFormattedPageNumber(int number) {
-        String pn = null;
-        if (formatType == DECIMAL) {
-            pn = Integer.toString(number);
-            if (minPadding >= pn.length()) {
-                int nz = minPadding - pn.length() + 1;
-                pn = zeros[nz] + pn;
-            }
-        } else if ((formatType == LOWERROMAN) || (formatType == UPPERROMAN)) {
-            pn = makeRoman(number);
-            if (formatType == UPPERROMAN) {
-                pn = pn.toUpperCase();
-            }
-        } else {
-            // alphabetic
-            pn = makeAlpha(number);
-            if (formatType == UPPERALPHA) {
-                pn = pn.toUpperCase();
-            }
-        }
-        return pn;
+    public String makeFormattedPageNumber ( int number ) {
+        return converter.convert ( number );
     }
 
-    private String makeRoman(int num) {
-        int[] arabic = {
-            1000, 900, 500, 400, 100, 90, 50, 40, 10, 9, 5, 4, 1
-        };
-        String[] roman = {
-            "m", "cm", "d", "cd", "c", "xc", "l", "xl", "x", "ix", "v", "iv",
-            "i"
-        };
-
-        int i = 0;
-        StringBuffer romanNumber = new StringBuffer();
-
-        while (num > 0) {
-            while (num >= arabic[i]) {
-                num = num - arabic[i];
-                romanNumber.append(roman[i]);
-            }
-            i = i + 1;
-        }
-        return romanNumber.toString();
-    }
-
-    private String makeAlpha(int num) {
-        String letters = "abcdefghijklmnopqrstuvwxyz";
-        StringBuffer alphaNumber = new StringBuffer();
-
-        int base = 26;
-        int rem = 0;
-
-        num--;
-        if (num < base) {
-            alphaNumber.append(letters.charAt(num));
-        } else {
-            while (num >= base) {
-                rem = num % base;
-                alphaNumber.append(letters.charAt(rem));
-                num = num / base;
-            }
-            alphaNumber.append(letters.charAt(num - 1));
-        }
-        return alphaNumber.reverse().toString();
-    }
 }
 

Modified: xmlgraphics/fop/branches/Temp_URI_Unification/src/java/org/apache/fop/fo/pagination/PageSequence.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_URI_Unification/src/java/org/apache/fop/fo/pagination/PageSequence.java?rev=1343285&r1=1343284&r2=1343285&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_URI_Unification/src/java/org/apache/fop/fo/pagination/PageSequence.java (original)
+++ xmlgraphics/fop/branches/Temp_URI_Unification/src/java/org/apache/fop/fo/pagination/PageSequence.java Mon May 28 15:30:46 2012
@@ -19,28 +19,35 @@
 
 package org.apache.fop.fo.pagination;
 
-// Java
 import java.util.Map;
+import java.util.Stack;
 
 import org.xml.sax.Locator;
 
 import org.apache.fop.apps.FOPException;
+import org.apache.fop.complexscripts.bidi.DelimitedTextRange;
+import org.apache.fop.datatypes.Numeric;
 import org.apache.fop.fo.FONode;
 import org.apache.fop.fo.PropertyList;
 import org.apache.fop.fo.ValidationException;
+import org.apache.fop.traits.Direction;
+import org.apache.fop.traits.WritingMode;
+import org.apache.fop.traits.WritingModeTraits;
+import org.apache.fop.traits.WritingModeTraitsGetter;
 
 /**
  * Class modelling the <a href="http://www.w3.org/TR/xsl/#fo_page-sequence">
  * <code>fo:page-sequence</code></a> object.
  */
-public class PageSequence extends AbstractPageSequence {
+public class PageSequence extends AbstractPageSequence implements WritingModeTraitsGetter {
 
-    // The value of properties relevant for fo:page-sequence.
+    // The value of FO traits (refined properties) that apply to fo:page-sequence.
     private String country;
     private String language;
     private String masterReference;
-    //private int writingMode; //XSL 1.1
-    // End of property values
+    private Numeric referenceOrientation;
+    private WritingModeTraits writingModeTraits;
+    // End of trait values
 
     // There doesn't seem to be anything in the spec requiring flows
     // to be in the order given, only that they map to the regions
@@ -86,8 +93,9 @@ public class PageSequence extends Abstra
         country = pList.get(PR_COUNTRY).getString();
         language = pList.get(PR_LANGUAGE).getString();
         masterReference = pList.get(PR_MASTER_REFERENCE).getString();
-        //writingMode = pList.getWritingMode();
-
+        referenceOrientation = pList.get(PR_REFERENCE_ORIENTATION).getNumeric();
+        writingModeTraits = new WritingModeTraits
+            ( WritingMode.valueOf(pList.get(PR_WRITING_MODE).getEnum()) );
         if (masterReference == null || masterReference.equals("")) {
             missingPropertyError("master-reference");
         }
@@ -292,8 +300,8 @@ public class PageSequence extends Abstra
     }
 
     /**
-     * Get the value of the <code>master-reference</code> property.
-     * @return the "master-reference" property
+     * Get the value of the <code>master-reference</code> trait.
+     * @return the "master-reference" trait
      */
     public String getMasterReference() {
         return masterReference;
@@ -313,22 +321,120 @@ public class PageSequence extends Abstra
     }
 
     /**
-     * Get the value of the <code>country</code> property.
-     * @return the country property value
+     * Get the value of the <code>country</code> trait.
+     * @return the country trait value
      */
     public String getCountry() {
         return this.country;
     }
 
     /**
-     * Get the value of the <code>language</code> property.
-     * @return the language property value
+     * Get the value of the <code>language</code> trait.
+     * @return the language trait value
      */
     public String getLanguage() {
         return this.language;
     }
 
     /**
+     * Get the value of the <code>reference-orientation</code> trait.
+     * @return the reference orientation trait value
+     */
+    public int getReferenceOrientation() {
+        if ( referenceOrientation != null ) {
+            return referenceOrientation.getValue();
+        } else {
+            return 0;
+        }
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    public Direction getInlineProgressionDirection() {
+        if ( writingModeTraits != null ) {
+            return writingModeTraits.getInlineProgressionDirection();
+        } else {
+            return Direction.LR;
+        }
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    public Direction getBlockProgressionDirection() {
+        if ( writingModeTraits != null ) {
+            return writingModeTraits.getBlockProgressionDirection();
+        } else {
+            return Direction.TB;
+        }
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    public Direction getColumnProgressionDirection() {
+        if ( writingModeTraits != null ) {
+            return writingModeTraits.getColumnProgressionDirection();
+        } else {
+            return Direction.LR;
+        }
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    public Direction getRowProgressionDirection() {
+        if ( writingModeTraits != null ) {
+            return writingModeTraits.getRowProgressionDirection();
+        } else {
+            return Direction.TB;
+        }
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    public Direction getShiftDirection() {
+        if ( writingModeTraits != null ) {
+            return writingModeTraits.getShiftDirection();
+        } else {
+            return Direction.TB;
+        }
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    public WritingMode getWritingMode() {
+        if ( writingModeTraits != null ) {
+            return writingModeTraits.getWritingMode();
+        } else {
+            return WritingMode.LR_TB;
+        }
+    }
+
+
+    @Override
+    protected Stack collectDelimitedTextRanges ( Stack ranges, DelimitedTextRange currentRange ) {
+        // collect ranges from static content flows
+        Map<String, FONode> flows = getFlowMap();
+        if ( flows != null ) {
+            for ( FONode fn : flows.values() ) {
+                if ( fn instanceof StaticContent ) {
+                    ranges = ( (StaticContent) fn ).collectDelimitedTextRanges ( ranges );
+                }
+            }
+        }
+        // collect ranges in main flow
+        Flow main = getMainFlow();
+        if ( main != null ) {
+            ranges = main.collectDelimitedTextRanges ( ranges );
+        }
+        return ranges;
+    }
+
+    /**
      * Releases a page-sequence's children after the page-sequence has been fully processed.
      */
     public void releasePageSequence() {

Modified: xmlgraphics/fop/branches/Temp_URI_Unification/src/java/org/apache/fop/fo/pagination/PageSequenceMaster.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_URI_Unification/src/java/org/apache/fop/fo/pagination/PageSequenceMaster.java?rev=1343285&r1=1343284&r2=1343285&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_URI_Unification/src/java/org/apache/fop/fo/pagination/PageSequenceMaster.java (original)
+++ xmlgraphics/fop/branches/Temp_URI_Unification/src/java/org/apache/fop/fo/pagination/PageSequenceMaster.java Mon May 28 15:30:46 2012
@@ -218,7 +218,7 @@ public class PageSequenceMaster extends 
             if (nextSubSequence == null) {
                 //Sub-sequence exhausted so attempt to reuse it
                 blockLevelEventProducer.pageSequenceMasterExhausted(this,
-                        masterName, canRecover, getLocator());
+                        masterName, canRecover & currentSubSequence.isReusable(), getLocator());
                 currentSubSequence.reset();
                 if (!currentSubSequence.canProcess(mainFlowName)) {
                     throw new PageProductionException(

Modified: xmlgraphics/fop/branches/Temp_URI_Unification/src/java/org/apache/fop/fo/pagination/PageSequenceWrapper.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_URI_Unification/src/java/org/apache/fop/fo/pagination/PageSequenceWrapper.java?rev=1343285&r1=1343284&r2=1343285&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_URI_Unification/src/java/org/apache/fop/fo/pagination/PageSequenceWrapper.java (original)
+++ xmlgraphics/fop/branches/Temp_URI_Unification/src/java/org/apache/fop/fo/pagination/PageSequenceWrapper.java Mon May 28 15:30:46 2012
@@ -22,8 +22,8 @@ package org.apache.fop.fo.pagination;
 import org.xml.sax.Locator;
 
 import org.apache.fop.apps.FOPException;
-import org.apache.fop.fo.FObj;
 import org.apache.fop.fo.FONode;
+import org.apache.fop.fo.FObj;
 import org.apache.fop.fo.PropertyList;
 import org.apache.fop.fo.ValidationException;
 

Modified: xmlgraphics/fop/branches/Temp_URI_Unification/src/java/org/apache/fop/fo/pagination/Region.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_URI_Unification/src/java/org/apache/fop/fo/pagination/Region.java?rev=1343285&r1=1343284&r2=1343285&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_URI_Unification/src/java/org/apache/fop/fo/pagination/Region.java (original)
+++ xmlgraphics/fop/branches/Temp_URI_Unification/src/java/org/apache/fop/fo/pagination/Region.java Mon May 28 15:30:46 2012
@@ -32,20 +32,21 @@ import org.apache.fop.fo.FObj;
 import org.apache.fop.fo.PropertyList;
 import org.apache.fop.fo.ValidationException;
 import org.apache.fop.fo.properties.CommonBorderPaddingBackground;
+import org.apache.fop.traits.WritingMode;
 
 /**
  * This is an abstract base class for pagination regions.
  */
 public abstract class Region extends FObj {
-    // The value of properties relevant for fo:region
+    // The value of FO traits (refined properties) that apply to fo:region
     private CommonBorderPaddingBackground commonBorderPaddingBackground;
     // private ToBeImplementedProperty clip
     private int displayAlign;
     private int overflow;
     private String regionName;
     private Numeric referenceOrientation;
-    private int writingMode;
-    // End of property values
+    private WritingMode writingMode;
+    // End of FO trait values
 
     /** the parent {@link SimplePageMaster} */
     protected final SimplePageMaster layoutMaster;
@@ -68,7 +69,7 @@ public abstract class Region extends FOb
         overflow = pList.get(PR_OVERFLOW).getEnum();
         regionName = pList.get(PR_REGION_NAME).getString();
         referenceOrientation = pList.get(PR_REFERENCE_ORIENTATION).getNumeric();
-        writingMode = pList.getWritingMode();
+        writingMode = WritingMode.valueOf(pList.get(PR_WRITING_MODE).getEnum());
 
         // regions may have name, or default
         if (regionName.equals("")) {
@@ -169,28 +170,28 @@ public abstract class Region extends FOb
         return commonBorderPaddingBackground;
     }
 
-    /** @return the "region-name" property. */
+    /** @return the "region-name" FO trait. */
     public String getRegionName() {
         return regionName;
     }
 
-    /** @return the "writing-mode" property. */
-    public int getWritingMode() {
-        return writingMode;
-    }
-
-    /** @return the "overflow" property. */
+    /** @return the "overflow" FO trait. */
     public int getOverflow() {
         return overflow;
     }
 
-    /** @return the display-align property. */
+    /** @return the display-align FO trait. */
     public int getDisplayAlign() {
         return displayAlign;
     }
 
-    /** @return the "reference-orientation" property. */
+    /** @return the "reference-orientation" FO trait. */
     public int getReferenceOrientation() {
         return referenceOrientation.getValue();
     }
+
+    /** @return the "writing-mode" FO trait. */
+    public WritingMode getWritingMode() {
+        return writingMode;
+    }
 }

Modified: xmlgraphics/fop/branches/Temp_URI_Unification/src/java/org/apache/fop/fo/pagination/RegionAfter.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_URI_Unification/src/java/org/apache/fop/fo/pagination/RegionAfter.java?rev=1343285&r1=1343284&r2=1343285&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_URI_Unification/src/java/org/apache/fop/fo/pagination/RegionAfter.java (original)
+++ xmlgraphics/fop/branches/Temp_URI_Unification/src/java/org/apache/fop/fo/pagination/RegionAfter.java Mon May 28 15:30:46 2012
@@ -19,14 +19,13 @@
 
 package org.apache.fop.fo.pagination;
 
-// Java
 import java.awt.Rectangle;
 
-// FOP
-import org.apache.fop.fo.FONode;
 import org.apache.fop.datatypes.FODimension;
 import org.apache.fop.datatypes.LengthBase;
 import org.apache.fop.datatypes.PercentBaseContext;
+import org.apache.fop.fo.Constants;
+import org.apache.fop.fo.FONode;
 
 /**
  * Class modelling the <a href="http://www.w3.org/TR/xsl/#fo_region-after">
@@ -52,15 +51,22 @@ public class RegionAfter extends RegionB
         PercentBaseContext pageHeightContext = getPageHeightContext(LengthBase.CUSTOM_BASE);
         PercentBaseContext neighbourContext;
         Rectangle vpRect;
-        if (layoutMaster.getWritingMode() == EN_LR_TB
-                || layoutMaster.getWritingMode() == EN_RL_TB) {
-            neighbourContext = pageWidthContext;
-            vpRect = new Rectangle(0, reldims.bpd - getExtent().getValue(pageHeightContext)
-                                   , reldims.ipd, getExtent().getValue(pageHeightContext));
-        } else {
+
+        // [TBD] WRITING MODE ALERT
+        switch ( getWritingMode().getEnumValue() ) {
+        case Constants.EN_TB_LR:
+        case Constants.EN_TB_RL:
             neighbourContext = pageHeightContext;
-            vpRect = new Rectangle(0, reldims.bpd - getExtent().getValue(pageWidthContext)
-                                   , getExtent().getValue(pageWidthContext), reldims.ipd);
+            vpRect = new Rectangle(0, reldims.bpd - getExtent().getValue(pageWidthContext),
+                                   getExtent().getValue(pageWidthContext), reldims.ipd);
+            break;
+        case Constants.EN_LR_TB:
+        case Constants.EN_RL_TB:
+        default:
+            neighbourContext = pageWidthContext;
+            vpRect = new Rectangle(0, reldims.bpd - getExtent().getValue(pageHeightContext),
+                                   reldims.ipd, getExtent().getValue(pageHeightContext));
+            break;
         }
         if (getPrecedence() == EN_FALSE) {
             adjustIPD(vpRect, layoutMaster.getWritingMode(), neighbourContext);

Modified: xmlgraphics/fop/branches/Temp_URI_Unification/src/java/org/apache/fop/fo/pagination/RegionBA.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_URI_Unification/src/java/org/apache/fop/fo/pagination/RegionBA.java?rev=1343285&r1=1343284&r2=1343285&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_URI_Unification/src/java/org/apache/fop/fo/pagination/RegionBA.java (original)
+++ xmlgraphics/fop/branches/Temp_URI_Unification/src/java/org/apache/fop/fo/pagination/RegionBA.java Mon May 28 15:30:46 2012
@@ -26,6 +26,7 @@ import org.apache.fop.apps.FOPException;
 import org.apache.fop.datatypes.PercentBaseContext;
 import org.apache.fop.fo.FONode;
 import org.apache.fop.fo.PropertyList;
+import org.apache.fop.traits.WritingMode;
 
 /**
  * Abstract base class for <a href="http://www.w3.org/TR/xsl/#fo_region-before">
@@ -70,7 +71,8 @@ public abstract class RegionBA extends S
      * @param wm writing mode
      * @param siblingContext the context to use to resolve extent on siblings
      */
-    protected void adjustIPD(Rectangle vpRefRect, int wm, PercentBaseContext siblingContext) {
+    protected void adjustIPD
+        ( Rectangle vpRefRect, WritingMode wm, PercentBaseContext siblingContext ) {
         int offset = 0;
         RegionStart start = (RegionStart) getSiblingRegion(FO_REGION_START);
         if (start != null) {
@@ -81,8 +83,9 @@ public abstract class RegionBA extends S
         if (end != null) {
             offset += end.getExtent().getValue(siblingContext);
         }
+        // [TBD] WRITING MODE ALERT
         if (offset > 0) {
-            if (wm == EN_LR_TB || wm == EN_RL_TB) {
+            if (wm == WritingMode.LR_TB || wm == WritingMode.RL_TB) {
                 vpRefRect.width -= offset;
             } else {
                 vpRefRect.height -= offset;

Modified: xmlgraphics/fop/branches/Temp_URI_Unification/src/java/org/apache/fop/fo/pagination/RegionBefore.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_URI_Unification/src/java/org/apache/fop/fo/pagination/RegionBefore.java?rev=1343285&r1=1343284&r2=1343285&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_URI_Unification/src/java/org/apache/fop/fo/pagination/RegionBefore.java (original)
+++ xmlgraphics/fop/branches/Temp_URI_Unification/src/java/org/apache/fop/fo/pagination/RegionBefore.java Mon May 28 15:30:46 2012
@@ -19,13 +19,12 @@
 
 package org.apache.fop.fo.pagination;
 
-// Java
 import java.awt.Rectangle;
 
-// FOP
 import org.apache.fop.datatypes.FODimension;
 import org.apache.fop.datatypes.LengthBase;
 import org.apache.fop.datatypes.PercentBaseContext;
+import org.apache.fop.fo.Constants;
 import org.apache.fop.fo.FONode;
 
 /**
@@ -57,13 +56,19 @@ public class RegionBefore extends Region
         PercentBaseContext pageHeightContext = getPageHeightContext(LengthBase.CUSTOM_BASE);
         PercentBaseContext neighbourContext;
         Rectangle vpRect;
-        if (layoutMaster.getWritingMode() == EN_LR_TB
-                || layoutMaster.getWritingMode() == EN_RL_TB) {
-            neighbourContext = pageWidthContext;
-            vpRect = new Rectangle(0, 0, reldims.ipd, getExtent().getValue(pageHeightContext));
-        } else {
+        // [TBD] WRITING MODE ALERT
+        switch ( getWritingMode().getEnumValue() ) {
+        case Constants.EN_TB_LR:
+        case Constants.EN_TB_RL:
             neighbourContext = pageHeightContext;
             vpRect = new Rectangle(0, 0, getExtent().getValue(pageWidthContext), reldims.ipd);
+            break;
+        case Constants.EN_LR_TB:
+        case Constants.EN_RL_TB:
+        default:
+            neighbourContext = pageWidthContext;
+            vpRect = new Rectangle(0, 0, reldims.ipd, getExtent().getValue(pageHeightContext));
+            break;
         }
         if (getPrecedence() == EN_FALSE) {
             adjustIPD(vpRect, layoutMaster.getWritingMode(), neighbourContext);

Modified: xmlgraphics/fop/branches/Temp_URI_Unification/src/java/org/apache/fop/fo/pagination/RegionBody.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_URI_Unification/src/java/org/apache/fop/fo/pagination/RegionBody.java?rev=1343285&r1=1343284&r2=1343285&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_URI_Unification/src/java/org/apache/fop/fo/pagination/RegionBody.java (original)
+++ xmlgraphics/fop/branches/Temp_URI_Unification/src/java/org/apache/fop/fo/pagination/RegionBody.java Mon May 28 15:30:46 2012
@@ -28,6 +28,7 @@ import org.apache.fop.datatypes.Length;
 import org.apache.fop.datatypes.LengthBase;
 import org.apache.fop.datatypes.Numeric;
 import org.apache.fop.datatypes.PercentBaseContext;
+import org.apache.fop.fo.Constants;
 import org.apache.fop.fo.FONode;
 import org.apache.fop.fo.PropertyList;
 import org.apache.fop.fo.properties.CommonMarginBlock;
@@ -113,12 +114,22 @@ public class RegionBody extends Region {
 
         int start;
         int end;
-        if (layoutMaster.getWritingMode() == EN_LR_TB) { // Left-to-right
-            start = commonMarginBlock.marginLeft.getValue(pageWidthContext);
-            end = commonMarginBlock.marginRight.getValue(pageWidthContext);
-        } else { // all other supported modes are right-to-left
+        // [TBD] WRITING MODE ALERT
+        switch ( getWritingMode().getEnumValue() ) {
+        case Constants.EN_RL_TB:
             start = commonMarginBlock.marginRight.getValue(pageWidthContext);
             end = commonMarginBlock.marginLeft.getValue(pageWidthContext);
+            break;
+        case Constants.EN_TB_LR:
+        case Constants.EN_TB_RL:
+            start = commonMarginBlock.marginTop.getValue(pageWidthContext);
+            end = commonMarginBlock.marginBottom.getValue(pageWidthContext);
+            break;
+        case Constants.EN_LR_TB:
+        default:
+            start = commonMarginBlock.marginLeft.getValue(pageWidthContext);
+            end = commonMarginBlock.marginRight.getValue(pageWidthContext);
+            break;
         }
         int before = commonMarginBlock.spaceBefore.getOptimum(pageHeightContext)
                         .getLength().getValue(pageHeightContext);

Modified: xmlgraphics/fop/branches/Temp_URI_Unification/src/java/org/apache/fop/fo/pagination/RegionEnd.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_URI_Unification/src/java/org/apache/fop/fo/pagination/RegionEnd.java?rev=1343285&r1=1343284&r2=1343285&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_URI_Unification/src/java/org/apache/fop/fo/pagination/RegionEnd.java (original)
+++ xmlgraphics/fop/branches/Temp_URI_Unification/src/java/org/apache/fop/fo/pagination/RegionEnd.java Mon May 28 15:30:46 2012
@@ -19,14 +19,13 @@
 
 package org.apache.fop.fo.pagination;
 
-// Java
 import java.awt.Rectangle;
 
-// FOP
-import org.apache.fop.fo.FONode;
 import org.apache.fop.datatypes.FODimension;
 import org.apache.fop.datatypes.LengthBase;
 import org.apache.fop.datatypes.PercentBaseContext;
+import org.apache.fop.fo.Constants;
+import org.apache.fop.fo.FONode;
 
 /**
  * Class modelling the <a href="http://www.w3.org/TR/xsl/#fo_region-end">
@@ -52,18 +51,27 @@ public class RegionEnd extends RegionSE 
         PercentBaseContext pageHeightContext = getPageHeightContext(LengthBase.CUSTOM_BASE);
         PercentBaseContext neighbourContext;
         Rectangle vpRect;
-        if (layoutMaster.getWritingMode() == EN_LR_TB
-                || layoutMaster.getWritingMode() == EN_RL_TB) {
+        // [TBD] WRITING MODE ALERT
+        switch ( getWritingMode().getEnumValue() ) {
+        case Constants.EN_RL_TB:
             neighbourContext = pageHeightContext;
-            vpRect = new Rectangle(reldims.ipd - getExtent().getValue(pageWidthContext), 0,
-                    getExtent().getValue(pageWidthContext), reldims.bpd);
-        } else {
+            vpRect = new Rectangle(0, 0, getExtent().getValue(pageWidthContext), reldims.bpd);
+            break;
+        case Constants.EN_TB_LR:
+        case Constants.EN_TB_RL:
             // Rectangle:  x , y (of top left point), width, height
             neighbourContext = pageWidthContext;
             vpRect = new Rectangle(reldims.ipd - getExtent().getValue(pageHeightContext), 0,
                     reldims.bpd, getExtent().getValue(pageHeightContext));
+            break;
+        case Constants.EN_LR_TB:
+        default:
+            neighbourContext = pageHeightContext;
+            vpRect = new Rectangle(reldims.ipd - getExtent().getValue(pageWidthContext), 0,
+                    getExtent().getValue(pageWidthContext), reldims.bpd);
+            break;
         }
-        adjustIPD(vpRect, layoutMaster.getWritingMode(), neighbourContext);
+        adjustIPD(vpRect, getWritingMode(), neighbourContext);
         return vpRect;
     }
 



---------------------------------------------------------------------
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