From: Glen Mazza Date: Sun, 18 Jul 2004 00:50:08 +0000 (+0000) Subject: 1. New constructor for Driver created, takes FOUserAgent constructor. X-Git-Tag: Root_Temp_KnuthStylePageBreaking~665 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=3d598730fe1e84e080ebd43580a6a60cb75bcb7e;p=xmlgraphics-fop.git 1. New constructor for Driver created, takes FOUserAgent constructor. Used for both CLI and AWTRenderer. (Thanks to Simon Pepping) 2. Removed Driver(AWTRenderer) constructor. 3. OutputStream validation moved to FOTreeBuilder. 4. Driver.reset() removed, not currently serving a purpose. git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@197797 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/src/java/org/apache/fop/apps/Driver.java b/src/java/org/apache/fop/apps/Driver.java index 41ae90469..f63581689 100644 --- a/src/java/org/apache/fop/apps/Driver.java +++ b/src/java/org/apache/fop/apps/Driver.java @@ -31,7 +31,6 @@ import org.xml.sax.XMLReader; // FOP import org.apache.fop.fo.Constants; import org.apache.fop.fo.FOTreeBuilder; -import org.apache.fop.render.awt.AWTRenderer; /** * Primary class that drives the overall FOP process. @@ -48,10 +47,6 @@ import org.apache.fop.render.awt.AWTRenderer; * use and the OutputStream to use to output the results of the * rendering (where applicable). *

- * Once the Driver is set up, the render method - * is called. The invocation of the method is - * render(Parser, InputSource). - *

* Here is an example use of Driver which outputs to AWT: * *

@@ -70,7 +65,7 @@ public class Driver implements Constants {
     /**
      * the stream to use to output the results of the renderer
      */
-    private OutputStream stream;
+    private OutputStream stream = null;
 
     /**
      * The system resources that FOP will use
@@ -82,17 +77,6 @@ public class Driver implements Constants {
      */
     public Driver() {
         foUserAgent = new FOUserAgent();
-        stream = null;
-    }
-
-    /**
-     * Constructor for AWTRenderer, which reuses the
-     * same renderer instance for document reloading
-     */
-    public Driver(AWTRenderer render) {
-        this();
-        renderType = RENDER_AWT;
-        foUserAgent = render.getUserAgent();
     }
 
     /**
@@ -105,12 +89,11 @@ public class Driver implements Constants {
     }
 
     /**
-     * Resets the Driver so it can be reused. Property and element
-     * mappings are reset to defaults.
-     * The output stream is cleared. The renderer is cleared.
+     * Constructor with FOUserAgent
+     * Used by CLI, AWTRenderer
      */
-    public synchronized void reset() {
-        stream = null;
+    public Driver(FOUserAgent ua) {
+        foUserAgent = ua;
     }
 
     /**
@@ -139,12 +122,6 @@ public class Driver implements Constants {
         this.stream = stream;
     }
 
-    private void validateOutputStream() {
-        if (this.stream == null) {
-            throw new IllegalStateException("OutputStream has not been set");
-        }
-    }
-
     /**
      * Method to set the rendering type desired. Must be one of
      *