Draw2D events [message #230626] |
Wed, 14 February 2007 09:40  |
Eclipse User |
|
|
|
Hi all,
I am dealing with Draw2D events. In my FigureCanvas i have a Panel set as
content. This panel is entirely covered by several RectangleFigure
figures. I would like to listen for MouseDragg events over the panel. Is
there one way to do this ?? All events seems "to be catch" by the covering
rectangles and the listener associated to the panel is never notified ...
Thanks in advance
Manuel Selva
|
|
|
|
|
Re: Draw2D events [message #230692 is a reply to message #230664] |
Thu, 15 February 2007 02:16  |
Eclipse User |
|
|
|
Thanks for your answer,
Here are some precisions.
I am using only Draw2D in an Eclipse view (an SWT Composite). After having
a look at Draw2D 3.2.1 source code here are my conclusions: The
SWTEventDispatcher, when SWT mouse events occur, search for the top most
figure interested in SWT mouse events, i.e aware of Draw2D mouse events OR
mouse motion events (MouseListener or MouseMotionListener interfaces).
This is done by calling the FindMouseEventTargetAt method on the root
figure. In my case, since my child figure is interested in
MouseMotionListener, the parent one, also intersted in this kind of event
is never notified and only the child figure calback is done.
So, in fact, my question is, Draw2D events mechanism allows to notify only
ONE figure, i am right ? What is the best way to override this behavior,
should i extend figure to consume the event and also send it to the parent
if interested in ?
May be i should also put a new feature request in Bugzilla .. ? Before do
this, is there any people interested in such a feature or is there any
thing i missed in Draw2D to achieve my goal ?
Thans in advance
Manuel Selva
|
|
|
Powered by
FUDForum. Page generated in 0.04227 seconds