diff options
author | Jeremias Maerki <jeremias@apache.org> | 2006-03-22 08:13:02 +0000 |
---|---|---|
committer | Jeremias Maerki <jeremias@apache.org> | 2006-03-22 08:13:02 +0000 |
commit | 13dc3adad9cdac4215cc8e6a43e0482816054b8e (patch) | |
tree | f11ba0797c48e5b12e66ddcaaaaa94e0192a5cbf /src/java/org | |
parent | 37f249f90225e7aa7423f393f67c39a210140ae4 (diff) | |
download | xmlgraphics-fop-13dc3adad9cdac4215cc8e6a43e0482816054b8e.tar.gz xmlgraphics-fop-13dc3adad9cdac4215cc8e6a43e0482816054b8e.zip |
Clean-up in PageSequence.
git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@387789 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src/java/org')
-rw-r--r-- | src/java/org/apache/fop/fo/pagination/PageSequence.java | 72 | ||||
-rw-r--r-- | src/java/org/apache/fop/render/rtf/RTFHandler.java | 4 |
2 files changed, 39 insertions, 37 deletions
diff --git a/src/java/org/apache/fop/fo/pagination/PageSequence.java b/src/java/org/apache/fop/fo/pagination/PageSequence.java index 80006da30..010bf9699 100644 --- a/src/java/org/apache/fop/fo/pagination/PageSequence.java +++ b/src/java/org/apache/fop/fo/pagination/PageSequence.java @@ -19,7 +19,7 @@ package org.apache.fop.fo.pagination; // Java -import java.util.HashMap; +import java.util.Map; import org.xml.sax.Locator; @@ -34,6 +34,7 @@ import org.apache.fop.fo.ValidationException; * Implementation of the fo:page-sequence formatting object. */ public class PageSequence extends FObj { + // The value of properties relevant for fo:page-sequence. private String country; private String format; @@ -47,9 +48,7 @@ public class PageSequence extends FObj { private String masterReference; // End of property values - /** - * The parent root object - */ + /** The parent root object */ private Root root; // There doesn't seem to be anything in the spec requiring flows @@ -57,12 +56,10 @@ public class PageSequence extends FObj { // defined in the page sequence, so all we need is this one hashmap // the set of flows includes StaticContent flows also - /** - * Map of flows to their flow name (flow-name, Flow) - */ - public HashMap flowMap; + /** Map of flows to their flow name (flow-name, Flow) */ + private Map flowMap; - public int startingPageNumber = 0; + private int startingPageNumber = 0; private PageNumberGenerator pageNumberGenerator; /** @@ -72,8 +69,8 @@ public class PageSequence extends FObj { * The pageSequenceMaster is null if master-reference refers to a * simple-page-master. */ - public SimplePageMaster simplePageMaster; - public PageSequenceMaster pageSequenceMaster; + private SimplePageMaster simplePageMaster; + private PageSequenceMaster pageSequenceMaster; /** * The fo:title object for this page-sequence. @@ -119,13 +116,12 @@ public class PageSequence extends FObj { */ protected void startOfNode() throws FOPException { this.root = (Root) parent; - flowMap = new HashMap(); + flowMap = new java.util.HashMap(); - this.simplePageMaster = - root.getLayoutMasterSet().getSimplePageMaster(masterReference); + this.simplePageMaster = root.getLayoutMasterSet().getSimplePageMaster(masterReference); if (this.simplePageMaster == null) { - this.pageSequenceMaster = - root.getLayoutMasterSet().getPageSequenceMaster(masterReference); + this.pageSequenceMaster + = root.getLayoutMasterSet().getPageSequenceMaster(masterReference); if (this.pageSequenceMaster == null) { throw new ValidationException("master-reference '" + masterReference + "' for fo:page-sequence matches no" @@ -135,18 +131,14 @@ public class PageSequence extends FObj { } } - this.pageNumberGenerator = - new PageNumberGenerator(format, groupingSeparator, groupingSize, letterValue); + this.pageNumberGenerator = new PageNumberGenerator( + format, groupingSeparator, groupingSize, letterValue); checkId(id); getFOEventHandler().startPageSequence(this); } - /** - * Signal end of this xml element. - * This passes the end page sequence to the structure handler - * so it can act upon that. - */ + /** @see org.apache.fop.fo.FONode#endOfNode() */ protected void endOfNode() throws FOPException { if (mainFlow == null) { missingChildElementError("(title?,static-content*,flow)"); @@ -436,6 +428,11 @@ public class PageSequence extends FObj { return flowMap.containsKey(flowName); } + /** @return the flow map for this page-sequence */ + public Map getFlowMap() { + return this.flowMap; + } + /** * Public accessor for determining the next page master to use within this page sequence. * @param page the page number of the page to be created @@ -478,6 +475,7 @@ public class PageSequence extends FObj { /** * Retrieves the string representation of a page number applicable * for this page sequence + * @param pageNumber the page number * @return string representation of the page number */ public String makeFormattedPageNumber(int pageNumber) { @@ -492,9 +490,7 @@ public class PageSequence extends FObj { return root; } - /** - * Return the "master-reference" property. - */ + /** @return the "master-reference" property. */ public String getMasterReference() { return masterReference; } @@ -504,23 +500,29 @@ public class PageSequence extends FObj { return "page-sequence"; } - /** - * @see org.apache.fop.fo.FObj#getNameId() - */ + /** @see org.apache.fop.fo.FObj#getNameId() */ public int getNameId() { return FO_PAGE_SEQUENCE; } - /** - * get the forcePageCount value - */ + + /** @return the force-page-count value */ public int getForcePageCount() { return forcePageCount; } - /** - * get the initial pagenumber property value - */ + /** @return the initial-page-number property value */ public Numeric getInitialPageNumber() { return initialPageNumber; } + + /** @return the country property value */ + public String getCountry() { + return this.country; + } + + /** @return the language property value */ + public String getLanguage() { + return this.language; + } + } diff --git a/src/java/org/apache/fop/render/rtf/RTFHandler.java b/src/java/org/apache/fop/render/rtf/RTFHandler.java index 06764c1da..41cc3dba8 100644 --- a/src/java/org/apache/fop/render/rtf/RTFHandler.java +++ b/src/java/org/apache/fop/render/rtf/RTFHandler.java @@ -1563,7 +1563,7 @@ public class RTFHandler extends FOEventHandler { Region regionBefore = pagemaster.getRegion(Constants.FO_REGION_BEFORE); if (regionBefore != null) { - FONode staticBefore = (FONode) pageSequence.flowMap.get( + FONode staticBefore = (FONode) pageSequence.getFlowMap().get( regionBefore.getRegionName()); if (staticBefore != null) { recurseFONode(staticBefore); @@ -1571,7 +1571,7 @@ public class RTFHandler extends FOEventHandler { } Region regionAfter = pagemaster.getRegion(Constants.FO_REGION_AFTER); if (regionAfter != null) { - FONode staticAfter = (FONode) pageSequence.flowMap.get( + FONode staticAfter = (FONode) pageSequence.getFlowMap().get( regionAfter.getRegionName()); if (staticAfter != null) { recurseFONode(staticAfter); |