We're creating an editor for a visual notation. As a simplified view,
assume nodes and connections.
In the editpart for our node, we've installed a component_role and
layout_role. (also, probably irrelevant: selection_feedback_role)
When dragging a node onto another, thanks to the xylayouteditpolicy we
have, createAddCommand() is called and we can perform some graph
manipulation when a user drops a node onto another.
I've been unable to replicate this behaviour when nodes are dropped on
connections and I was wondering if there is something I don't quite
understand.
Connections aren't targetted for dragging. The parts that can be dragged
onto connections should override getDragTracker() and return a custom
DragEditPartsTracker that would target connection parts.
"Jason Kealey" <jkealey@shade.ca> wrote in message
news:af2fca8d15676ea8564370f638138b79$1@www.eclipse.org...
> We're creating an editor for a visual notation. As a simplified view,
> assume nodes and connections.
>
> In the editpart for our node, we've installed a component_role and
> layout_role. (also, probably irrelevant: selection_feedback_role)
>
> When dragging a node onto another, thanks to the xylayouteditpolicy we
> have, createAddCommand() is called and we can perform some graph
> manipulation when a user drops a node onto another.
>
> I've been unable to replicate this behaviour when nodes are dropped on
> connections and I was wondering if there is something I don't quite
> understand.
>
> (Or maybe I am doing it all wrong)
> Thanks!
>
hello,
i have the same problem. I want to drag a connection and drop it on another connection. But I only get a "add children request", but there are no EditParts in the request. I ve modified the DragEditPartsTracker, so its getExclusionSet()-Method returns an EMPTY_LIST. But still a createAddCommand is never called.
Did you do something else?
Jan Krakora Messages: 402 Registered: December 2009 Location: Prague
Senior Member
I think your problem is different from the Jason's. He drags nodes and drops them on connections.
You would like to reconnect a connection from a node to a connection, right? I have never done this but, it could works just as with standard nodes.
From the ConnectionEditPart interface javadoc:
Similarly, a ConnectionEditPart can also be a "node", meaning it can serve as the source or target of some other ConnectionEditPart. This makes connection to connection possible.
So if you know, how connection between nodes works, connection between connection and node or between two connections should work similar.
Thanks a lot for your reply!
I already solved the problem. Didn't thought about handling a connection as a Node. For that reason, a NonResizableEditPolicy can be installed for the connection. Then the requests are send.