Since your "Rectangle Elements" will be on top of this "Background glasspane (fill:none, mouseevents:fill)" the mouse event only applies to the topmost visible element.
So your Background will react only if the click is over it, and it will not react if the click is over any other element. I use this approach to provide a "De-select" option.
Andres.
On May 11, 2005, at 9:57 AM, [EMAIL PROTECTED] wrote:
I have a JSVGCanvas (with a DOM representaion) of an imported SVG file.
This file basically contains a plain white grid with several rectangles in
it.
I need to detect if the user has clicked in a "whitespace" area (ie. not in
a rectangle "Element").
I have a Event listener on each rectangle, so I can detect a "click" within
the rectangle itself.
Attempts to put an Event listener on the "whole document" like this have
failed:
Element elt = theDocument.getDocumentElement(); EventTarget t = (EventTarget)elt; t.addEventListener("click", new WhiteSpaceClickAction(), false);
I can detect ALL mouse events on the JSVGCanvas itself using Mouse Listeners, (ie. MouseListener, MouseMotionListener) but this still doesn't help, since I can't tell if the X, Y coordinates are "in" a rectangle or not.
Is there a "standard" way to do this? Is there an API call to query if a coordinate is within an Element?
Thanks for any help. Ted
---------------------------------------------------------------------
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]
