[FOray-commit] SF.net SVN: foray: [9974] trunk/foray
Modular XSL-FO Implementation for Java.
Status: Alpha
Brought to you by:
victormote
|
From: <vic...@us...> - 2007-07-10 23:36:17
|
Revision: 9974
http://svn.sourceforge.net/foray/?rev=9974&view=rev
Author: victormote
Date: 2007-07-10 16:36:20 -0700 (Tue, 10 Jul 2007)
Log Message:
-----------
Conform to axsl (and XSL-FO 1.1) changes allowing page-sequence to return multiple flow objects.
Modified Paths:
--------------
trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/obj/PageSequence.java
trunk/foray/foray-pioneer/src/java/org/foray/pioneer/PioneerLS.java
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 2007-07-10 22:41:09 UTC (rev 9973)
+++ trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/obj/PageSequence.java 2007-07-10 23:36:20 UTC (rev 9974)
@@ -67,7 +67,7 @@
* multiplicity of fo:flow in XSL 1.0 is cleared up - one (1)
* fo:flow per fo:page-sequence only.
*/
- private Flow flow = null;
+ private List<Flow> flows = new ArrayList<Flow>(1);
/** Handles page numbering and related formatting. */
private PageNumberGenerator pageNumberGenerator;
@@ -114,7 +114,7 @@
* {@inheritDoc}
*/
protected void validateDescendants() throws FoTreeException {
- if (flow == null) {
+ if (flows == null) {
throwException(getFullName() + "has no flow.");
}
}
@@ -148,15 +148,11 @@
* is not unique.
*/
public void addFlow(final Flow flow) throws FoTreeException {
- if (this.flow != null) {
- throwException("Only a single fo:flow permitted per "
- + getFullName());
- }
if (staticContentMap.containsKey(flow.traitFlowName())) {
throwException("flow-names must be unique within an "
+ getFullName());
}
- this.flow = flow;
+ this.flows.add(flow);
}
/**
@@ -167,7 +163,7 @@
*/
public void addStaticContent(final StaticContent staticContent)
throws FoTreeException {
- if (this.flow != null) {
+ if (this.flows != null) {
throwException("Static content ('" + staticContent.traitFlowName()
+ "') is not allowed after fo:flow");
}
@@ -264,8 +260,8 @@
/**
* {@inheritDoc}
*/
- public org.axsl.fo.fo.Flow getFlow() {
- return this.flow;
+ public List<org.axsl.fo.fo.Flow> getFlows() {
+ return this.flows;
}
/**
Modified: trunk/foray/foray-pioneer/src/java/org/foray/pioneer/PioneerLS.java
===================================================================
--- trunk/foray/foray-pioneer/src/java/org/foray/pioneer/PioneerLS.java 2007-07-10 22:41:09 UTC (rev 9973)
+++ trunk/foray/foray-pioneer/src/java/org/foray/pioneer/PioneerLS.java 2007-07-10 23:36:20 UTC (rev 9974)
@@ -175,7 +175,20 @@
public void processPageSequence(final PageCollection pageCollection)
throws AreaTreeException {
final PageSequence pageSeq = pageCollection.getPageSequence();
- final org.axsl.fo.fo.Flow flow = pageSeq.getFlow();
+ for (org.axsl.fo.fo.Flow flow : pageSeq.getFlows()) {
+ processFlow(pageCollection, flow);
+ }
+ }
+
+ /**
+ * Handles layout for one flow in the page-sequence.
+ * @param pageCollection The AreaTree PageCollection into which the flow is
+ * being laid out.
+ * @param flow The flow being processed.
+ * @throws AreaTreeException For errors during layout.
+ */
+ private void processFlow(final PageCollection pageCollection,
+ final org.axsl.fo.fo.Flow flow) throws AreaTreeException {
this.setLayoutProxy(flow, new FlowPL(flow, this));
// make pages and layout content
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|