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;
private XmlEventReader eventReader;
private FOTree foTree;
private AreaTree areaTree = new AreaTree();
+ private GraphicsEnvironment gEnv = null;
private Thread driverThread;
private Thread parserThread;
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() {
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);
}
- /**
- * 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.
// 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;
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.