aboutsummaryrefslogtreecommitdiffstats
path: root/src/java
diff options
context:
space:
mode:
authorAdrian Cumiskey <acumiskey@apache.org>2009-03-24 15:39:15 +0000
committerAdrian Cumiskey <acumiskey@apache.org>2009-03-24 15:39:15 +0000
commitd4d822328cbbf548c76ff8373b825a64b3d43962 (patch)
tree43fdbf0bb616e4839fc3a71cb0fd2d10546288b1 /src/java
parent79fb0a5e60d927dccdebf8d3b8fe96b649abe6e7 (diff)
downloadxmlgraphics-fop-d4d822328cbbf548c76ff8373b825a64b3d43962.tar.gz
xmlgraphics-fop-d4d822328cbbf548c76ff8373b825a64b3d43962.zip
Added some nice bean methods for pageSequenceMaster and simplePageMaster, this also makes startOfNode() easier to read too.
git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@757852 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src/java')
-rw-r--r--src/java/org/apache/fop/fo/pagination/PageSequence.java57
1 files changed, 45 insertions, 12 deletions
diff --git a/src/java/org/apache/fop/fo/pagination/PageSequence.java b/src/java/org/apache/fop/fo/pagination/PageSequence.java
index 1d3937ec6..d0b298936 100644
--- a/src/java/org/apache/fop/fo/pagination/PageSequence.java
+++ b/src/java/org/apache/fop/fo/pagination/PageSequence.java
@@ -24,8 +24,10 @@ import java.util.Map;
import org.xml.sax.Locator;
+import org.apache.batik.css.engine.value.svg.OpacityManager;
import org.apache.fop.apps.FOPException;
import org.apache.fop.fo.FONode;
+import org.apache.fop.fo.FObj;
import org.apache.fop.fo.PropertyList;
import org.apache.fop.fo.ValidationException;
@@ -48,7 +50,7 @@ public class PageSequence extends AbstractPageSequence {
// the set of flows includes StaticContent flows also
/** Map of flows to their flow name (flow-name, Flow) */
- private Map flowMap;
+ private Map/*<String, Flow>*/ flowMap;
/**
* The currentSimplePageMaster is either the page master for the
@@ -93,21 +95,52 @@ public class PageSequence extends AbstractPageSequence {
}
}
+ /**
+ * Returns the simple page master related to this page sequence
+ * @return the simple page master related to this page sequence
+ */
+ public SimplePageMaster getSimplePageMaster() {
+ return getRoot().getLayoutMasterSet().getSimplePageMaster(masterReference);
+ }
+
+ /**
+ * Returns true if this page sequence has a simple page master
+ * @return true if this page sequence has a simple page master
+ */
+ public boolean hasSimplePageMaster() {
+ return getSimplePageMaster() != null;
+ }
+
+ /**
+ * Returns the page sequence master related to this page sequence
+ * @return the page sequence master related to this page sequence
+ */
+ public PageSequenceMaster getPageSequenceMaster() {
+ return getRoot().getLayoutMasterSet().getPageSequenceMaster(masterReference);
+ }
+
+ /**
+ * Returns true if this page sequence has a page sequence master
+ * @return true if this page sequence has a page sequence master
+ */
+ public boolean hasPageSequenceMaster() {
+ return getPageSequenceMaster() != null;
+ }
+
/** {@inheritDoc} */
protected void startOfNode() throws FOPException {
super.startOfNode();
- flowMap = new java.util.HashMap();
-
- this.simplePageMaster = getRoot().getLayoutMasterSet().getSimplePageMaster(masterReference);
- if (this.simplePageMaster == null) {
- this.pageSequenceMaster
- = getRoot().getLayoutMasterSet().getPageSequenceMaster(masterReference);
- if (this.pageSequenceMaster == null) {
- getFOValidationEventProducer().masterNotFound(this, getName(),
- masterReference, getLocator());
- }
+ flowMap = new java.util.HashMap/*<String, Flow>*/();
+
+ if (hasSimplePageMaster()) {
+ this.simplePageMaster = getSimplePageMaster();
+ } else if (hasPageSequenceMaster()) {
+ this.pageSequenceMaster = getPageSequenceMaster();
+ } else {
+ getFOValidationEventProducer().masterNotFound(this, getName(),
+ masterReference, getLocator());
}
-
+
getFOEventHandler().startPageSequence(this);
}