aboutsummaryrefslogtreecommitdiffstats
path: root/src/java/org/apache/fop/fo/pagination/RegionAfter.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/java/org/apache/fop/fo/pagination/RegionAfter.java')
-rw-r--r--src/java/org/apache/fop/fo/pagination/RegionAfter.java30
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;