keiron 02/03/11 04:57:18 Modified: src/org/apache/fop/svg PDFTranscoder.java SVGUserAgent.java Log: extends adapter instead of implementing useragent Revision Changes Path 1.16 +4 -60 xml-fop/src/org/apache/fop/svg/PDFTranscoder.java Index: PDFTranscoder.java =================================================================== RCS file: /home/cvs/xml-fop/src/org/apache/fop/svg/PDFTranscoder.java,v retrieving revision 1.15 retrieving revision 1.16 diff -u -r1.15 -r1.16 --- PDFTranscoder.java 19 Feb 2002 13:03:14 -0000 1.15 +++ PDFTranscoder.java 11 Mar 2002 12:57:18 -0000 1.16 @@ -1,5 +1,5 @@ /* - * $Id: PDFTranscoder.java,v 1.15 2002/02/19 13:03:14 keiron Exp $ + * $Id: PDFTranscoder.java,v 1.16 2002/03/11 12:57:18 keiron Exp $ * Copyright (C) 2001 The Apache Software Foundation. All rights reserved. * For details on use and redistribution please refer to the * LICENSE file included with these sources. @@ -38,6 +38,7 @@ 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; @@ -120,7 +121,7 @@ * millimeter conversion factor. * * @author <a href="mailto:[EMAIL PROTECTED]">Keiron Liddle</a> - * @version $Id: PDFTranscoder.java,v 1.15 2002/02/19 13:03:14 keiron Exp $ + * @version $Id: PDFTranscoder.java,v 1.16 2002/03/11 12:57:18 keiron Exp $ */ public class PDFTranscoder extends XMLAbstractTranscoder { @@ -310,7 +311,7 @@ /** * 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 @@ /** * 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); } } 1.7 +9 -32 xml-fop/src/org/apache/fop/svg/SVGUserAgent.java Index: SVGUserAgent.java =================================================================== RCS file: /home/cvs/xml-fop/src/org/apache/fop/svg/SVGUserAgent.java,v retrieving revision 1.6 retrieving revision 1.7 diff -u -r1.6 -r1.7 --- SVGUserAgent.java 15 Nov 2001 08:12:37 -0000 1.6 +++ SVGUserAgent.java 11 Mar 2002 12:57:18 -0000 1.7 @@ -1,5 +1,5 @@ /* - * $Id: SVGUserAgent.java,v 1.6 2001/11/15 08:12:37 keiron Exp $ + * $Id: SVGUserAgent.java,v 1.7 2002/03/11 12:57:18 keiron Exp $ * Copyright (C) 2001 The Apache Software Foundation. All rights reserved. * For details on use and redistribution please refer to the * LICENSE file included with these sources. @@ -31,7 +31,7 @@ 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 @@ } /** + * 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 @@ 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; } @@ -128,22 +121,6 @@ public Dimension2D getViewportSize() { 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) {} }
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]