]> source.dussan.org Git - xmlgraphics-fop.git/commitdiff
Fixed renderer classes to use OutputStream again. Fixed a compilation problem with
authorKelly Campbell <kellyc@apache.org>
Mon, 18 Dec 2000 04:56:16 +0000 (04:56 +0000)
committerKelly Campbell <kellyc@apache.org>
Mon, 18 Dec 2000 04:56:16 +0000 (04:56 +0000)
BodyAreaContainer in SimplePageMaster

git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@193903 13f79535-47bb-0310-9956-ffa450edef68

src/org/apache/fop/fo/pagination/SimplePageMaster.java
src/org/apache/fop/render/Renderer.java
src/org/apache/fop/render/awt/AWTRenderer.java
src/org/apache/fop/render/pdf/PDFRenderer.java
src/org/apache/fop/render/xml/XMLRenderer.java

index 71745c96237bdc113d6d1c35f2f4a4939dd76637..e9a0e0cf34e1d87a6786a4fc5f8a28be90b26a41 100644 (file)
@@ -55,6 +55,7 @@ import org.apache.fop.fo.*;
 import org.apache.fop.messaging.MessageHandler;
 import org.apache.fop.fo.properties.*;
 import org.apache.fop.layout.PageMaster;
+import org.apache.fop.layout.BodyRegionArea;
 import org.apache.fop.apps.FOPException;                                  
 
 import java.util.*;
@@ -119,7 +120,7 @@ public class SimplePageMaster extends FObj {
                
        this.pageMaster = new PageMaster(pageWidth, pageHeight);
        if (getRegion(RegionBody.REGION_CLASS) != null) {
-           this.pageMaster.addBody(getRegion(RegionBody.REGION_CLASS).makeRegionArea(contentRectangleXPosition,contentRectangleYPosition,contentRectangleWidth,contentRectangleHeight));
+           this.pageMaster.addBody((BodyRegionArea)getRegion(RegionBody.REGION_CLASS).makeRegionArea(contentRectangleXPosition,contentRectangleYPosition,contentRectangleWidth,contentRectangleHeight));
        }
        else {
            MessageHandler.errorln("ERROR: simple-page-master must have a region of class "+RegionBody.REGION_CLASS);
index 5c4d530073c73f1ef4706b9aed3165f061d59c57..fb3bff7a3c6bbac76ad30513390325a8c2047a0e 100644 (file)
@@ -57,7 +57,7 @@ import org.apache.fop.apps.FOPException;
 import org.apache.fop.layout.*;
 
 // Java
-import java.io.PrintWriter;
+import java.io.OutputStream;
 import java.io.IOException;
 
 /**
@@ -74,8 +74,8 @@ public interface Renderer {
     /** set the producer of the rendering */
     public void setProducer(String producer);
 
-    /** render the given area tree to the given writer */
-    public void render(AreaTree areaTree, PrintWriter writer) throws IOException, FOPException;
+    /** render the given area tree to the given stream */
+    public void render(AreaTree areaTree, OutputStream stream) throws IOException, FOPException;
  
     /** render the given area container */
     public void renderAreaContainer(AreaContainer area);
index 7f367b19401eec6499f9e4e313b72fb094564802..9fad046fa120520c4876ceee6e5bbdebbb14939a 100644 (file)
@@ -258,7 +258,7 @@ public class AWTRenderer implements Renderer, Printable, Pageable {
     }
 
     public void render(AreaTree areaTree,
-                       PrintWriter writer) throws IOException {
+                       OutputStream stream) throws IOException {
         tree = areaTree;
         render(areaTree, 0);
     }
index 6a17e782f04aa09ffc412892046fc0c305d8ef81..615ca77841d0973c5f1b59af6b8d9cb6131505ff 100644 (file)
@@ -78,7 +78,7 @@ import org.apache.fop.dom.svg.SVGArea;
 
 // Java
 import java.io.IOException;
-import java.io.PrintWriter;
+import java.io.OutputStream;
 import java.util.Enumeration;
 import java.awt.Rectangle;
 import java.util.Vector;
@@ -160,10 +160,10 @@ public class PDFRenderer implements Renderer {
        * render the areas into PDF
        *
        * @param areaTree the laid-out area tree
-       * @param writer the PrintWriter to write the PDF with
+       * @param stream the OutputStream to write the PDF to
        */
     public void render(AreaTree areaTree,
-                       PrintWriter writer) throws IOException, FOPException {
+                       OutputStream stream) throws IOException, FOPException {
         MessageHandler.logln("rendering areas to PDF");
         idReferences = areaTree.getIDReferences();
         this.pdfResources = this.pdfDoc.getResources();
@@ -181,7 +181,7 @@ public class PDFRenderer implements Renderer {
         }
 
         MessageHandler.logln("writing out PDF");
-        this.pdfDoc.output(writer);
+        this.pdfDoc.output(stream);
     }
 
     /**
index 9b17daad58e0ff521a1e5e7b8a6ede618efcb646..ff8e2defaa2ba17f6c499cd2235fe6bf4e409180 100644 (file)
@@ -64,6 +64,7 @@ import org.apache.fop.fo.properties.LeaderPattern;
 // Java
 import java.io.IOException;
 import java.io.PrintWriter;
+import java.io.OutputStream;
 import java.util.Enumeration;
 
 /**
@@ -93,12 +94,12 @@ public class XMLRenderer implements Renderer {
      * render the areas into XML
      *
      * @param areaTree the laid-out area tree
-     * @param writer the PrintWriter to give the XML to
+     * @param stream the OutputStream to give the XML to
      */
-    public void render(AreaTree areaTree, PrintWriter writer)
+    public void render(AreaTree areaTree, OutputStream stream)
        throws IOException {
        MessageHandler.logln("rendering areas to XML");
-       this.writer = writer;
+       this.writer = new PrintWriter(stream);
        this.writer.write("<?xml version=\"1.0\"?>\n<!-- produced by "
                          + this.producer + " -->\n");
        writeStartTag("<AreaTree>");