[FOray-commit] SF.net SVN: foray: [7359] trunk/foray/foray-areatree/src/java/org/foray/area
Modular XSL-FO Implementation for Java.
Status: Alpha
Brought to you by:
victormote
|
From: <vic...@us...> - 2006-06-02 17:25:49
|
Revision: 7359 Author: victormote Date: 2006-06-02 10:25:44 -0700 (Fri, 02 Jun 2006) ViewCVS: http://svn.sourceforge.net/foray/?rev=7359&view=rev Log Message: ----------- Rough improvements to positioning of absolutely-positioned block-containers. Modified Paths: -------------- trunk/foray/foray-areatree/src/java/org/foray/area/Area.java trunk/foray/foray-areatree/src/java/org/foray/area/BlockContainerRA.java Modified: trunk/foray/foray-areatree/src/java/org/foray/area/Area.java =================================================================== --- trunk/foray/foray-areatree/src/java/org/foray/area/Area.java 2006-06-02 17:02:22 UTC (rev 7358) +++ trunk/foray/foray-areatree/src/java/org/foray/area/Area.java 2006-06-02 17:25:44 UTC (rev 7359) @@ -1184,4 +1184,24 @@ return new org.foray.area.ListBlockArea(listBlock, this); } + public int traitTop() { + Area ancestor = this.ancestorBlockAreaNotALineArea(); + return traitGeneratedBy().traitTop(ancestor.crBPD()); + } + + public int traitBottom() { + Area ancestor = this.ancestorBlockAreaNotALineArea(); + return traitGeneratedBy().traitBottom(ancestor.crBPD()); + } + + public int traitLeft() { + Area ancestor = this.ancestorBlockAreaNotALineArea(); + return traitGeneratedBy().traitLeft(ancestor.crIPD()); + } + + public int traitRight() { + Area ancestor = this.ancestorBlockAreaNotALineArea(); + return traitGeneratedBy().traitRight(ancestor.crIPD()); + } + } Modified: trunk/foray/foray-areatree/src/java/org/foray/area/BlockContainerRA.java =================================================================== --- trunk/foray/foray-areatree/src/java/org/foray/area/BlockContainerRA.java 2006-06-02 17:02:22 UTC (rev 7358) +++ trunk/foray/foray-areatree/src/java/org/foray/area/BlockContainerRA.java 2006-06-02 17:25:44 UTC (rev 7359) @@ -25,6 +25,7 @@ package org.foray.area; import org.axsl.areaR.BlockContainerArea; +import org.axsl.common.Constants; import org.axsl.common.ConstantsAreaTree; import org.axsl.foR.FObj; @@ -34,31 +35,35 @@ public class BlockContainerRA extends ContainerRA implements BlockContainerArea, org.axsl.areaW.BlockContainerRA { - private int xPosition; - private int yPosition; - public BlockContainerRA(FObj generatedBy, Area parentArea) { super(generatedBy, parentArea); } - public int getXPosition() { - return xPosition; + public byte getAreaType() { + return ConstantsAreaTree.AREATYPE_BLOCK_CONTAINER; } - public void setXPosition(int value) { - xPosition = value; + /** + * {@inheritDoc} + */ + public int crOriginBPDOffset() { + if (this.traitAbsolutePosition() == Constants.FOVAL_ABSOLUTE) { + int top = this.traitTop(); + if (top != Constants.ABSOLUTE_POSITION_AUTO) { + /* If "top" is specified, that is the offset needed. */ + return top; + } + int bottom = this.traitBottom(); + if (bottom != Constants.ABSOLUTE_POSITION_AUTO) { + /* If "bottom" is specified, */ + Area parentArea = this.getAreaParent(); + return parentArea.crBPD() - bottom + - this.getProgressionDimension(); + } + } + /* The default value is "auto", which means that this area is + * positioned relatively .*/ + return super.crOriginBPDOffset(); } - public int getYPosition() { - return yPosition; - } - - public void setYPosition(int value) { - yPosition = value; - } - - public byte getAreaType() { - return ConstantsAreaTree.AREATYPE_BLOCK_CONTAINER; - } - } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |