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 Mathieu Pedrero <ma...@centraliens-lille.org> on 2009/07/11 19:54:55 UTC
Listening to a drag of a svg element!
Hi!
I studied the following code i found in the Batik Website:
public void registerListeners() {
// Gets an element from the loaded document.
Element elt = document.getElementById("elt-id");
EventTarget t = (EventTarget)elt;
// Adds a 'onload' listener
t.addEventListener("SVGLoad", new OnLoadAction(), false);
// Adds a 'onclick' listener
t.addEventListener("click", new OnClickAction(), false);
}
here are added 'onload' and 'onclick' listeners. I would like to ad an
'onmousedragged' listener. Is that possible?
And to go further, does anyone knows and could tell me the whole list of
vent wich can be listened on svg elements?
Thanks a lot!
--
Mathieu
Re: Listening to a drag of a svg element!
Posted by Helder Magalhães <he...@gmail.com>.
Hi Mathieu,
> here are added 'onload' and 'onclick' listeners. I would like to ad an
> 'onmousedragged' listener. Is that possible?
I'm not sure if you intend this in the scope of drag & drop but, as
we're at it, this has been recently [1] been proposed to the SVG
Working Group... ;-) Of course that, even if this is considered for a
future version of the SVG specification, it will take a while until
it's available in implementations.
In terms of contemporary implementation, SVG provides "onmousedown",
"onmousemove" and "onmouseup" [1], which can be used for this purpose.
:-)
> And to go further, does anyone knows and could tell me the whole list of
> vent wich can be listened on svg elements?
Well, Batik is targeted at being a compliant SVG 1.1 implementation
and, as far as I know, supports all of the available events so the
complete list can be seen directly in the SVG specification [1] [2].
;-)
> Thanks a lot!
Hope this helps,
Helder
[1] http://lists.w3.org/Archives/Public/www-svg/2009May/0053.html
[2] http://www.w3.org/TR/SVG/script.html#EventAttributes
[3] http://www.w3.org/TR/SVG/interact.html#SVGEvents
---------------------------------------------------------------------
To unsubscribe, e-mail: batik-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: batik-users-help@xmlgraphics.apache.org