From a364ab92a3545aafb8746e6860ad7e5a972adcec Mon Sep 17 00:00:00 2001 From: Peter Bernard West Date: Thu, 17 Jun 2004 11:33:06 +0000 Subject: [PATCH] Extended to handle getFrameOrientation() and getContentOrientation() git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/branches/FOP_0-20-0_Alt-Design@197733 13f79535-47bb-0310-9956-ffa450edef68 --- .../fop/area/AbstractReferenceArea.java | 41 ++++++++++++++++++- 1 file changed, 40 insertions(+), 1 deletion(-) diff --git a/src/java/org/apache/fop/area/AbstractReferenceArea.java b/src/java/org/apache/fop/area/AbstractReferenceArea.java index 08fca5a47..c59838073 100644 --- a/src/java/org/apache/fop/area/AbstractReferenceArea.java +++ b/src/java/org/apache/fop/area/AbstractReferenceArea.java @@ -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. * -- 2.39.5