Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » GEF » Draw2D events
Draw2D events [message #230626] Wed, 14 February 2007 14:40 Go to next message
Manuel Selva is currently offline Manuel Selva
Messages: 189
Registered: July 2009
Location: Grenoble, France
Senior Member
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 #230633 is a reply to message #230626] Wed, 14 February 2007 15:55 Go to previous messageGo to next message
Manuel Selva is currently offline Manuel Selva
Messages: 189
Registered: July 2009
Location: Grenoble, France
Senior Member
I forgot to mention that the child rectangle figures must have a mouse OR
mouse motion listener on them to reproduce the described behavior (the
panel listener is never notified).

Manuel Selva


Re: Draw2D events [message #230664 is a reply to message #230626] Wed, 14 February 2007 22:35 Go to previous messageGo to next message
Eclipse User
Originally posted by: none.unknown.com

Please elaborate. Are you using GEF at all, or just Draw2d? Are you
talking about a native drag or one within the lightweight system?

You should just debug to see what exactly is going on. Perhaps the
rectangle figures are consuming the drag event. If they don't do that, I
think the events will fall through to the container. Even if they don't,
you can set up your RectangleFigures to forwards certain event notification
to its parent.


"Manuel Selva" <manuel.selva@st.com> wrote in message
news:edf7547faf5231e63182a3d4e9217a9a$1@www.eclipse.org...
> 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 07:16 Go to previous message
Manuel Selva is currently offline Manuel Selva
Messages: 189
Registered: July 2009
Location: Grenoble, France
Senior Member
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


Previous Topic:Flowlayout and childrens size
Next Topic:Disable palette entry
Goto Forum:
  


Current Time: Mon Oct 20 21:29:52 GMT 2014

Powered by FUDForum. Page generated in 0.10447 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software