summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPeter Bernard West <pbwest@apache.org>2004-07-10 16:38:44 +0000
committerPeter Bernard West <pbwest@apache.org>2004-07-10 16:38:44 +0000
commit34d9c2df9125839401147b2098cf4b7c9f444d0f (patch)
tree8ca48bbeb2b9446f44820715e2ff7396625b80c6
parent36c261543e618374d333ebcdf28eac21330bf1a1 (diff)
downloadxmlgraphics-fop-34d9c2df9125839401147b2098cf4b7c9f444d0f.tar.gz
xmlgraphics-fop-34d9c2df9125839401147b2098cf4b7c9f444d0f.zip
Experiment moving BlockAllocationRectangle to inner class of BlockArea
git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/branches/FOP_0-20-0_Alt-Design@197782 13f79535-47bb-0310-9956-ffa450edef68
-rw-r--r--src/java/org/apache/fop/area/BlockArea.java42
1 files changed, 42 insertions, 0 deletions
diff --git a/src/java/org/apache/fop/area/BlockArea.java b/src/java/org/apache/fop/area/BlockArea.java
index 764a4c4b5..fde0e7093 100644
--- a/src/java/org/apache/fop/area/BlockArea.java
+++ b/src/java/org/apache/fop/area/BlockArea.java
@@ -137,4 +137,46 @@ public class BlockArea extends Area {
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());
+ }
+
+ }
+
}