diff options
author | jtauber <jtauber@unknown> | 1999-11-16 14:21:50 +0000 |
---|---|---|
committer | jtauber <jtauber@unknown> | 1999-11-16 14:21:50 +0000 |
commit | c52d0e5d3b95f2b97090cf9b431c3b8f02b1702a (patch) | |
tree | ac57cbe83e22156e829c0d05b89c2c0ec8cd040a /src/org/apache/fop/fo/pagination/RegionAfter.java | |
parent | 63df53dddc94142221ed81aa8b73b02a421b2ba1 (diff) | |
download | xmlgraphics-fop-c52d0e5d3b95f2b97090cf9b431c3b8f02b1702a.tar.gz xmlgraphics-fop-c52d0e5d3b95f2b97090cf9b431c3b8f02b1702a.zip |
PR:
Obtained from:
Submitted by:
Reviewed by:
git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@193223 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src/org/apache/fop/fo/pagination/RegionAfter.java')
-rw-r--r-- | src/org/apache/fop/fo/pagination/RegionAfter.java | 64 |
1 files changed, 59 insertions, 5 deletions
diff --git a/src/org/apache/fop/fo/pagination/RegionAfter.java b/src/org/apache/fop/fo/pagination/RegionAfter.java index 5ac37a52c..78dcecc93 100644 --- a/src/org/apache/fop/fo/pagination/RegionAfter.java +++ b/src/org/apache/fop/fo/pagination/RegionAfter.java @@ -48,57 +48,111 @@ Software Foundation, please see <http://www.apache.org/>. */ -package org.apache.xml.fop.fo.pagination; +package org.apache.fop.fo.pagination; + + // FOP -import org.apache.xml.fop.fo.*; -import org.apache.xml.fop.fo.properties.*; -import org.apache.xml.fop.layout.Region; -import org.apache.xml.fop.apps.FOPException; + +import org.apache.fop.fo.*; + +import org.apache.fop.fo.properties.*; + +import org.apache.fop.layout.Region; + +import org.apache.fop.apps.FOPException; + + public class RegionAfter extends FObj { + + public static class Maker extends FObj.Maker { + public FObj make(FObj parent, PropertyList propertyList) throws FOPException { + return new RegionAfter(parent,propertyList); + } + } + + public static FObj.Maker maker() { + return new RegionAfter.Maker(); + } + + SimplePageMaster layoutMaster; + + protected RegionAfter(FObj parent, PropertyList propertyList) + throws FOPException { + super(parent, propertyList); + this.name = "fo:region-after"; + + if (parent.getName().equals("fo:simple-page-master")) { + this.layoutMaster = (SimplePageMaster) parent; + this.layoutMaster.setRegionAfter(this); + } else { + throw new FOPException("region-after must be child " + + "of simple-page-master, not " + + parent.getName()); + } + } + + Region makeRegion(int allocationRectangleXPosition, + int allocationRectangleYPosition, + int allocationRectangleWidth, + int allocationRectangleHeight) { + int marginTop = this.properties.get("margin-top").getLength().mvalue(); + int marginBottom = this.properties.get("margin-bottom").getLength().mvalue(); + int marginLeft = this.properties.get("margin-left").getLength().mvalue(); + int marginRight = this.properties.get("margin-right").getLength().mvalue(); + int extent = this.properties.get("extent").getLength().mvalue(); + + return new Region(allocationRectangleXPosition + marginLeft, + allocationRectangleYPosition - + allocationRectangleHeight + extent, + allocationRectangleWidth - marginLeft - + marginRight,extent); + } + } + |