Kevin, Thanks for the explanations. I think this is a worthy feature to have and I think we should have a look at how hard it is to implement and if we will be able to squeeze it in.
I have added an RFE for your request and we will see what the other commiters think: http://nagoya.apache.org/bugzilla/show_bug.cgi?id=9149 Vincent. Kevin Lindsey wrote: > > Vincent, > > > > Is there any work being done to allow the use of JavaScript objects as > > > callbacks in event listeners? Or is this being saved for a later date > > > (a lower priority)? > > > > I am not sure I understand your question. You can already add event > > handlers attributes with ECMAScript code in your SVG content and, > > through scripting, you can add event listeners, such as: > > Adobe's SVG Viewer allows me to use a JavaScript object as an event handler. > The object needs a handleEvent method to follow the EventListener interface. > For example, the following code creates a Button object that handles various > mouse events for a specific svg node. > > button = new Button(); > > someSVGNode.addEventListener(mousedown, button, false); > someSVGNode.addEventListener(mousemove, button, false); > someSVGNode.addEventListener(mouseup, button, false); > > function Button() { > ... > } > > Button.prototype.handleEvent = function(e) { > var type = e.type; > > if ( this[type] != null ) this[type](e); > }; > > Button.prototype.mousedown = function(e) { ... } > Button.prototype.mousemove = function(e) { ... } > Button.prototype.mouseup = function(e) { ... } > > When I try this in Batik, I get the following error: Cannot convert [object > Object] to org.w3c.dom.events.EventListener. So, I'm wondering if it is or > will be possible to use JavaScript objects as event listeners. > > Thanks, > Kevin > KevLinDev - http://www.kevlindev.com > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
