diff options
author | Mehdi Houshmand <mehdi@apache.org> | 2012-01-23 16:15:23 +0000 |
---|---|---|
committer | Mehdi Houshmand <mehdi@apache.org> | 2012-01-23 16:15:23 +0000 |
commit | fb20c15fa4aafcc71ddb7288d45d32db118a7d86 (patch) | |
tree | 0dcead028ea6374af7b696627de46fd908fc29c6 /src/java/org/apache/fop/render/java2d | |
parent | cfd456f554e0e0d89d8455f9d216850a0cc1765b (diff) | |
download | xmlgraphics-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/java/org/apache/fop/render/java2d')
-rw-r--r-- | src/java/org/apache/fop/render/java2d/Java2DRenderer.java | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/src/java/org/apache/fop/render/java2d/Java2DRenderer.java b/src/java/org/apache/fop/render/java2d/Java2DRenderer.java index 766aa081f..3c7006588 100644 --- a/src/java/org/apache/fop/render/java2d/Java2DRenderer.java +++ b/src/java/org/apache/fop/render/java2d/Java2DRenderer.java @@ -147,15 +147,13 @@ public abstract class Java2DRenderer extends AbstractPathOrientedRenderer implem private GeneralPath currentPath = null; /** Default constructor */ - public Java2DRenderer() { - } + public Java2DRenderer(FOUserAgent userAgent) { + super(userAgent); - /** {@inheritDoc} */ - public void setUserAgent(FOUserAgent foUserAgent) { - super.setUserAgent(foUserAgent); + // MH: necessary? the caller has access to FOUserAgent userAgent.setRendererOverride(this); // for document regeneration - String s = (String)userAgent.getRendererOptions().get(JAVA2D_TRANSPARENT_PAGE_BACKGROUND); + String s = (String) userAgent.getRendererOptions().get(JAVA2D_TRANSPARENT_PAGE_BACKGROUND); if (s != null) { this.transparentPageBackground = "true".equalsIgnoreCase(s); } |