From 598a7a0444a1defee101006ab0d7a2a0ec762739 Mon Sep 17 00:00:00 2001 From: Peter Bernard West Date: Sun, 30 May 2004 16:24:08 +0000 Subject: [PATCH] Expressed area dimensions and minima and maxima as Rectangle2Ds and AreaRanges. Adjusted getters and setters accordingly. git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/branches/FOP_0-20-0_Alt-Design@197674 13f79535-47bb-0310-9956-ffa450edef68 --- src/java/org/apache/fop/area/Area.java | 125 ++++--------------------- 1 file changed, 16 insertions(+), 109 deletions(-) diff --git a/src/java/org/apache/fop/area/Area.java b/src/java/org/apache/fop/area/Area.java index abdcae71d..e4c553d31 100644 --- a/src/java/org/apache/fop/area/Area.java +++ b/src/java/org/apache/fop/area/Area.java @@ -43,22 +43,11 @@ import org.apache.fop.fo.properties.WritingMode; */ public class Area extends AreaNode implements Cloneable { - /** Current inline progression dimension. May be unknown. */ - protected Float iPDim = null; - /** Maximum required inline progression dimension. May be unknown. */ - protected Float iPDimMax = null; - /** Mimimum required inline progression dimension. May be unknown. */ - protected Float iPDimMin = null; - /** Current block progression dimension. May be unknown. */ - protected Float bPDim = null; - /** Maximum required block progression dimension. May be unknown. */ - protected Float bPDimMax = null; - /** Mimimum required block progression dimension. May be unknown. */ - protected Float bPDimMin = null; /** The geometrical area. The width of this * Rectangle is the inline-progression-dimension * of the area, and the height is the - * bllock-progression-dimension. */ + * block-progression-dimension. */ + protected Rectangle2D area = null; /** True if the the writing-mode of the content area is * horizontal */ @@ -201,10 +190,10 @@ public class Area extends AreaNode implements Cloneable { * N.B. The method is synchronized only on this object. * @param pts block-progression-dimension to set, in points */ - public void setBPDimPts(double pts) { + public void setBPDimPts(float pts) { synchronized (this) { if (area == null) { - area = new Rectangle2D.Double(); + area = new Rectangle2D.Float(); } if (contentIsHorizontal) { area.setRect( @@ -216,56 +205,6 @@ public class Area extends AreaNode implements Cloneable { } } - /** - * Gets the block-progression-dimension maximum value, - * in points - * N.B. The method is synchronized only on this object. - * @return the block-progression-dimension maximum value - */ - public Float getBPDimMax() { - synchronized (this) { - return bPDimMax; - } - } - - /** - * Sets the block-progression-dimension maximum value, - * in points - * N.B. The method is synchronized only on this object. - * @param dimMax block-progression-dimension maximum value - * to set - */ - public void setBPDimMax(float dimMax) { - synchronized (this) { - bPDimMax = new Float(dimMax); - } - } - - /** - * Gets the block-progression-dimension minimum value, - * in points - * N.B. The method is synchronized only on this object. - * @return the block-progression-dimension minimum value - */ - public Float getBPDimMin() { - synchronized (this) { - return bPDimMin; - } - } - - /** - * Sets the block-progression-dimension minimum value, - * in points - * N.B. The method is synchronized only on this object. - * @param dimMin block-progression-dimension minimum value - * to set - */ - public void setBPDimMin(float dimMin) { - synchronized (this) { - bPDimMin = new Float(dimMin); - } - } - /** * Gets the inline-progression-dimension of the contents of * this area in millipoints. This value is taken from the appropriate @@ -291,7 +230,7 @@ public class Area extends AreaNode implements Cloneable { public double getIPDimPts() { synchronized (this) { if (area == null) { - area = new Rectangle2D.Double(); + area = new Rectangle2D.Float(); } if (contentIsHorizontal){ return area.getWidth(); @@ -326,7 +265,7 @@ public class Area extends AreaNode implements Cloneable { public void setIPDimPts(double pts) { synchronized (this) { if (area == null) { - area = new Rectangle2D.Double(); + area = new Rectangle2D.Float(); } if (contentIsHorizontal){ area.setRect(area.getX(), area.getY(), pts, area.getHeight()); @@ -336,54 +275,22 @@ public class Area extends AreaNode implements Cloneable { } } - /** - * Gets the inline-progression-dimension maximum value, - * in points - * N.B. The method is synchronized only on this object. - * @return the inline-progression-dimension maximum value - */ - public Float getIPDimMax() { - synchronized(this) { - return iPDimMax; - } - } - - /** - * Sets the inline-progression-dimension maximum value, - * in points - * N.B. The method is synchronized only on this object. - * @param dimMax inline-progression-dimension maximum value - * to set + /** An initially null range of minima and maxima for + * inline-progression-dimension and + * block-progression-dimension. */ - public void setIPDimMax(float dimMax) { - synchronized (this) { - iPDimMax = new Float(dimMax); - } - } - + protected AreaRange pageSpaceRange = new AreaRange(); /** - * Gets the inline-progression-dimension mimimum value, - * in points - * N.B. The method is synchronized only on this object. - * @return the inline-progression-dimension minimum value + * @return the pageSpaceRange */ - public Float getIPDimMin() { - synchronized (this) { - return iPDimMin; - } + public AreaRange getPageSpaceRange() { + return pageSpaceRange; } - /** - * Sets the inline-progression-dimension minimum value, - * in millipoints - * N.B. The method is synchronized only on this object. - * @param dimMin inline-progression-dimension minimum value - * to set + * @param pageSpaceRange to set */ - public void setIPDimMin(float dimMin) { - synchronized (this) { - iPDimMin = new Float(dimMin); - } + public void setPageSpaceRange(AreaRange pageSpaceRange) { + this.pageSpaceRange = pageSpaceRange; } /** Initial size of the listeners array */ -- 2.39.5