Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [gef-dev] Draw2d Mouse Events Mechanism


Hi,

Please post questions to the GEF newsgroup news://news.eclipse.org/eclipse.tools.gef

Cheers...
Anthony
--
Anthony Hunter
mailto:anthonyh@xxxxxxxxxx
Software Development Manager: Eclipse Open Source Components
IBM Rational Software: Aurora / Modeling Tools
Phone: 613-591-7037



From: Manuel SELVA <manuel.selva@xxxxxx>
To: GEF development <gef-dev@xxxxxxxxxxx>
Date: 10/16/2007 02:58 AM
Subject: [gef-dev] Draw2d Mouse Events Mechanism





Hi all,

I am Working a lot with Draw2d, and finally got a Draw2d figure
hierarchy quit complex. In fact, the important thing is just that i have
a "transparent figure" on top of several others. A transparent rectangle
for example just override the fillShape method of RectangleFigure in
order to set the alpha transparency of the underlying Graphics and of
course of the underlying GC.

My problem is the following one : Figures "semi-hidden" by the
transparent rectangle don't received MouseEvents !!!

After looking inside Draw2d's code it seems that the SWTEventDispatcher
delegates to its root figure to find the "target figure" of a MouseDown
event for example. All the work is happening in findMouseEventTargetAt
and in findMouseEventTargetInDescendantsAt methods of the Figure class.
The findMouseEventTargetInDescendantsAt method start from the top most
figure (the figure at the top right in children list) and check if it
contains the "looking point", if yes it looks in its own children and
then return.

In my case The transparent rectangle contains point and does not accept
MouseEvents so the findMouseEventTargetInDescendantsAt returns Null
without looking into figures that are "behind" this transparent rectangle.

Does anybody already encountered this need and how do you fixed it ?
Maybe it will be nice to have a way to tell Draw2d figures "exclude this
figure from MouseEvents look path ...

Let me know if you have any suggestions, comments or critics on the subject

Manu
_______________________________________________
gef-dev mailing list
gef-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/gef-dev


Back to the top