aboutsummaryrefslogtreecommitdiffstats
path: root/src/org/apache/fop/render/ps/PSRenderer.java
diff options
context:
space:
mode:
authorKeiron Liddle <keiron@apache.org>2001-08-21 06:18:55 +0000
committerKeiron Liddle <keiron@apache.org>2001-08-21 06:18:55 +0000
commitd470d62badfec6dca2e8d16d1aec9ce1f773c6a9 (patch)
treeb586b18777680401202502ed75f4628252126cff /src/org/apache/fop/render/ps/PSRenderer.java
parentdbbff1776dde2e91ff212ed3445ab851a93fa809 (diff)
downloadxmlgraphics-fop-d470d62badfec6dca2e8d16d1aec9ce1f773c6a9.tar.gz
xmlgraphics-fop-d470d62badfec6dca2e8d16d1aec9ce1f773c6a9.zip
changed to new logging for renderers
git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@194436 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src/org/apache/fop/render/ps/PSRenderer.java')
-rw-r--r--src/org/apache/fop/render/ps/PSRenderer.java37
1 files changed, 19 insertions, 18 deletions
diff --git a/src/org/apache/fop/render/ps/PSRenderer.java b/src/org/apache/fop/render/ps/PSRenderer.java
index 5bfcca1a3..a7836df34 100644
--- a/src/org/apache/fop/render/ps/PSRenderer.java
+++ b/src/org/apache/fop/render/ps/PSRenderer.java
@@ -8,8 +8,8 @@
package org.apache.fop.render.ps;
// FOP
-import org.apache.fop.messaging.MessageHandler;
import org.apache.fop.svg.SVGArea;
+import org.apache.fop.render.AbstractRenderer;
import org.apache.fop.render.Renderer;
import org.apache.fop.image.ImageArea;
import org.apache.fop.image.FopImage;
@@ -29,6 +29,8 @@ import org.apache.batik.gvt.renderer.*;
import org.apache.batik.gvt.filter.*;
import org.apache.batik.gvt.event.*;
+import org.apache.log.Logger;
+
// SVG
import org.w3c.dom.svg.SVGSVGElement;
import org.w3c.dom.svg.SVGDocument;
@@ -76,7 +78,7 @@ import java.awt.Dimension;
*
* @author Jeremias Märki
*/
-public class PSRenderer implements Renderer {
+public class PSRenderer extends AbstractRenderer {
/**
* the application producing the PostScript
@@ -430,7 +432,7 @@ public class PSRenderer implements Renderer {
write(sx + " " + sy + " " + " scale");
- UserAgent userAgent = new MUserAgent(new AffineTransform());
+ UserAgent userAgent = new MUserAgent(new AffineTransform(), log);
GVTBuilder builder = new GVTBuilder();
GraphicsNodeRenderContext rc = getRenderContext();
@@ -447,9 +449,8 @@ public class PSRenderer implements Renderer {
root = builder.build(ctx, doc);
root.paint(graphics, rc);
} catch (Exception e) {
- MessageHandler.errorln("Error: svg graphic could not be rendered: "
- + e.getMessage());
- // e.printStackTrace();
+ log.error("svg graphic could not be rendered: "
+ + e.getMessage(), e);
}
@@ -555,9 +556,8 @@ public class PSRenderer implements Renderer {
write("");
write("grestore");
} catch (FopImageException e) {
- e.printStackTrace();
- MessageHandler.errorln("PSRenderer.renderImageArea(): Error rendering bitmap ("
- + e.toString() + ")");
+ log.error("PSRenderer.renderImageArea(): Error rendering bitmap ("
+ + e.getMessage() + ")", e);
}
}
@@ -824,11 +824,11 @@ public class PSRenderer implements Renderer {
break;
case LeaderPattern.DOTS:
comment("% --- Leader dots NYI");
- MessageHandler.errorln("Leader dots: Not yet implemented");
+ log.error("Leader dots: Not yet implemented");
break;
case LeaderPattern.USECONTENT:
comment("% --- Leader use-content NYI");
- MessageHandler.errorln("Leader use-content: Not yet implemented");
+ log.error("Leader use-content: Not yet implemented");
break;
}
this.currentXPosition += area.getContentWidth();
@@ -927,26 +927,27 @@ public class PSRenderer implements Renderer {
protected class MUserAgent implements UserAgent {
AffineTransform currentTransform = null;
-
+ Logger log;
/**
* Creates a new SVGUserAgent.
*/
- protected MUserAgent(AffineTransform at) {
+ protected MUserAgent(AffineTransform at, Logger logger) {
currentTransform = at;
+ log = logger;
}
/**
* Displays an error message.
*/
public void displayError(String message) {
- System.err.println(message);
+ log.error(message);
}
/**
* Displays an error resulting from the specified Exception.
*/
public void displayError(Exception ex) {
- ex.printStackTrace(System.err);
+ log.error("SVG Error" + ex.getMessage(), ex);
}
/**
@@ -954,7 +955,7 @@ public class PSRenderer implements Renderer {
* The given message is typically displayed in a status bar.
*/
public void displayMessage(String message) {
- System.out.println(message);
+ log.info(message);
}
/**
@@ -1037,7 +1038,7 @@ public class PSRenderer implements Renderer {
*/
public void startRenderer(OutputStream outputStream)
throws IOException {
- MessageHandler.logln("rendering areas to PostScript");
+ log.debug("rendering areas to PostScript");
this.out = new PSStream(outputStream);
write("%!PS-Adobe-3.0");
@@ -1064,7 +1065,7 @@ public class PSRenderer implements Renderer {
write("%%Trailer");
write("%%EOF");
this.out.flush();
- MessageHandler.logln("written out PostScript");
+ log.debug("written out PostScript");
}
public void render(Page page, OutputStream outputStream) {