pbwest 2004/07/24 10:34:49 Modified: src/java/org/apache/fop/area Tag: FOP_0-20-0_Alt-Design BlockArea.java Log: BlockAllocationRectangle implements AreaListener BlockAllocationRectangle instance created in constructor of BlockArea setDimensions() from AreaListener is implements by re-calculating the allocation-recatngle dimensions Revision Changes Path No revision No revision 1.1.2.11 +14 -5 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.10 retrieving revision 1.1.2.11 diff -u -r1.1.2.10 -r1.1.2.11 --- BlockArea.java 10 Jul 2004 16:38:44 -0000 1.1.2.10 +++ BlockArea.java 24 Jul 2004 17:34:48 -0000 1.1.2.11 @@ -40,9 +40,11 @@ Node parent, Object sync) { super(pageSeq, generatedBy, parent, sync); - // TODO Auto-generated constructor stub + // Setup the allocation-rectangle + allocation = new BlockAllocationRectangle(); } + private BlockAllocationRectangle allocation; /** The page space allocation for layout of the block */ private Rectangle2D pageSpace = new Rectangle2D.Double(); /** The content space equivalent to the pageSpace */ @@ -142,7 +144,7 @@ * @version $Revision$ $Name$ */ public class BlockAllocationRectangle extends AreaFrame implements - AllocationRectangle { + AllocationRectangle, AreaListener { private PaddingRectangle padding; private BorderRectangle borders; @@ -167,16 +169,23 @@ padding = BlockArea.this.getPadding(); borders = BlockArea.this.getBorders(); spaces = BlockArea.this.getSpaces(); + // Register the listener + spaces.registerAreaListener(this); setAllocationFrame(); } public void setAllocationFrame() { + // TODO synchronize this setStart(spaces.getStart() + borders.getStart() + padding.getStart()); setEnd(spaces.getEnd() + borders.getEnd() + padding.getEnd()); setBefore(borders.getBefore() + padding.getBefore()); setAfter(borders.getAfter() + padding.getAfter()); } + public void setDimensions(Rectangle2D geometry) { + setAllocationFrame(); + } + } }
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]