diff options
author | Keiron Liddle <keiron@apache.org> | 2002-03-11 12:57:18 +0000 |
---|---|---|
committer | Keiron Liddle <keiron@apache.org> | 2002-03-11 12:57:18 +0000 |
commit | fa70e1de28a17ff839318a4dfcc5504d27dc1d7f (patch) | |
tree | f52cd0281802d18e72cef8f869a2f21c67b2905f /src/org | |
parent | 300e94550892476a45d60cb0da80a0fe595a9a80 (diff) | |
download | xmlgraphics-fop-fa70e1de28a17ff839318a4dfcc5504d27dc1d7f.tar.gz xmlgraphics-fop-fa70e1de28a17ff839318a4dfcc5504d27dc1d7f.zip |
extends adapter instead of implementing useragent
git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@194699 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src/org')
-rw-r--r-- | src/org/apache/fop/svg/PDFTranscoder.java | 60 | ||||
-rw-r--r-- | src/org/apache/fop/svg/SVGUserAgent.java | 39 |
2 files changed, 10 insertions, 89 deletions
diff --git a/src/org/apache/fop/svg/PDFTranscoder.java b/src/org/apache/fop/svg/PDFTranscoder.java index 54ba7a3d3..f2f1cd7c1 100644 --- a/src/org/apache/fop/svg/PDFTranscoder.java +++ b/src/org/apache/fop/svg/PDFTranscoder.java @@ -38,6 +38,7 @@ import org.apache.batik.bridge.BridgeContext; import org.apache.batik.bridge.BridgeException; import org.apache.batik.bridge.GVTBuilder; import org.apache.batik.bridge.UserAgent; +import org.apache.batik.bridge.UserAgentAdapter; import org.apache.batik.bridge.ViewBox; import org.apache.batik.dom.svg.DefaultSVGContext; @@ -310,7 +311,7 @@ public class PDFTranscoder extends XMLAbstractTranscoder { /** * A user agent implementation for <tt>ImageTranscoder</tt>. */ - protected class ImageTranscoderUserAgent implements UserAgent { + protected class ImageTranscoderUserAgent extends UserAgentAdapter { /** * Returns the default size of this user agent (400x400). @@ -407,65 +408,8 @@ public class PDFTranscoder extends XMLAbstractTranscoder { /** * Unsupported operation. */ - public EventDispatcher getEventDispatcher() { - return null; - } - - /** - * Unsupported operation. - */ - public void openLink(SVGAElement elt) {} - - /** - * Unsupported operation. - */ - public void setSVGCursor(Cursor cursor) {} - - /** - * Unsupported operation. - */ - public void runThread(Thread t) {} - - /** - * Unsupported operation. - */ public AffineTransform getTransform() { return null; } - - /** - * Unsupported operation. - */ - public Point getClientAreaLocationOnScreen() { - return new Point(); - } - - /** - * Tells whether the given feature is supported by this - * user agent. - */ - public boolean hasFeature(String s) { - return FEATURES.contains(s); - } - - /** - * Tells whether the given extension is supported by this - * user agent. - */ - public boolean supportExtension(String s) { - return false; - } - - public void registerExtension(BridgeExtension be) {} - - public void handleElement(Element elt, Object data) {} - - } - - protected final static Set FEATURES = new HashSet(); - static { - FEATURES.add(SVGConstants.SVG_ORG_W3C_SVG_FEATURE); - FEATURES.add(SVGConstants.SVG_ORG_W3C_SVG_LANG_FEATURE); - FEATURES.add(SVGConstants.SVG_ORG_W3C_SVG_STATIC_FEATURE); } } diff --git a/src/org/apache/fop/svg/SVGUserAgent.java b/src/org/apache/fop/svg/SVGUserAgent.java index dc4c8a247..d7d9cc023 100644 --- a/src/org/apache/fop/svg/SVGUserAgent.java +++ b/src/org/apache/fop/svg/SVGUserAgent.java @@ -31,7 +31,7 @@ import java.awt.Point; import java.awt.RenderingHints; import java.awt.Dimension; -public class SVGUserAgent implements UserAgent { +public class SVGUserAgent extends UserAgentAdapter { AffineTransform currentTransform = null; Logger log; @@ -69,6 +69,13 @@ public class SVGUserAgent implements UserAgent { } /** + * Shows an alert dialog box. + */ + public void showAlert(String message) { + log.warn(message); + } + + /** * Returns a customized the pixel to mm factor. */ public float getPixelToMM() { @@ -107,20 +114,6 @@ public class SVGUserAgent implements UserAgent { return false; } - /** - * Opens a link in a new component. - * @param doc The current document. - * @param uri The document URI. - */ - public void openLink(SVGAElement elt) { - } - - public Point getClientAreaLocationOnScreen() { - return new Point(0, 0); - } - - public void setSVGCursor(java.awt.Cursor cursor) {} - public AffineTransform getTransform() { return currentTransform; } @@ -129,21 +122,5 @@ public class SVGUserAgent implements UserAgent { return new Dimension(100, 100); } - public EventDispatcher getEventDispatcher() { - return null; - } - - public boolean supportExtension(String str) { - return false; - } - - public boolean hasFeature(String str) { - return false; - } - - public void registerExtension(BridgeExtension be) {} - - public void handleElement(Element elt, Object data) {} - } |