diff options
author | Jeremias Maerki <jeremias@apache.org> | 2008-12-09 15:00:35 +0000 |
---|---|---|
committer | Jeremias Maerki <jeremias@apache.org> | 2008-12-09 15:00:35 +0000 |
commit | a6ddced309701a1ca8d79a9e7bec3288afba2cc8 (patch) | |
tree | c3d2bcfe7277246d9a2acc3675721a99f4de5727 /src/java/org/apache/fop/render/RendererContext.java | |
parent | 9d339f0968314f0cfcc4a720628fed1845292ce1 (diff) | |
parent | f9d4720b99f5e0fb423b097d7207dfab446d911c (diff) | |
download | xmlgraphics-fop-a6ddced309701a1ca8d79a9e7bec3288afba2cc8.tar.gz xmlgraphics-fop-a6ddced309701a1ca8d79a9e7bec3288afba2cc8.zip |
Merge from Trunk revisions 719662 - 724689.
Conflict for ImageHandler interface resolved by renaming Trunk's ImageHandler to ImageHandlerBase and extending the other ImageHandler from that.
git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/branches/Temp_AreaTreeNewDesign@724729 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src/java/org/apache/fop/render/RendererContext.java')
-rw-r--r-- | src/java/org/apache/fop/render/RendererContext.java | 52 |
1 files changed, 44 insertions, 8 deletions
diff --git a/src/java/org/apache/fop/render/RendererContext.java b/src/java/org/apache/fop/render/RendererContext.java index 595bdd7c2..ac885a44b 100644 --- a/src/java/org/apache/fop/render/RendererContext.java +++ b/src/java/org/apache/fop/render/RendererContext.java @@ -20,9 +20,12 @@ package org.apache.fop.render; //Java +import java.util.Iterator; import java.util.Map; import org.apache.fop.apps.FOUserAgent; +import org.apache.fop.fo.extensions.ExtensionElementMapping; +import org.apache.xmlgraphics.util.QName; /** * The Render Context for external handlers. This provides a rendering context @@ -30,21 +33,28 @@ import org.apache.fop.apps.FOUserAgent; * render target. */ public class RendererContext { + /** conversion-mode extension attribute */ + protected static final QName CONVERSION_MODE = new QName( + ExtensionElementMapping.URI, null, "conversion-mode"); - private String mime; - private AbstractRenderer renderer; + /** "bitmap" value for the "conversion-mode" extension attribute. */ + protected static final String BITMAP = "bitmap"; + + private final String mime; + private final AbstractRenderer renderer; private FOUserAgent userAgent; - private Map props = new java.util.HashMap(); + + private final Map/*<String,Object>*/ props = new java.util.HashMap/*<String,Object>*/(); /** - * Contructor for this class. It takes a MIME type as parameter. + * Constructor for this class. It takes a MIME type as parameter. * - * @param renderer The current renderer - * @param m The MIME type of the output that's generated. + * @param renderer the current renderer + * @param mime the MIME type of the output that's generated. */ - public RendererContext(AbstractRenderer renderer, String m) { + public RendererContext(AbstractRenderer renderer, String mime) { this.renderer = renderer; - this.mime = m; + this.mime = mime; } /** @@ -112,6 +122,19 @@ public class RendererContext { return wrapper; } + /** {@inheritDoc} **/ + public String toString() { + StringBuffer stringBuffer = new StringBuffer("RendererContext{\n"); + Iterator it = props.keySet().iterator(); + while (it.hasNext()) { + String key = (String)it.next(); + Object value = props.get(key); + stringBuffer.append("\t" + key + "=" + value + "\n"); + } + stringBuffer.append("}"); + return stringBuffer.toString(); + } + /** * Base class for a wrapper around RendererContext to access its properties in a type-safe, * renderer-specific way. @@ -158,6 +181,19 @@ public class RendererContext { public Map getForeignAttributes() { return (Map)context.getProperty(RendererContextConstants.FOREIGN_ATTRIBUTES); } + + /** {@inheritDoc} */ + public String toString() { + return "RendererContextWrapper{" + + "userAgent=" + getUserAgent() + + "x=" + getCurrentXPosition() + + "y=" + getCurrentYPosition() + + "width=" + getWidth() + + "height=" + getHeight() + + "foreignAttributes=" + getForeignAttributes() + + "}"; + + } } } |