From 220392b355398a0b138f080ae5639418d87f736f Mon Sep 17 00:00:00 2001 From: Peter Bernard West Date: Thu, 15 Apr 2004 07:02:18 +0000 Subject: [PATCH] Added AWT specific rendering details: Renderer provides a GraphicsEnvironment for use in layout Added getGraphicsEnvironment Added renderer initialisation for AWT Set default logging level to INFO (java.util.logging) Removed redundant setInputHandler method git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/branches/FOP_0-20-0_Alt-Design@197499 13f79535-47bb-0310-9956-ffa450edef68 --- src/java/org/apache/fop/apps/Fop.java | 27 ++++++++++++++------------- 1 file changed, 14 insertions(+), 13 deletions(-) diff --git a/src/java/org/apache/fop/apps/Fop.java b/src/java/org/apache/fop/apps/Fop.java index 30678227f..4ebed465a 100644 --- a/src/java/org/apache/fop/apps/Fop.java +++ b/src/java/org/apache/fop/apps/Fop.java @@ -21,6 +21,7 @@ package org.apache.fop.apps; //import java.util.logging.Handler; +import java.awt.GraphicsEnvironment; import java.io.FileNotFoundException; import java.io.IOException; import java.io.InputStream; @@ -82,6 +83,7 @@ public class Fop { private XmlEventReader eventReader; private FOTree foTree; private AreaTree areaTree = new AreaTree(); + private GraphicsEnvironment gEnv = null; private Thread driverThread; private Thread parserThread; @@ -190,8 +192,8 @@ public class Fop { logger = Logger.getLogger(fopPackage); logger.setLevel(Level.CONFIG); logger.config(version); - // Then restrict to WARNING - logger.setLevel(Level.WARNING); + // Then restrict to INFO + logger.setLevel(Level.INFO); } private void setupRunStats() { @@ -256,12 +258,15 @@ public class Fop { throw new FOPException(e2); } } - setInputHandler(options.getInputHandler()); + inputHandler = options.getInputHandler(); parser = inputHandler.getParser(); saxSource = inputHandler.getInputSource(); // Setting of namespace-prefixes feature no longer required //setParserFeatures(parser); + rendererType = options.getRenderer(); + setRenderer(rendererType); + gEnv = renderer.getGraphicsEnvironment(); namespaces = new Namespaces(); eventsBuffer = new SyncedXmlEventsBuffer(namespaces); eventReader = new XmlEventReader(eventsBuffer, namespaces); @@ -300,15 +305,6 @@ public class Fop { } - /** - * Sets the InputHandler for XML imput as specified in FOPOptions. - * @param inputHandler the InputHandler - */ - public void setInputHandler(InputHandler inputHandler) { - this.inputHandler = inputHandler; - } - - /** * Optionally sets the FOUserAgent instance for FOP to use. The Driver * class sets up its own FOUserAgent if none is set through this method. @@ -351,7 +347,8 @@ public class Fop { // setRenderer("org.apache.fop.render.pdf.PDFRenderer"); // break; case RENDER_AWT: - throw new IllegalArgumentException("Use renderer form of setRenderer() for AWT"); + setRenderer("org.apache.fop.render.awt.AWTRenderer"); + break; // case RENDER_PRINT: // setRenderer("org.apache.fop.render.awt.AWTPrintRenderer"); // break; @@ -405,6 +402,10 @@ public class Fop { return renderer; } + public GraphicsEnvironment getGraphicsEnvironment() { + return gEnv; + } + /** * Set the class name of the Renderer to use as well as the * producer string for those renderers that can make use of it. -- 2.39.5