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;
/**
* 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).
return false;
}
- /**
- * 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);
}
}
import java.awt.RenderingHints;
import java.awt.Dimension;
-public class SVGUserAgent implements UserAgent {
+public class SVGUserAgent extends UserAgentAdapter {
AffineTransform currentTransform = null;
Logger log;
log.info(message);
}
+ /**
+ * Shows an alert dialog box.
+ */
+ public void showAlert(String message) {
+ log.warn(message);
+ }
+
/**
* Returns a customized the pixel to mm factor.
*/
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;
}
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) {}
-
}