You are viewing a plain text version of this content. The canonical link for it is here.
Posted to batik-users@xmlgraphics.apache.org by Emmy Alex <ea...@hermes.tietronix.com> on 2007/04/15 18:52:37 UTC

Passing object from JSVGCanvas to RhinoInterpreter

Hello All,
I have my own class MyJSVGCanvas which extends JSVGCanvas and I have a member object for some logging purposes, in MyJSVGCanvas class. Is there anyway that I can access this object in the org.apache.batik.script.rhino.RhinoInterpreter class , I need it to store some values i find in the script into that member object of MyJSVGCanvas class.

Any help will be appreciated.
Thanks,
Emmy 
             

---------------------------------------------------------------------
To unsubscribe, e-mail: batik-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: batik-users-help@xmlgraphics.apache.org


Re: Passing object from JSVGCanvas to RhinoInterpreter

Posted by th...@kodak.com.
Hi Emmy,

"Emmy Alex" <ea...@hermes.tietronix.com> wrote on 04/15/2007 12:52:37 PM:

> I have my own class MyJSVGCanvas which extends JSVGCanvas and I have
> a member object for some logging purposes, in MyJSVGCanvas class. Is
> there anyway that I can access this object in the org.apache.batik.
> script.rhino.RhinoInterpreter class , I need it to store some values
> i find in the script into that member object of MyJSVGCanvas class.

   The BridgeContext has a method 'getInterpreter(String lang)' which
you can use to get a reference to our wrapper around the Rhino 
Interpreter.
That wrapper has a method "bindObject(String name, Object obj)" which
can be used to bind 'obj' to name 'name' in the Interpreter.  This
then makes it possible to call methods on that object from script.


---------------------------------------------------------------------
To unsubscribe, e-mail: batik-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: batik-users-help@xmlgraphics.apache.org