]> source.dussan.org Git - xmlgraphics-fop.git/commitdiff
Moved getWritingMode from CorrespondingProperties to FONode
authorPeter Bernard West <pbwest@apache.org>
Sun, 2 May 2004 03:00:15 +0000 (03:00 +0000)
committerPeter Bernard West <pbwest@apache.org>
Sun, 2 May 2004 03:00:15 +0000 (03:00 +0000)
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
src/java/org/apache/fop/fo/properties/AbstractCorrespondingProperty.java
src/java/org/apache/fop/fo/properties/BorderCommonStyleAbsolute.java
src/java/org/apache/fop/fo/properties/BorderCommonStyleRelative.java
src/java/org/apache/fop/fo/properties/BorderCommonWidthAbsolute.java
src/java/org/apache/fop/fo/properties/BorderCommonWidthRelative.java
src/java/org/apache/fop/fo/properties/CorrespondingProperty.java
src/java/org/apache/fop/fo/properties/PaddingCorrespondingAbsolute.java
src/java/org/apache/fop/fo/properties/PaddingCorrespondingRelative.java

index 72ba65119a4eec81999ba8ead545e463078115fd..6a7db184acda9969e06dfa8585d87e7a8abec81e 100644 (file)
@@ -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 <code>writing-mode</code> 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 <tt>Numeric</tt> containing the current font size
index 7e2ac74bbab7110da45abcb9bb48682a000375a0..687160897c2e43c0f5a4fd7cb10a38743f3d0f40 100644 (file)
  */
 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)
index aa03715ee71a1a35dca01ca810f4d868fe586931..0ed342ba679eaae6f9a3865d5359d6f42e86c3ef 100644 (file)
@@ -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];
     }
 
index d9e2b8b5e31b55cd7ab5c7367790b4b66bdb7b2f..dfea8f730cdd0b940612d6f4f0253fc7c6b2221f 100644 (file)
@@ -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];
     }
 
index bb0a9003b5fd8e0540216f498c33ed0b44fbdc48..4517c718621735b7cd5b1cd82dff3f3cc560b569 100644 (file)
@@ -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];
     }
 
index b8b1e56f98c0266eb9d457895982c1dcd54baefb..db01460aa67e415241f78b55e1cb5a572c77a970 100644 (file)
@@ -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];
     }
 
index e526098ce4e025ac52ec4eefbecc408b57c6e999..dec673650234475da4e29b7e41cd153785d40c77 100644 (file)
@@ -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;
 }
index 83a3bf567054e13afa782308d8e1c672c88bcffd..36ade5c21c4690696399b2b30a0afc0d96a42c7d 100644 (file)
@@ -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];
     }
 
index 6d79404dbd005cd2740ee5f2807d32e0216edec5..d15dd1bedbdb1f2d792111498763eac64befaea8 100644 (file)
@@ -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];
     }