diff options
author | arved <arved@unknown> | 2001-03-04 22:59:20 +0000 |
---|---|---|
committer | arved <arved@unknown> | 2001-03-04 22:59:20 +0000 |
commit | 69e50d90bd1fdf89e28f93c9b9c1b7930698ac1c (patch) | |
tree | 1430c409036e8b4e908dc1b3055cc0c200658dab | |
parent | e63f8ef91b7e3b9828c81176c53a6360ef8a8bdd (diff) | |
download | xmlgraphics-fop-69e50d90bd1fdf89e28f93c9b9c1b7930698ac1c.tar.gz xmlgraphics-fop-69e50d90bd1fdf89e28f93c9b9c1b7930698ac1c.zip |
Start region
git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@194132 13f79535-47bb-0310-9956-ffa450edef68
-rw-r--r-- | src/org/apache/fop/fo/pagination/RegionStart.java | 83 |
1 files changed, 83 insertions, 0 deletions
diff --git a/src/org/apache/fop/fo/pagination/RegionStart.java b/src/org/apache/fop/fo/pagination/RegionStart.java new file mode 100644 index 000000000..57b320027 --- /dev/null +++ b/src/org/apache/fop/fo/pagination/RegionStart.java @@ -0,0 +1,83 @@ +/* $Id$ + * Copyright (C) 2001 The Apache Software Foundation. All rights reserved. + * For details on use and redistribution please refer to the + * LICENSE file included with these sources." + */ + +package org.apache.fop.fo.pagination; + +// FOP +import org.apache.fop.fo.*; +import org.apache.fop.fo.properties.*; +import org.apache.fop.layout.RegionArea; +import org.apache.fop.apps.FOPException; + +public class RegionStart extends Region { + + public static class Maker extends FObj.Maker { + public FObj make(FObj parent, PropertyList propertyList) throws FOPException { + return new RegionStart(parent, propertyList); + } + } + + public static FObj.Maker maker() { + return new RegionStart.Maker(); + } + + public static final String REGION_CLASS = "start"; + + + protected RegionStart(FObj parent, PropertyList propertyList) + throws FOPException + { + super(parent, propertyList); + } + + + RegionArea makeRegionArea(int allocationRectangleXPosition, + int allocationRectangleYPosition, + int allocationRectangleWidth, + int allocationRectangleHeight, + boolean beforePrecedence, boolean afterPrecedence, + int beforeHeight, int afterHeight) { + int extent = this.properties.get("extent").getLength().mvalue(); + + int startY = allocationRectangleYPosition; + int startH = allocationRectangleHeight; + if (beforePrecedence) + { + startY -= beforeHeight; + startH -= beforeHeight; + } + if (afterPrecedence) + startH -= afterHeight; + return new RegionArea(allocationRectangleXPosition, + startY, extent, startH); + } + + RegionArea makeRegionArea(int allocationRectangleXPosition, + int allocationRectangleYPosition, + int allocationRectangleWidth, + int allocationRectangleHeight) { + int extent = this.properties.get("extent").getLength().mvalue(); + return makeRegionArea(allocationRectangleXPosition, + allocationRectangleYPosition, + allocationRectangleWidth, extent, false, false, 0, 0); + } + + protected String getDefaultRegionName() + { + return "xsl-region-start"; + } + + protected String getElementName() + { + return "fo:region-start"; + } + + public String getRegionClass() + { + return REGION_CLASS; + } + +} |