diff options
author | Glen Mazza <gmazza@apache.org> | 2004-08-30 12:00:54 +0000 |
---|---|---|
committer | Glen Mazza <gmazza@apache.org> | 2004-08-30 12:00:54 +0000 |
commit | 4c1d6bfa2a4c4eb30e936181d6e61bfd53f17a54 (patch) | |
tree | 2709923046d535f58dcb84ed547792559981467a /src/java/org/apache/fop/fo/pagination/RegionAfter.java | |
parent | 2186523fc29da3040d15d6165b199bd98375295a (diff) | |
download | xmlgraphics-fop-4c1d6bfa2a4c4eb30e936181d6e61bfd53f17a54.tar.gz xmlgraphics-fop-4c1d6bfa2a4c4eb30e936181d6e61bfd53f17a54.zip |
1.) Some flattening of the Region classes done, with the goal of moving
some of its layout logic to PageLayoutManager.
2.) New helper function getPropEnum() added.
git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@197898 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src/java/org/apache/fop/fo/pagination/RegionAfter.java')
-rw-r--r-- | src/java/org/apache/fop/fo/pagination/RegionAfter.java | 30 |
1 files changed, 27 insertions, 3 deletions
diff --git a/src/java/org/apache/fop/fo/pagination/RegionAfter.java b/src/java/org/apache/fop/fo/pagination/RegionAfter.java index 55dadce6e..199c2c0dc 100644 --- a/src/java/org/apache/fop/fo/pagination/RegionAfter.java +++ b/src/java/org/apache/fop/fo/pagination/RegionAfter.java @@ -21,6 +21,10 @@ package org.apache.fop.fo.pagination; // Java import java.awt.Rectangle; +// XML +import org.xml.sax.Attributes; +import org.xml.sax.SAXParseException; + // FOP import org.apache.fop.fo.FONode; import org.apache.fop.datatypes.FODimension; @@ -30,6 +34,9 @@ import org.apache.fop.datatypes.FODimension; */ public class RegionAfter extends RegionBA { + private int extent = 0; + private boolean precedence = false; + /** * @see org.apache.fop.fo.FONode#FONode(FONode) */ @@ -38,17 +45,34 @@ public class RegionAfter extends RegionBA { } /** + * @see org.apache.fop.fo.FObj#addProperties + */ + protected void addProperties(Attributes attlist) throws SAXParseException { + super.addProperties(attlist); + extent = getPropLength(PR_EXTENT); + precedence = (getPropEnum(PR_PRECEDENCE) == Precedence.TRUE); + } + + /** + * Indicates if this region gets precedence. + * @return True if it gets precedence + */ + public boolean getPrecedence() { + return precedence; + } + + /** * @see org.apache.fop.fo.pagination.Region#getViewportRectangle(FODimension) */ public Rectangle getViewportRectangle (FODimension reldims) { // Depends on extent, precedence ans writing mode Rectangle vpRect; if (this.wm == WritingMode.LR_TB || this.wm == WritingMode.RL_TB) { - vpRect = new Rectangle(0, reldims.bpd - getExtent(), reldims.ipd, getExtent()); + vpRect = new Rectangle(0, reldims.bpd - extent, reldims.ipd, extent); } else { - vpRect = new Rectangle(0, reldims.bpd - getExtent(), getExtent(), reldims.ipd); + vpRect = new Rectangle(0, reldims.bpd - extent, extent, reldims.ipd); } - if (getPrecedence() == false) { + if (precedence == false) { adjustIPD(vpRect, this.wm); } return vpRect; |