[FOray-commit] SF.net SVN: foray: [7851] trunk/foray
Modular XSL-FO Implementation for Java.
Status: Alpha
Brought to you by:
victormote
|
From: <vic...@us...> - 2006-09-02 17:45:53
|
Revision: 7851
http://svn.sourceforge.net/foray/?rev=7851&view=rev
Author: victormote
Date: 2006-09-02 10:45:45 -0700 (Sat, 02 Sep 2006)
Log Message:
-----------
Conform to axsl changes that create a PageMasterResolver class that handle the layout-time issues of keeping track of which page master should be used next.
Modified Paths:
--------------
trunk/foray/foray-areatree/src/java/org/foray/area/PageCollection.java
trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/obj/PageSequence.java
Modified: trunk/foray/foray-areatree/src/java/org/foray/area/PageCollection.java
===================================================================
--- trunk/foray/foray-areatree/src/java/org/foray/area/PageCollection.java 2006-09-02 17:30:24 UTC (rev 7850)
+++ trunk/foray/foray-areatree/src/java/org/foray/area/PageCollection.java 2006-09-02 17:45:45 UTC (rev 7851)
@@ -30,6 +30,7 @@
import org.axsl.common.Constants;
import org.axsl.foR.FOTreeException;
import org.axsl.foR.FObj;
+import org.axsl.foR.fo.PageMasterResolver;
import org.axsl.foR.fo.PageSequence;
import org.axsl.foR.fo.RegionBody;
import org.axsl.foR.fo.SimplePageMaster;
@@ -58,6 +59,8 @@
private ArrayList currentPageSequenceMarkers = new ArrayList();
+ private PageMasterResolver pageMasterResolver;
+
/**
* Constructor.
* @param pageSeq The "cousin" PageSequence object for which this
@@ -66,6 +69,7 @@
*/
public PageCollection(final PageSequence pageSeq, final AreaTree areaTree) {
super(pageSeq, areaTree);
+ this.pageMasterResolver = pageSeq.makePageMasterResolver();
}
/*
@@ -151,8 +155,7 @@
final PageSequence pageSeq = getPageSequence();
SimplePageMaster spm = null;
try {
- spm = pageSeq.getPageMaster(this.pageCount, getCurrentPageNumber(),
- false, isBlank);
+ spm = this.pageMasterResolver.getNextPageMaster(isBlank);
} catch (final FOTreeException e) {
throw new AreaWException(e);
}
Modified: trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/obj/PageSequence.java
===================================================================
--- trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/obj/PageSequence.java 2006-09-02 17:30:24 UTC (rev 7850)
+++ trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/obj/PageSequence.java 2006-09-02 17:45:45 UTC (rev 7851)
@@ -199,34 +199,8 @@
/**
* {@inheritDoc}
*/
- public org.axsl.foR.fo.SimplePageMaster getPageMaster(
- final int pageNumberInSequence, final int pageNumberInDocument,
- final boolean isLast, final boolean isBlank)
- throws FOTreeException {
- /*
- * TODO: This is the legacy code from the AreaTree, which is stateful.
- * Convert this to stateless logic. Specifically, the
- * pageNumberInSequence parameters should be used to simulate the series
- * of next-pages. Probably, each SubSequenceSpecifier should tell how
- * many pages it can generate, then we loop through them to find the
- * correct SimplePageMaster.
- */
- SimplePageMaster spm = this.simplePageMaster;
- if (spm != null) {
- return spm;
- }
- if (pageSequenceMaster != null) {
- final Flow flow = getFlow();
- spm = pageSequenceMaster.getNextSimplePageMaster(
- ((pageNumberInDocument % 2) == 1), isBlank);
- final Region region = (Region) spm.getRegionBody();
- if (!flow.traitFlowName().equals(region.traitRegionName())) {
- throw new FOTreeException("Flow '" + flow.traitFlowName()
- + "' does not map to the region-body in page-master '"
- + spm.traitMasterName() + "'");
- }
- }
- return spm;
+ public org.axsl.foR.fo.PageMasterResolver makePageMasterResolver() {
+ return new PageMasterResolver(this);
}
private void setupPagination() throws FOTreeException {
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|