pbwest 2002/11/11 08:38:51
Modified: src/org/apache/fop/fo/flow Tag: FOP_0-20-0_Alt-Design
FoFlow.java
Log:
Initial fo:flow content handling: (%block)+
Revision Changes Path
No revision
No revision
1.1.2.2 +31 -3 xml-fop/src/org/apache/fop/fo/flow/Attic/FoFlow.java
Index: FoFlow.java
===================================================================
RCS file: /home/cvs/xml-fop/src/org/apache/fop/fo/flow/Attic/FoFlow.java,v
retrieving revision 1.1.2.1
retrieving revision 1.1.2.2
diff -u -r1.1.2.1 -r1.1.2.2
--- FoFlow.java 7 Nov 2002 23:19:54 -0000 1.1.2.1
+++ FoFlow.java 11 Nov 2002 16:38:51 -0000 1.1.2.2
@@ -14,10 +14,12 @@
import org.apache.fop.fo.FOPropertySets;
import org.apache.fop.fo.PropertySets;
import org.apache.fop.fo.FObjectNames;
+import org.apache.fop.fo.FObjects;
import org.apache.fop.fo.FONode;
import org.apache.fop.fo.FOTree;
import org.apache.fop.fo.expr.PropertyException;
import org.apache.fop.xml.FoXMLEvent;
+import org.apache.fop.xml.UnexpectedStartElementException;
import org.apache.fop.apps.FOPException;
import org.apache.fop.datastructs.TreeException;
import org.apache.fop.datatypes.PropertyValue;
@@ -66,6 +68,8 @@
}
/**
+ * Construct an fo:flow node, and build the fo:flow subtree.
+ * <p>Content model for fo:flow (%block;)+
* @param foTree the FO tree being built
* @param parent the parent FONode of this node
* @param event the <tt>FoXMLEvent</tt> that triggered the creation of
@@ -77,9 +81,33 @@
super(foTree, FObjectNames.FLOW, parent, event,
FOPropertySets.FLOW_SET, sparsePropsMap, sparseIndices,
numProps);
+ xmlevents = foTree.getXmlevents();
FoXMLEvent ev;
- String nowProcessing;
+ try {
+ // Get at least one %block;
+ if ((ev = xmlevents.expectBlock()) == null)
+ throw new FOPException("%block; not found in fo:flow");
+ // Generate the flow object
+ System.out.println("Generating first block for flow.");
+ FObjects.fobjects.makeFlowObject
+ (foTree, this, ev, FOPropertySets.FLOW_SET);
+ // Get the rest of the %block;s
+ do {
+ ev = xmlevents.expectBlock();
+ if (ev != null) {
+ // Generate the flow object
+ System.out.println
+ ("Generating subsequent block for flow.");
+ FObjects.fobjects.makeFlowObject
+ (foTree, this, ev, FOPropertySets.FLOW_SET);
+ }
+ } while (ev != null);
+ } catch(UnexpectedStartElementException e) {
+ throw new FOPException
+ ("Block not found or unexpected non-block in fo:flow");
+ }
+ System.out.println("Making sparsePropsSet for flow.");
makeSparsePropsSet();
}
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]