Hi all,
I'm trying to incorporate JavaScript into one of my SVG files and I'm running
into trouble. I'm sure it's something I've done because it's a custom canvas
class and I'm directly using Rhino:
The SVG:
<svg contentScriptType="text/ecmascript" ...>
<script type="text/ecmascript">
<![CDATA[ ... ]]>
</script>
</svg>
The canvas:
public class CustomCanvas extends JSVGCanvas {
public CustomCanvas() {
super();
this.setDoubleBuffered(true);
this.setDoubleBufferedRendering(true);
this.setDocumentState(JSVGCanvas.ALWAYS_DYNAMIC);
}
}
I'm building with Maven so my project has a dependency on Rhino 1.7R1 for the
js.jar.
When I load the SVG with the canvas, I get a pop-up error:
SVG Error: Unknown language: text/ecmascript
Details:
java.lang.Exception: Unknown language: text/ecmascript
at org.apache.batik.bridge.BridgeContext.getInterpreter(BridgeContext.java:575)
at
org.apache.batik.bridge.BaseScriptingEnvironment.getInterpreter(BaseScriptingEnvironment.java:289)
at
org.apache.batik.bridge.BaseScriptingEnvironment.loadScripts(BaseScriptingEnvironment.java:404)
at
org.apache.batik.bridge.UpdateManager.dispatchSVGLoadEvent(UpdateManager.java:238)
at
org.apache.batik.bridge.UpdateManager.dispatchSVGLoadEvent(UpdateManager.java:220)
at
org.apache.batik.swing.svg.SVGLoadEventDispatcher.run(SVGLoadEventDispatcher.java:100)
The document loads without issue in Squiggle, so I know I'm messing something
up. Do I have to use the js.jar that comes with Batik? Do I have to do
something to "register" the js.jar to handle a certain script type? I took a
look through the Squiggle source, but didn't see anything that stood out.
Thanks for any help.
Michael
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]