From 25ec603c443c5c1cbbaef75a9805fd90725530e2 Mon Sep 17 00:00:00 2001 From: Peter Bernard West Date: Sun, 2 May 2004 03:00:15 +0000 Subject: [PATCH] Moved getWritingMode from CorrespondingProperties to FONode git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/branches/FOP_0-20-0_Alt-Design@197547 13f79535-47bb-0310-9956-ffa450edef68 --- src/java/org/apache/fop/fo/FONode.java | 12 ++++++++++++ .../fo/properties/AbstractCorrespondingProperty.java | 11 ----------- .../fop/fo/properties/BorderCommonStyleAbsolute.java | 2 +- .../fop/fo/properties/BorderCommonStyleRelative.java | 2 +- .../fop/fo/properties/BorderCommonWidthAbsolute.java | 2 +- .../fop/fo/properties/BorderCommonWidthRelative.java | 2 +- .../fop/fo/properties/CorrespondingProperty.java | 2 -- .../fo/properties/PaddingCorrespondingAbsolute.java | 2 +- .../fo/properties/PaddingCorrespondingRelative.java | 2 +- 9 files changed, 18 insertions(+), 19 deletions(-) diff --git a/src/java/org/apache/fop/fo/FONode.java b/src/java/org/apache/fop/fo/FONode.java index 72ba65119..6a7db184a 100644 --- a/src/java/org/apache/fop/fo/FONode.java +++ b/src/java/org/apache/fop/fo/FONode.java @@ -28,6 +28,7 @@ import org.apache.fop.apps.FOPException; import org.apache.fop.datastructs.ROBitSet; import org.apache.fop.datastructs.SyncedNode; import org.apache.fop.datastructs.TreeException; +import org.apache.fop.datatypes.EnumType; import org.apache.fop.datatypes.Numeric; import org.apache.fop.datatypes.PropertyValue; import org.apache.fop.datatypes.PropertyValueList; @@ -567,6 +568,17 @@ public class FONode extends SyncedNode{ return (Numeric)fontsize; } + /** + * Gets the writing-mode applying to this node. + * @return an enumerated constant representing the writing-mode + * @throws PropertyException + */ + public int getWritingMode() + throws PropertyException { + PropertyValue wm = getPropertyValue(PropNames.WRITING_MODE); + return EnumType.getEnumValue(wm); + } + /** * Clone the current font size. * @return a Numeric containing the current font size diff --git a/src/java/org/apache/fop/fo/properties/AbstractCorrespondingProperty.java b/src/java/org/apache/fop/fo/properties/AbstractCorrespondingProperty.java index 7e2ac74bb..687160897 100644 --- a/src/java/org/apache/fop/fo/properties/AbstractCorrespondingProperty.java +++ b/src/java/org/apache/fop/fo/properties/AbstractCorrespondingProperty.java @@ -19,10 +19,7 @@ */ package org.apache.fop.fo.properties; -import org.apache.fop.datatypes.EnumType; -import org.apache.fop.datatypes.PropertyValue; import org.apache.fop.fo.FONode; -import org.apache.fop.fo.PropNames; import org.apache.fop.fo.expr.PropertyException; /** @@ -32,14 +29,6 @@ import org.apache.fop.fo.expr.PropertyException; public abstract class AbstractCorrespondingProperty extends Property implements CorrespondingProperty { - /* (non-Javadoc) - * @see org.apache.fop.fo.properties.CorrespondingProperty#getWritingMode(org.apache.fop.fo.FONode) - */ - public int getWritingMode(FONode foNode) - throws PropertyException { - PropertyValue wm = foNode.getPropertyValue(PropNames.WRITING_MODE); - return EnumType.getEnumValue(wm); - } /* (non-Javadoc) * @see org.apache.fop.fo.properties.CorrespondingProperty#getCorrespondingProperty(org.apache.fop.fo.FONode) diff --git a/src/java/org/apache/fop/fo/properties/BorderCommonStyleAbsolute.java b/src/java/org/apache/fop/fo/properties/BorderCommonStyleAbsolute.java index aa03715ee..0ed342ba6 100644 --- a/src/java/org/apache/fop/fo/properties/BorderCommonStyleAbsolute.java +++ b/src/java/org/apache/fop/fo/properties/BorderCommonStyleAbsolute.java @@ -55,7 +55,7 @@ extends BorderCommonStyle { FONode foNode, int absoluteEdge) throws PropertyException { int relEdge = WritingMode.getCorrespondingRelativeEdge( - getWritingMode(foNode), absoluteEdge); + foNode.getWritingMode(), absoluteEdge); return relBorderStyleProps[relEdge]; } diff --git a/src/java/org/apache/fop/fo/properties/BorderCommonStyleRelative.java b/src/java/org/apache/fop/fo/properties/BorderCommonStyleRelative.java index d9e2b8b5e..dfea8f730 100644 --- a/src/java/org/apache/fop/fo/properties/BorderCommonStyleRelative.java +++ b/src/java/org/apache/fop/fo/properties/BorderCommonStyleRelative.java @@ -55,7 +55,7 @@ extends BorderCommonStyle { FONode foNode, int relativeEdge) throws PropertyException { int absEdge = WritingMode.getCorrespondingAbsoluteEdge( - getWritingMode(foNode), relativeEdge); + foNode.getWritingMode(), relativeEdge); return absBorderStyleProps[absEdge]; } diff --git a/src/java/org/apache/fop/fo/properties/BorderCommonWidthAbsolute.java b/src/java/org/apache/fop/fo/properties/BorderCommonWidthAbsolute.java index bb0a9003b..4517c7186 100644 --- a/src/java/org/apache/fop/fo/properties/BorderCommonWidthAbsolute.java +++ b/src/java/org/apache/fop/fo/properties/BorderCommonWidthAbsolute.java @@ -51,7 +51,7 @@ public abstract class BorderCommonWidthAbsolute extends BorderCommonWidth { FONode foNode, int absoluteEdge) throws PropertyException { int relEdge = WritingMode.getCorrespondingRelativeEdge( - getWritingMode(foNode), absoluteEdge); + foNode.getWritingMode(), absoluteEdge); return relBorderWidthProps[relEdge]; } diff --git a/src/java/org/apache/fop/fo/properties/BorderCommonWidthRelative.java b/src/java/org/apache/fop/fo/properties/BorderCommonWidthRelative.java index b8b1e56f9..db01460aa 100644 --- a/src/java/org/apache/fop/fo/properties/BorderCommonWidthRelative.java +++ b/src/java/org/apache/fop/fo/properties/BorderCommonWidthRelative.java @@ -51,7 +51,7 @@ public abstract class BorderCommonWidthRelative extends BorderCommonWidth { FONode foNode, int relativeEdge) throws PropertyException { int absEdge = WritingMode.getCorrespondingAbsoluteEdge( - getWritingMode(foNode), relativeEdge); + foNode.getWritingMode(), relativeEdge); return absBorderWidthProps[absEdge]; } diff --git a/src/java/org/apache/fop/fo/properties/CorrespondingProperty.java b/src/java/org/apache/fop/fo/properties/CorrespondingProperty.java index e526098ce..dec673650 100644 --- a/src/java/org/apache/fop/fo/properties/CorrespondingProperty.java +++ b/src/java/org/apache/fop/fo/properties/CorrespondingProperty.java @@ -30,8 +30,6 @@ import org.apache.fop.fo.expr.PropertyException; * @version $Revision$ $Name$ */ public interface CorrespondingProperty { - public int getWritingMode (FONode foNode) - throws PropertyException; public int getCorrespondingProperty(FONode foNode) throws PropertyException; } diff --git a/src/java/org/apache/fop/fo/properties/PaddingCorrespondingAbsolute.java b/src/java/org/apache/fop/fo/properties/PaddingCorrespondingAbsolute.java index 83a3bf567..36ade5c21 100644 --- a/src/java/org/apache/fop/fo/properties/PaddingCorrespondingAbsolute.java +++ b/src/java/org/apache/fop/fo/properties/PaddingCorrespondingAbsolute.java @@ -52,7 +52,7 @@ extends AbstractCorrespondingProperty { FONode foNode, int absoluteEdge) throws PropertyException { int relEdge = WritingMode.getCorrespondingRelativeEdge( - getWritingMode(foNode), absoluteEdge); + foNode.getWritingMode(), absoluteEdge); return relPaddingProps[relEdge]; } diff --git a/src/java/org/apache/fop/fo/properties/PaddingCorrespondingRelative.java b/src/java/org/apache/fop/fo/properties/PaddingCorrespondingRelative.java index 6d79404db..d15dd1bed 100644 --- a/src/java/org/apache/fop/fo/properties/PaddingCorrespondingRelative.java +++ b/src/java/org/apache/fop/fo/properties/PaddingCorrespondingRelative.java @@ -51,7 +51,7 @@ public abstract class PaddingCorrespondingRelative extends AbstractCorresponding FONode foNode, int relativeEdge) throws PropertyException { int relEdge = WritingMode.getCorrespondingAbsoluteEdge( - getWritingMode(foNode), relativeEdge); + foNode.getWritingMode(), relativeEdge); return absPaddingProps[relEdge]; } -- 2.39.5