import org.apache.fop.fo.properties.*;
import org.apache.fop.apps.FOPException;
import org.apache.fop.system.BufferManager;
+import org.apache.fop.layoutmgr.LayoutManager;
+import org.apache.fop.layoutmgr.TextLayoutManager;
/**
* a text node in the formatting object tree
return -1;
}
+ public LayoutManager getLayoutManager() {
+ return new TextLayoutManager(this, ca);
+ }
}
import org.xml.sax.Attributes;
import java.util.Iterator;
+import java.util.ListIterator;
import java.util.Vector;
import java.util.Hashtable;
}
- public Iterator getChildren() {
- return children.iterator();
+ public ListIterator getChildren() {
+ return children.listIterator();
}
public void setIsInTableCell() {
import org.apache.fop.datatypes.*;
import org.apache.fop.apps.FOPException;
import org.apache.fop.layoutmgr.LayoutManager;
-//import org.apache.fop.layoutmgr.BlockLayoutManager;
+import org.apache.fop.layoutmgr.BlockLayoutManager;
import org.xml.sax.Attributes;
}
public LayoutManager getLayoutManager() {
- //return new BlockLayoutManager(this);
- return null;
+ return new BlockLayoutManager(this);
}
}
else {
this.mainFlow = (Flow)child;
addFlow(mainFlow);
+ super.addChild(child); // For getChildren
}
}
else if (childName.equals("fo:static-content")) {
public void end() {
try {
- format(null);
+ AreaTree at = new AreaTree();
+ at.setTreeModel(AreaTree.createStorePagesModel());
+ at.startPageSequence(null);
+ format(at);
} catch (FOPException fopex) {
log.error("Error in PageSequence.end(): " +
fopex.getMessage());
- /**
- * Return children for layout. Only the main flow is laid out directly.
- */
- public Iterator getChildren() {
- return new Iterator() {
- boolean bFirst=true;
- public boolean hasNext() {
- return (bFirst==true && mainFlow != null);
- }
- public Object next() {
- if (bFirst==true && mainFlow != null) {
- bFirst=false;
- return mainFlow;
- }
- else throw new NoSuchElementException();
- }
- public void remove() {
- throw new UnsupportedOperationException();
- }
- };
- }
+// /**
+// * Return children for layout. Only the main flow is laid out directly.
+// */
+// public ListIterator getChildren() {
+// return new ListIterator() {
+// boolean bFirst=true;
+// public boolean hasNext() {
+// return (bFirst==true && mainFlow != null);
+// }
+// public Object next() {
+// if (bFirst==true && mainFlow != null) {
+// bFirst=false;
+// return mainFlow;
+// }
+// else throw new NoSuchElementException();
+// }
+// public void remove() {
+// throw new UnsupportedOperationException();
+// }
+// };
+// }
/**
* Runs the formatting of this page sequence into the given area tree