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]
