diff options
author | Glen Mazza <gmazza@apache.org> | 2005-02-18 03:54:50 +0000 |
---|---|---|
committer | Glen Mazza <gmazza@apache.org> | 2005-02-18 03:54:50 +0000 |
commit | c205123aadf7b006ed1bba40a2e433eef9421f03 (patch) | |
tree | 9e92f8df3a8da262a5243250fa6434e11a6fdb43 /src/java/org/apache/fop/fo | |
parent | 8c33e694203be26e19a39942d94f8d73882dd6f7 (diff) | |
download | xmlgraphics-fop-c205123aadf7b006ed1bba40a2e433eef9421f03.tar.gz xmlgraphics-fop-c205123aadf7b006ed1bba40a2e433eef9421f03.zip |
PR:
Obtained from:
Submitted by:
Reviewed by:
More cleanup in PageSequence (also removed local LayoutMasterSet variable to emphasize Root's ownership of this object in the FO Tree hierarchy.)
git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@198443 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src/java/org/apache/fop/fo')
-rw-r--r-- | src/java/org/apache/fop/fo/pagination/PageSequence.java | 35 | ||||
-rw-r--r-- | src/java/org/apache/fop/fo/pagination/Root.java | 4 |
2 files changed, 7 insertions, 32 deletions
diff --git a/src/java/org/apache/fop/fo/pagination/PageSequence.java b/src/java/org/apache/fop/fo/pagination/PageSequence.java index 53b1b97e2..d5b87ff3f 100644 --- a/src/java/org/apache/fop/fo/pagination/PageSequence.java +++ b/src/java/org/apache/fop/fo/pagination/PageSequence.java @@ -31,9 +31,7 @@ import org.apache.fop.fo.PropertyList; import org.apache.fop.fo.ValidationException; /** - * This provides pagination of flows onto pages. Much of the - * logic for paginating flows is contained in this class. - * The main entry point is the format method. + * Implementation of the fo:page-sequence formatting object. */ public class PageSequence extends FObj { // The value of properties relevant for fo:page-sequence. @@ -54,11 +52,6 @@ public class PageSequence extends FObj { */ private Root root; - /** - * the set of layout masters (provided by the root object) - */ - private LayoutMasterSet layoutMasterSet; - // There doesn't seem to be anything in the spec requiring flows // to be in the order given, only that they map to the regions // defined in the page sequence, so all we need is this one hashmap @@ -69,12 +62,8 @@ public class PageSequence extends FObj { */ public HashMap flowMap; -// private boolean isFlowSet = false; - - // page number and related formatting variables public int startingPageNumber = 0; private PageNumberGenerator pageNumberGenerator; - private boolean isForcing = false; /** * The currentSimplePageMaster is either the page master for the @@ -126,14 +115,13 @@ public class PageSequence extends FObj { */ protected void startOfNode() throws FOPException { this.root = (Root) parent; - layoutMasterSet = root.getLayoutMasterSet(); flowMap = new HashMap(); this.simplePageMaster = - this.layoutMasterSet.getSimplePageMaster(masterReference); + root.getLayoutMasterSet().getSimplePageMaster(masterReference); if (this.simplePageMaster == null) { this.pageSequenceMaster = - this.layoutMasterSet.getPageSequenceMaster(masterReference); + root.getLayoutMasterSet().getPageSequenceMaster(masterReference); if (this.pageSequenceMaster == null) { throw new ValidationException("master-reference '" + masterReference + "' for fo:page-sequence matches no" @@ -143,7 +131,6 @@ public class PageSequence extends FObj { } } - // get the 'format' properties this.pageNumberGenerator = new PageNumberGenerator(format, groupingSeparator, groupingSize, letterValue); @@ -232,7 +219,7 @@ public class PageSequence extends FObj { + "\" found within fo:page-sequence", flow.locator); } - if (!layoutMasterSet.regionNameExists(flowName) + if (!root.getLayoutMasterSet().regionNameExists(flowName) && !flowName.equals("xsl-before-float-separator") && !flowName.equals("xsl-footnote-separator")) { throw new ValidationException("flow-name \"" @@ -253,10 +240,6 @@ public class PageSequence extends FObj { startingPageNumber = root.getEndingPageNumberOfPreviousSequence() + 1; pageNumberType = initialPageNumber.getEnum(); if (pageNumberType == EN_AUTO_ODD) { - // Next page but force odd. May force empty page creation! - // Whose master is used for this??? Assume no. - // Use force-page-count = auto - // on preceding page-sequence to make sure that there is no gap! if (startingPageNumber % 2 == 0) { startingPageNumber++; } @@ -318,7 +301,7 @@ public class PageSequence extends FObj { // if (masterName != null) { // SimplePageMaster spm = -// this.layoutMasterSet.getSimplePageMaster(masterName); +// root.getLayoutMasterSet().getSimplePageMaster(masterName); // Region region = spm.getRegion(FO_REGION_BODY); @@ -331,14 +314,6 @@ public class PageSequence extends FObj { // return false; // } -// public boolean isFlowSet() { -// return isFlowSet; -// } - -// public void setIsFlowSet(boolean isFlowSet) { -// this.isFlowSet = isFlowSet; -// } - /** * Get the starting page number for this page sequence. * diff --git a/src/java/org/apache/fop/fo/pagination/Root.java b/src/java/org/apache/fop/fo/pagination/Root.java index 556fc1ab8..42e7bfdc5 100644 --- a/src/java/org/apache/fop/fo/pagination/Root.java +++ b/src/java/org/apache/fop/fo/pagination/Root.java @@ -177,11 +177,11 @@ public class Root extends FObj { } /** - * Report additional pages generated to increase the totalPagesGenerated counter + * Notify additional pages generated to increase the totalPagesGenerated counter * @param lastPageNumber the last page number of the sequence * @throws IllegalArgumentException for negative additional page counts */ - public void reportAdditionalPagesGenerated(int additionalPages) { + public void notifyAdditionalPagesGenerated(int additionalPages) { if (additionalPages >= 0) { totalPagesGenerated += additionalPages; } else { |