From: Peter Bernard West Date: Fri, 30 Apr 2004 00:34:50 +0000 (+0000) Subject: Changing from Adobe 1st quadrant co-ordinates to Java page co-ordinates X-Git-Tag: Defoe_export~210 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=e8e21c7f8ae635d159203627773287d399fad694;p=xmlgraphics-fop.git Changing from Adobe 1st quadrant co-ordinates to Java page co-ordinates (0,0 = right,top). Chages references to CoordTransformer to java.awt.geom.AffineTransform git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/branches/FOP_0-20-0_Alt-Design@197544 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/src/java/org/apache/fop/area/AbstractReferenceArea.java b/src/java/org/apache/fop/area/AbstractReferenceArea.java index fa3c995cc..085b8e10f 100644 --- a/src/java/org/apache/fop/area/AbstractReferenceArea.java +++ b/src/java/org/apache/fop/area/AbstractReferenceArea.java @@ -18,6 +18,8 @@ */ package org.apache.fop.area; +import java.awt.geom.AffineTransform; + import org.apache.fop.datastructs.Node; import org.apache.fop.fo.FONode; import org.apache.fop.fo.flow.FoPageSequence; @@ -31,7 +33,7 @@ public abstract class AbstractReferenceArea implements ReferenceArea { // Set up as identity matrix - protected CoordTransformer transformer = new CoordTransformer(); + protected AffineTransform transformer = new AffineTransform(); /** * @param pageSeq through which this area was generated @@ -57,7 +59,7 @@ public abstract class AbstractReferenceArea * * @param transformer to position this reference area */ - public void setCoordTransformer(CoordTransformer transformer) { + public void setCoordTransformer(AffineTransform transformer) { synchronized (sync) { this.transformer = transformer; } @@ -68,7 +70,7 @@ public abstract class AbstractReferenceArea * * @return the current transformer to position this reference area */ - public CoordTransformer getCoordTransformer() { + public AffineTransform getCoordTransformer() { synchronized (sync) { return this.transformer; } diff --git a/src/java/org/apache/fop/area/Area.java b/src/java/org/apache/fop/area/Area.java index 53db56544..ce0f1c299 100644 --- a/src/java/org/apache/fop/area/Area.java +++ b/src/java/org/apache/fop/area/Area.java @@ -23,14 +23,6 @@ import org.apache.fop.datastructs.SyncedNode; import org.apache.fop.fo.FONode; import org.apache.fop.fo.flow.FoPageSequence; -/** - * @author pbw - * @version $Revision$ $Name$ - */ -/** - * @author pbw - * @version $Revision$ $Name$ - */ /** * The base class for all areas. Area extends Node * because all areas will find themselves in a tree of some kind. diff --git a/src/java/org/apache/fop/area/ReferenceArea.java b/src/java/org/apache/fop/area/ReferenceArea.java index 6068dfa22..eb1afaf64 100644 --- a/src/java/org/apache/fop/area/ReferenceArea.java +++ b/src/java/org/apache/fop/area/ReferenceArea.java @@ -19,29 +19,44 @@ */ package org.apache.fop.area; +import java.awt.geom.AffineTransform; + /** + * Interface for reference-areas; i.e. areas which provide a + * context for possible changes in writing-mode or + * reference-orientation. + * * @author pbw * @version $Revision$ $Name$ */ public interface ReferenceArea extends Cloneable { /** - * Set the Coordinate Transformation Matrix which transforms content - * coordinates in this reference area which are specified in - * terms of "start" and "before" into coordinates in a system which - * is positioned in "absolute" directions (with origin at lower left of - * the reference area. + * Java's text handling includes facilities for managing writing + * mode. java.awt.ComponentOrientation handles the + * standard FO writing methods - LT (lr-tb), RT (rl-tb) and TR (tb-rl), + * as well as TL (tb-lr - e.g. Mongolian). + * Because these are dealt with within the context of a page-based + * co-ordinate system (left,top = 0,0, right,bottom = x,y), there is + * no need to apply any Affine transform to discriminate these cases. + *

When a reference-orientation is applied, however, + * and an area is rotated with reference to its containing area, + * such a transform must be applied. + *

Transforms will also be required to map Java page co-ordinates to + * Adobe 1st quadrant co-ordinates for PDF and Postscript rendering. * - * @param matrix the current transform to position this region + * @param matrix the transform to map the contents of this reference-area + * into statndard Java page co-ordinates. */ - public void setCoordTransformer(CoordTransformer matrix); + public void setCoordTransformer(AffineTransform matrix); /** - * Get the current transformer of this reference area. + * Get the transform mapping this reference area into standard page + * co-ordinates. May return null. * - * @return the current transformer to position this reference area. + * @return the current transform of this reference area. */ - public CoordTransformer getCoordTransformer(); + public AffineTransform getCoordTransformer(); public Object clone();