diff options
author | Peter Bernard West <pbwest@apache.org> | 2004-07-24 17:34:48 +0000 |
---|---|---|
committer | Peter Bernard West <pbwest@apache.org> | 2004-07-24 17:34:48 +0000 |
commit | ea1956a6f19fb19ea3c1c31036e8dd54de38b5af (patch) | |
tree | 8135677b5046351e60722d14275f6caa14d9e7b0 | |
parent | ee2fdb623b7511761a95bdb200e095571f0b8c97 (diff) | |
download | xmlgraphics-fop-ea1956a6f19fb19ea3c1c31036e8dd54de38b5af.tar.gz xmlgraphics-fop-ea1956a6f19fb19ea3c1c31036e8dd54de38b5af.zip |
BlockAllocationRectangle implements AreaListener
BlockAllocationRectangle instance created in constructor of BlockArea
setDimensions() from AreaListener is implements by re-calculating the allocation-recatngle dimensions
git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/branches/FOP_0-20-0_Alt-Design@197833 13f79535-47bb-0310-9956-ffa450edef68
-rw-r--r-- | src/java/org/apache/fop/area/BlockArea.java | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/src/java/org/apache/fop/area/BlockArea.java b/src/java/org/apache/fop/area/BlockArea.java index fde0e7093..92cb4f485 100644 --- a/src/java/org/apache/fop/area/BlockArea.java +++ b/src/java/org/apache/fop/area/BlockArea.java @@ -40,9 +40,11 @@ public class BlockArea extends Area { 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 @@ public class BlockArea extends Area { * @version $Revision$ $Name$ */ public class BlockAllocationRectangle extends AreaFrame implements - AllocationRectangle { + AllocationRectangle, AreaListener { private PaddingRectangle padding; private BorderRectangle borders; @@ -167,16 +169,23 @@ public class BlockArea extends Area { 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(); + } + } } |