Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » GEF » DND support for figures
DND support for figures [message #104043] Fri, 07 November 2003 11:45 Go to next message
Eclipse User
Originally posted by: aroberts.bowstreet.com

I created an swt.dnd.DragSource and DropTarget on a FigureCanvas, and then
added a DragSourceListener and DropTargetAdapter to each one to listen to
drag events on the FigureCanvas. When the user is dragging, what I really
want to do is highlight the appropriate figure inside the FigureCanvas. The
FigureCanvas' contents are a tree of IFigures. The problem is that the drag
seems to capture the mouse move events at the level of the FigureCanvas, and
the IFigure tree inside it doesn't get draw2d events. The only way I can
get the swt events to propagate to draw2d events is to set event.doit -
false, but that halts the drag operation.

Can you provide me with some tips on this? I'm not sure if I should be
doing something inside the dragOver() method of my DropTargetAdapter, and
using the DropTargetEvent to create and dispatch a new swt MouseEvent that
would propagate down to the IFigures.

Thanks;

Andy Roberts
Re: DND support for figures [message #104059 is a reply to message #104043] Fri, 07 November 2003 12:01 Go to previous message
Eclipse User
Originally posted by: none.us.ibm.com

You'll have to do this yourself in the dragOver callback using
findFigureAt(...)
draw2d is designed primarily for painting and layout, not editing. GEF is
used for editing.

"Andy Roberts" <aroberts@bowstreet.com> wrote in message
news:bogi4p$5jg$1@eclipse.org...
> I created an swt.dnd.DragSource and DropTarget on a FigureCanvas, and then
> added a DragSourceListener and DropTargetAdapter to each one to listen to
> drag events on the FigureCanvas. When the user is dragging, what I really
> want to do is highlight the appropriate figure inside the FigureCanvas.
The
> FigureCanvas' contents are a tree of IFigures. The problem is that the
drag
> seems to capture the mouse move events at the level of the FigureCanvas,
and
> the IFigure tree inside it doesn't get draw2d events. The only way I can
> get the swt events to propagate to draw2d events is to set event.doit -
> false, but that halts the drag operation.
>
> Can you provide me with some tips on this? I'm not sure if I should be
> doing something inside the dragOver() method of my DropTargetAdapter, and
> using the DropTargetEvent to create and dispatch a new swt MouseEvent that
> would propagate down to the IFigures.
>
> Thanks;
>
> Andy Roberts
>
>
Previous Topic:Cursor Figure in Logic Example
Next Topic:Context menu for draw2d figures
Goto Forum:
  


Current Time: Sat May 25 17:26:10 EDT 2013

Powered by FUDForum. Page generated in 0.01501 seconds