|Re: Drag a node and drop on connection [message #634982 is a reply to message #633400]
||Mon, 25 October 2010 10:12
|| Jens von Pilgrim
Registered: July 2009
On 17.10.10 15:07, amay wrote:|
> When user drag a graphical node and drop on some other connection, the
> connection should be updated with dropped node.
> Can anyone please help me what edit policies or something else shall I
> use to achieve this behavior??
This is a tricky thing to implement. What you need to to is to implement
a whole bunch of classes, as what you want to do is to replace the
standard selection edit policy, which works a little bit different then
simple creation tools. I don't have the time to give you a whole
instruction about that, but here are some hints. You'd need
- a subclass of AbstractDecoratorEditPolicy installed at the
parent edit part in order to install the following
policy at its children
- a subclass of ResizableEditPolicy(Ex) (the Ex is a GMF class,
have a look at the code, it adds drag and drop capabilities),
creating new handles (see below) and optionally a new
- a subclass of MoveHandle creating a new drag tracker (see below)
- optionally feedback figure, in order to let the user distinguish
between move and your operation
- a subclass of SelectionTool, creating a new tracker (see below)
- a subclass of DragEditPartsTracker, creating a new request
(see below), and also creates the command (see DragEditPartsTracker
to get an idea).
- a subclass of ChangeBoundsRequest, this request is eventually send
to your ResizableEditPolicy, which can distinguish between "standard"
move and your move by checking the request class
Maybe there exist easier solutions (suggestions are welcome). Sorry for
the brief answer, I hope it gives you a rough idea.
Powered by FUDForum
. Page generated in 0.01544 seconds