aboutsummaryrefslogtreecommitdiffstats
path: root/src/java/org/apache/fop/render/AbstractGenericSVGHandler.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/java/org/apache/fop/render/AbstractGenericSVGHandler.java')
-rw-r--r--src/java/org/apache/fop/render/AbstractGenericSVGHandler.java26
1 files changed, 13 insertions, 13 deletions
diff --git a/src/java/org/apache/fop/render/AbstractGenericSVGHandler.java b/src/java/org/apache/fop/render/AbstractGenericSVGHandler.java
index 7d21d78c0..f74699fd5 100644
--- a/src/java/org/apache/fop/render/AbstractGenericSVGHandler.java
+++ b/src/java/org/apache/fop/render/AbstractGenericSVGHandler.java
@@ -26,28 +26,18 @@ import java.awt.geom.AffineTransform;
import java.awt.geom.Rectangle2D;
import java.io.IOException;
-// DOM
import org.w3c.dom.Document;
-// Batik
-import org.apache.batik.bridge.GVTBuilder;
import org.apache.batik.bridge.BridgeContext;
+import org.apache.batik.bridge.GVTBuilder;
import org.apache.batik.dom.svg.SVGDOMImplementation;
import org.apache.batik.gvt.GraphicsNode;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
-// FOP
-import org.apache.fop.render.Graphics2DAdapter;
-import org.apache.fop.render.Graphics2DImagePainter;
-import org.apache.fop.render.RendererContextConstants;
-import org.apache.fop.render.XMLHandler;
-import org.apache.fop.render.RendererContext;
import org.apache.fop.render.RendererContext.RendererContextWrapper;
import org.apache.fop.svg.SVGUserAgent;
-// Commons-Logging
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-
/**
* Generic XML handler for SVG. Uses Apache Batik for SVG processing and simply paints to
* a Graphics2DAdapter and thus ultimatively to Graphics2D interface that is presented.
@@ -76,6 +66,7 @@ public abstract class AbstractGenericSVGHandler implements XMLHandler, RendererC
*/
protected void renderSVGDocument(final RendererContext context,
final Document doc) throws IOException {
+ updateRendererContext(context);
final RendererContextWrapper wrappedContext = RendererContext.wrapRendererContext(context);
int x = wrappedContext.getCurrentXPosition();
int y = wrappedContext.getCurrentYPosition();
@@ -123,6 +114,15 @@ public abstract class AbstractGenericSVGHandler implements XMLHandler, RendererC
x, y, wrappedContext.getWidth(), wrappedContext.getHeight());
}
+ /**
+ * Override this method to update the renderer context if it needs special settings for
+ * certain conditions.
+ * @param context the renderer context
+ */
+ protected void updateRendererContext(RendererContext context) {
+ //nop
+ }
+
/** {@inheritDoc} */
public String getNamespace() {
return SVGDOMImplementation.SVG_NAMESPACE_URI;