diff options
author | Adrian Cumiskey <acumiskey@apache.org> | 2008-11-20 17:52:34 +0000 |
---|---|---|
committer | Adrian Cumiskey <acumiskey@apache.org> | 2008-11-20 17:52:34 +0000 |
commit | 005e36da82c0bb31c6f906d4052dd6f00d810798 (patch) | |
tree | d3ddb74c146114b6c8991054aa68057a573c9ba2 /src/java | |
parent | b4c6724ac10059e980fb1aede0ea04dd9a81c3b2 (diff) | |
download | xmlgraphics-fop-005e36da82c0bb31c6f906d4052dd6f00d810798.tar.gz xmlgraphics-fop-005e36da82c0bb31c6f906d4052dd6f00d810798.zip |
Improved plumbing :)
git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/branches/Temp_AFPGOCAResources@719307 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src/java')
-rw-r--r-- | src/java/org/apache/fop/afp/AFPResourceManager.java | 10 | ||||
-rw-r--r-- | src/java/org/apache/fop/afp/AFPStreamer.java | 19 | ||||
-rw-r--r-- | src/java/org/apache/fop/render/afp/AFPRenderer.java | 4 |
3 files changed, 16 insertions, 17 deletions
diff --git a/src/java/org/apache/fop/afp/AFPResourceManager.java b/src/java/org/apache/fop/afp/AFPResourceManager.java index ec5890e39..9a521dbe7 100644 --- a/src/java/org/apache/fop/afp/AFPResourceManager.java +++ b/src/java/org/apache/fop/afp/AFPResourceManager.java @@ -62,12 +62,16 @@ public class AFPResourceManager { /** * Sets the outputstream * - * @param state the AFP painting state + * @param paintingState the AFP painting state * @param outputStream the outputstream + * @return a new AFP DataStream + * @throws IOException thrown if an I/O exception of some sort has occurred */ - public void createDataStream(AFPPaintingState state, OutputStream outputStream) { - this.dataStream = streamer.createDataStream(state); + public DataStream createDataStream(AFPPaintingState paintingState, OutputStream outputStream) + throws IOException { + this.dataStream = streamer.createDataStream(paintingState); streamer.setOutputStream(outputStream); + return this.dataStream; } /** diff --git a/src/java/org/apache/fop/afp/AFPStreamer.java b/src/java/org/apache/fop/afp/AFPStreamer.java index 007259cd4..7e208bb6e 100644 --- a/src/java/org/apache/fop/afp/AFPStreamer.java +++ b/src/java/org/apache/fop/afp/AFPStreamer.java @@ -83,19 +83,16 @@ public class AFPStreamer implements Streamable { /** * Creates a new DataStream * - * @param state the AFP painting state + * @param paintingState the AFP painting state * @return a new {@link DataStream} + * @throws IOException thrown if an I/O exception of some sort has occurred */ - public DataStream createDataStream(AFPPaintingState state) { - try { - this.tempFile = File.createTempFile(AFPDATASTREAM_TEMP_FILE_PREFIX, null); - this.documentFile = new RandomAccessFile(tempFile, "rw"); - this.documentOutputStream = new BufferedOutputStream( - new FileOutputStream(documentFile.getFD())); - this.dataStream = factory.createDataStream(state, documentOutputStream); - } catch (IOException e) { - log.error(e.getMessage()); - } + public DataStream createDataStream(AFPPaintingState paintingState) throws IOException { + this.tempFile = File.createTempFile(AFPDATASTREAM_TEMP_FILE_PREFIX, null); + this.documentFile = new RandomAccessFile(tempFile, "rw"); + this.documentOutputStream = new BufferedOutputStream( + new FileOutputStream(documentFile.getFD())); + this.dataStream = factory.createDataStream(paintingState, documentOutputStream); return dataStream; } diff --git a/src/java/org/apache/fop/render/afp/AFPRenderer.java b/src/java/org/apache/fop/render/afp/AFPRenderer.java index 918c67e33..edc8f7662 100644 --- a/src/java/org/apache/fop/render/afp/AFPRenderer.java +++ b/src/java/org/apache/fop/render/afp/AFPRenderer.java @@ -196,9 +196,7 @@ public class AFPRenderer extends AbstractPathOrientedRenderer { public void startRenderer(OutputStream outputStream) throws IOException { paintingState.setColor(Color.WHITE); - resourceManager.createDataStream(paintingState, outputStream); - - this.dataStream = resourceManager.getDataStream(); + this.dataStream = resourceManager.createDataStream(paintingState, outputStream); this.borderPainter = new AFPBorderPainter(paintingState, dataStream); this.rectanglePainter = new AFPRectanglePainter(paintingState, dataStream); |