]> source.dussan.org Git - xmlgraphics-fop.git/commitdiff
Extended to handle getFrameOrientation() and getContentOrientation()
authorPeter Bernard West <pbwest@apache.org>
Thu, 17 Jun 2004 11:33:06 +0000 (11:33 +0000)
committerPeter Bernard West <pbwest@apache.org>
Thu, 17 Jun 2004 11:33:06 +0000 (11:33 +0000)
git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/branches/FOP_0-20-0_Alt-Design@197733 13f79535-47bb-0310-9956-ffa450edef68

src/java/org/apache/fop/area/AbstractReferenceArea.java

index 08fca5a4769787799f9eaa2f26ee43bdf80f6ff1..c598380732e05594c60a6a740e3a88680514e68a 100644 (file)
@@ -20,7 +20,10 @@ package org.apache.fop.area;
 
 import java.awt.geom.AffineTransform;
 import org.apache.fop.datastructs.Node;
+import org.apache.fop.datatypes.IntegerType;
 import org.apache.fop.fo.FONode;
+import org.apache.fop.fo.PropNames;
+import org.apache.fop.fo.expr.PropertyException;
 import org.apache.fop.fo.flow.FoPageSequence;
 
 /**
@@ -46,9 +49,17 @@ public abstract class AbstractReferenceArea
             Node parent,
             Object sync) {
         super(pageSeq, generatedBy, parent, sync);
-        // TODO Auto-generated constructor stub
+        contentOrientation = setContentOrientation();
+        frameOrientation = setFrameOrientation();
+        // What transform is required?
+        // TODO work out the transformation
+        // TODO check for reference-area rotational transformation
+        // in interactions between AreaFrames and ContentAreas
     }
 
+    private int contentOrientation;
+    private int frameOrientation;
+
     /**
      * Set the Coordinate Transformation Matrix which transforms content
      * coordinates in this reference area which are specified in
@@ -75,6 +86,34 @@ public abstract class AbstractReferenceArea
         }
     }
 
+    private int setContentOrientation() {
+        try {
+            return IntegerType.getIntValue(
+                    generatedBy.getPropertyValue(
+                            PropNames.REFERENCE_ORIENTATION));
+        } catch (PropertyException e) {
+            throw new RuntimeException(e);
+        }
+    }
+
+    public int getContentOrientation() {
+        return contentOrientation;
+    }
+
+    private int setFrameOrientation() {
+        try {
+            return IntegerType.getIntValue(
+                    ((FONode)generatedBy.getParent()).getPropertyValue(
+                            PropNames.REFERENCE_ORIENTATION));
+        } catch (PropertyException e) {
+            throw new RuntimeException(e);
+        }
+    }
+
+    public int getFrameOrientation() {
+        return frameOrientation;
+    }
+
     /**
      * Clone this reference area.
      *