Hello Thomas:
     Thanks a lot for your help.  If i have a function named "mouseClick1(evt)" and i want to call it, I should use "ctx.getInterpreter("mouseClick1(evt)").evaluate("mouseClick1(evt)");"  , ctx is the BridgeContext here.  Is it correct? or i should remove the "(evt)".
     Because I do not use any component, I just want to get the BufferedImage, so if i use this way, whether only the GVTtree will be changed? or I have to set a component for it. 
      I have tried just using the "evaluate" in my code, and got some errors of "AWT-EventQueue-0"
     Thanks a lot
     zhao
     

 
On 7/31/06, [EMAIL PROTECTED] <[EMAIL PROTECTED] > wrote:
Hi Zhao,

"comlong zhao" <[EMAIL PROTECTED]> wrote on 07/27/2006 03:09:28 PM:

>      I think it is possible. Could some kind person give me some ideas.
I need
> to ust a Button to give an event to one SVG file, and then the SVG
changes on
> the JCanvas.  Like the demo of mines.svg, you could press the SVG button
to
> restart a new game, How to use a JButton to do the same thing?

  This is a little unclear to me.  Do you want to dispatch an event
or do you want to call a specific ECMA script function in the document.

  If you want to dispatch an event then you will probably want to
use the batik.gvt.event.AWTEventDispatcher class to dispatch a
Swing/AWT event into the GVT tree (which will eventually dispatch
into the DOM tree).

  If you want to call an ECMA script function you can get the
ECMAScript batik.script.Interpretor from the BridgeContext
(BridgeContext.getInterpreter(String lang) ) and use it's
'evaluate(String str)' to call the function.  You can also
use 'bindObject(String name, Object obj)' to bind a Java
Object into the script environment.



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Reply via email to