aboutsummaryrefslogtreecommitdiffstats
path: root/src/org/apache/fop/fo/pagination/RegionBefore.java
diff options
context:
space:
mode:
authorjtauber <jtauber@unknown>1999-11-16 14:21:50 +0000
committerjtauber <jtauber@unknown>1999-11-16 14:21:50 +0000
commitc52d0e5d3b95f2b97090cf9b431c3b8f02b1702a (patch)
treeac57cbe83e22156e829c0d05b89c2c0ec8cd040a /src/org/apache/fop/fo/pagination/RegionBefore.java
parent63df53dddc94142221ed81aa8b73b02a421b2ba1 (diff)
downloadxmlgraphics-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/RegionBefore.java')
-rw-r--r--src/org/apache/fop/fo/pagination/RegionBefore.java63
1 files changed, 58 insertions, 5 deletions
diff --git a/src/org/apache/fop/fo/pagination/RegionBefore.java b/src/org/apache/fop/fo/pagination/RegionBefore.java
index 32c8344cd..258ec88dc 100644
--- a/src/org/apache/fop/fo/pagination/RegionBefore.java
+++ b/src/org/apache/fop/fo/pagination/RegionBefore.java
@@ -48,56 +48,109 @@
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 RegionBefore extends FObj {
+
+
public static class Maker extends FObj.Maker {
+
public FObj make(FObj parent, PropertyList propertyList) throws FOPException {
+
return new RegionBefore(parent, propertyList);
+
}
+
}
+
+
public static FObj.Maker maker() {
+
return new RegionBefore.Maker();
+
}
+
+
SimplePageMaster layoutMaster;
+
+
protected RegionBefore(FObj parent, PropertyList propertyList)
+
throws FOPException {
+
super(parent, propertyList);
+
this.name = "fo:region-before";
+
+
if (parent.getName().equals("fo:simple-page-master")) {
+
this.layoutMaster = (SimplePageMaster) parent;
+
this.layoutMaster.setRegionBefore(this);
+
} else {
+
throw new FOPException("region-before 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 - marginTop,
+
allocationRectangleWidth - marginLeft -
+
marginRight, extent);
+
}
+
}
+