pbwest 2004/07/10 09:38:44 Modified: src/java/org/apache/fop/area Tag: FOP_0-20-0_Alt-Design BlockArea.java Log: Experiment moving BlockAllocationRectangle to inner class of BlockArea Revision Changes Path No revision No revision 1.1.2.10 +44 -2 xml-fop/src/java/org/apache/fop/area/Attic/BlockArea.java Index: BlockArea.java =================================================================== RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/area/Attic/BlockArea.java,v retrieving revision 1.1.2.9 retrieving revision 1.1.2.10 diff -u -r1.1.2.9 -r1.1.2.10 --- BlockArea.java 10 Jun 2004 14:57:37 -0000 1.1.2.9 +++ BlockArea.java 10 Jul 2004 16:38:44 -0000 1.1.2.10 @@ -137,4 +137,46 @@ return 0.0; } + /** + * @author pbw + * @version $Revision$ $Name$ + */ + public class BlockAllocationRectangle extends AreaFrame implements + AllocationRectangle { + + private PaddingRectangle padding; + private BorderRectangle borders; + private SpacesRectangle spaces; + + /** + * @param area + * @param contents + */ + public BlockAllocationRectangle() { + // For block-areas, the allocation-area is bounded in the + // block-progression-direction by the border-rectangle, and in the + // inline-progression-direction by the spaces-rectangle. + // See 4.2.3 Geometric Definitions + // The contents of the BlockAllocationRectangle is the ContentRectangle. + // Initally, set up the AreaFrame representing the allocation + // rectangle to co-incide with the content-rectangle. + super(BlockArea.this, BlockArea.this.getContent()); + // Now extend the AreaFrame to co-incide with the + // edges of the border rectangle in the BPDir, and with the edges of + // the spaces rectangle in the IPDir. + padding = BlockArea.this.getPadding(); + borders = BlockArea.this.getBorders(); + spaces = BlockArea.this.getSpaces(); + setAllocationFrame(); + } + + public void setAllocationFrame() { + setStart(spaces.getStart() + borders.getStart() + padding.getStart()); + setEnd(spaces.getEnd() + borders.getEnd() + padding.getEnd()); + setBefore(borders.getBefore() + padding.getBefore()); + setAfter(borders.getAfter() + padding.getAfter()); + } + + } + }
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]