You are viewing a plain text version of this content. The canonical link for it is here.
Posted to batik-dev@xmlgraphics.apache.org by Cameron McCormack <ca...@mcc.id.au> on 2008/05/02 07:52:13 UTC
Re: Exposing script interpreters from the JSVGCanvas
Hi Helder.
Helder Magalhães:
> This seems rather useful. Currently I'm conducting some
> HTML<-->Applet<-->SVG experiments (mostly based in a related post [1]) and
> the current workaround is a bit of a hack. ;-)
OK I just added this. You can now do something like:
JFrame f = …;
JSVGCanvas c = …;
// Wait until the document is running, by listening for GVT build
// events, or SVGLoad.
Interpreter i = c.getInterpreter("application/ecmascript");
if (i != null) {
i.bindObject("theFrame", f);
// Now script in the SVG document can use the variable 'theFrame'
// to call methods on the JFrame object above.
}
--
Cameron McCormack ≝ http://mcc.id.au/
---------------------------------------------------------------------
To unsubscribe, e-mail: batik-dev-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: batik-dev-help@xmlgraphics.apache.org