aboutsummaryrefslogtreecommitdiffstats
path: root/src/sandbox
diff options
context:
space:
mode:
authorMehdi Houshmand <mehdi@apache.org>2012-01-23 16:15:23 +0000
committerMehdi Houshmand <mehdi@apache.org>2012-01-23 16:15:23 +0000
commitfb20c15fa4aafcc71ddb7288d45d32db118a7d86 (patch)
tree0dcead028ea6374af7b696627de46fd908fc29c6 /src/sandbox
parentcfd456f554e0e0d89d8455f9d216850a0cc1765b (diff)
downloadxmlgraphics-fop-fb20c15fa4aafcc71ddb7288d45d32db118a7d86.tar.gz
xmlgraphics-fop-fb20c15fa4aafcc71ddb7288d45d32db118a7d86.zip
Moved the FOUserAgent into the constructor of the Renderers
This breaks the public API but for good reasons: 1) the user-agent is essential for configuring the renderers 2) instantiation of the constructor is always followed by call to "setUserAgent()" (in the examples) 3) simplifies the API and reduces mutability of the Renderers git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@1234877 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src/sandbox')
-rw-r--r--src/sandbox/org/apache/fop/render/svg/SVGRenderer.java11
-rw-r--r--src/sandbox/org/apache/fop/render/svg/SVGRendererMaker.java2
2 files changed, 8 insertions, 5 deletions
diff --git a/src/sandbox/org/apache/fop/render/svg/SVGRenderer.java b/src/sandbox/org/apache/fop/render/svg/SVGRenderer.java
index 63f486c07..246062a32 100644
--- a/src/sandbox/org/apache/fop/render/svg/SVGRenderer.java
+++ b/src/sandbox/org/apache/fop/render/svg/SVGRenderer.java
@@ -26,19 +26,22 @@ import java.io.IOException;
import java.io.OutputStream;
import java.io.Writer;
+import org.w3c.dom.DOMImplementation;
+import org.w3c.dom.Document;
+
import org.apache.batik.dom.GenericDOMImplementation;
import org.apache.batik.svggen.SVGGeneratorContext;
import org.apache.batik.svggen.SVGGraphics2D;
import org.apache.commons.io.IOUtils;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
+
+import org.apache.fop.apps.FOUserAgent;
import org.apache.fop.apps.MimeConstants;
import org.apache.fop.area.PageViewport;
import org.apache.fop.render.bitmap.MultiFileRenderingUtil;
import org.apache.fop.render.java2d.Java2DGraphicsState;
import org.apache.fop.render.java2d.Java2DRenderer;
-import org.w3c.dom.DOMImplementation;
-import org.w3c.dom.Document;
/**
* <p>
@@ -67,8 +70,8 @@ public class SVGRenderer extends Java2DRenderer {
/** Helper class for generating multiple files */
private MultiFileRenderingUtil multiFileUtil;
- /** Default constructor. */
- public SVGRenderer() {
+ public SVGRenderer(FOUserAgent userAgent) {
+ super(userAgent);
}
/** {@inheritDoc} */
diff --git a/src/sandbox/org/apache/fop/render/svg/SVGRendererMaker.java b/src/sandbox/org/apache/fop/render/svg/SVGRendererMaker.java
index f0da974e6..892d01711 100644
--- a/src/sandbox/org/apache/fop/render/svg/SVGRendererMaker.java
+++ b/src/sandbox/org/apache/fop/render/svg/SVGRendererMaker.java
@@ -34,7 +34,7 @@ public class SVGRendererMaker extends AbstractRendererMaker {
/** {@inheritDoc} */
public Renderer makeRenderer(FOUserAgent ua) {
- return new SVGRenderer();
+ return new SVGRenderer(ua);
}
/** {@inheritDoc} */