package org.apache.fop.apps;
// FOP
-import org.apache.fop.area.AreaTree;
-import org.apache.fop.area.AreaTreeModel;
import org.apache.fop.fo.FOInputHandler;
import org.apache.fop.fonts.FontInfo;
+import org.apache.fop.render.Renderer;
// SAX
import org.xml.sax.SAXException;
/** The Font information relevant for this document */
private FontInfo fontInfo;
- /** The current AreaTree for the PageSequence being rendered. */
- public AreaTree areaTree;
-
- /** The AreaTreeModel for the PageSequence being rendered. */
- public AreaTreeModel atModel;
+ /** The Renderer being used for this document */
+ protected Renderer renderer;
/**
* Structure handler used to notify structure
}
/**
- * Get the area tree for this layout handler.
+ * Get the renderer for this document
*
- * @return the area tree for this document
+ * @return the renderer for this document
*/
- public AreaTree getAreaTree() {
- return areaTree;
+ public Renderer getRenderer() {
+ return renderer;
}
/**
package org.apache.fop.apps;
// FOP
-import org.apache.fop.area.AreaTree;
-import org.apache.fop.area.RenderPagesModel;
-
import org.apache.fop.fo.ElementMapping;
import org.apache.fop.fo.FOTreeBuilder;
"Renderer not set when using standard foInputHandler");
}
+ currentDocument.renderer = renderer;
foInputHandler = new FOTreeHandler(currentDocument, true);
- currentDocument.areaTree = new AreaTree();
- currentDocument.atModel = new RenderPagesModel(renderer);
- //this.atModel = new CachedRenderPagesModel(renderer);
- currentDocument.areaTree.setTreeModel(currentDocument.atModel);
+
try {
renderer.setupFontInfo(currentDocument.getFontInfo());
// check that the "any,normal,400" font exists
return doc;
}
- /**
- * @return the current Area Tree object
- */
- public AreaTree getAreaTree() {
- return doc.getAreaTree();
- }
-
/**
* Returns the Driver object associated with this FOInputHandler.
* @return the Driver object
import org.apache.fop.apps.Document;
import org.apache.fop.apps.FOPException;
import org.apache.fop.area.AreaTree;
+import org.apache.fop.area.RenderPagesModel;
import org.apache.fop.area.Title;
import org.apache.fop.fo.extensions.Bookmarks;
import org.apache.fop.fo.flow.BasicLink;
*/
private Runtime runtime;
+ /** The current AreaTree for the FOTreeHandler. */
+ public AreaTree areaTree;
+
/**
* Keep track of the number of pages rendered.
*/
*/
public FOTreeHandler(Document doc, boolean store) {
super(doc);
+
+ areaTree = new AreaTree();
+ // this.atModel = new CachedRenderPagesModel(renderer);
+ areaTree.setTreeModel(new RenderPagesModel(doc.getRenderer()));
+
if (collectStatistics) {
runtime = Runtime.getRuntime();
}
*/
public void endPageNumber(PageNumber pagenum) {
}
+
+ /**
+ * @return the current Area Tree object
+ */
+ public AreaTree getAreaTree() {
+ return areaTree;
+ }
+
}
// XML
import org.xml.sax.Attributes;
+import org.xml.sax.Locator;
// FOP
import org.apache.fop.fo.FONode;
import org.apache.fop.fo.FOElementMapping;
import org.apache.fop.fo.FOTreeVisitor;
import org.apache.fop.apps.FOPException;
-import org.xml.sax.Locator;
/**
* The layout-master-set formatting object.
// Java
import java.util.List;
-// SAX
+// XML
import org.xml.sax.Attributes;
+import org.xml.sax.Locator;
// FOP
import org.apache.fop.fo.Constants;
-import org.apache.fop.fo.FONode;
import org.apache.fop.fo.FObj;
+import org.apache.fop.fo.FONode;
+import org.apache.fop.fo.FOElementMapping;
import org.apache.fop.fo.FOTreeVisitor;
import org.apache.fop.apps.FOPException;
super(parent);
}
+
+
+ /**
+ * @see org.apache.fop.fo.FONode#validateChildNode(Locator, String, String)
+ * XSL/FOP: (single-page-master-reference|repeatable-page-master-reference|
+ * repeatable-page-master-alternatives)+
+ */
+ protected void validateChildNode(Locator loc, String nsURI, String localName) {
+ if (nsURI == FOElementMapping.URI) {
+ if (!localName.equals("single-page-master-reference")
+ && !localName.equals("repeatable-page-master-reference")
+ && !localName.equals("repeatable-page-master-alternatives")) {
+ invalidChildError(loc, nsURI, localName);
+ }
+ } else {
+ invalidChildError(loc, nsURI, localName);
+ }
+ }
+
+ protected void end() {
+ if (children == null) {
+ missingChildElementError("(single-page-master-reference|" +
+ "repeatable-page-master-reference|repeatable-page-master-alternatives)+");
+ }
+ }
+
+
/**
* @see org.apache.fop.fo.FObj#addProperties
*/