Bend Connections routed by OrthogonalRouter (GEF 5) [message #1772104] |
Tue, 05 September 2017 10:27  |
Eclipse User |
|
|
|
Hello,
I want to be able to bend the Connections between my nodes.
To do so I add the following bindings:
adapterMapBinder.addBinding(AdapterKey.defaultRole()).to(BendConnectionPolicy.class);
adapterMapBinder.addBinding(AdapterKey.defaultRole()).to(BendOnSegmentDragHandler.class);
Futhermore I extend my Connection Part class by AbstractContentPart<Connection> and implement IBendableContentPart<Connection>
This seems not to be totaly wrong because it works for connections routed by StraightRouter.
Unfortunately this doesn´t work for OrthogonalRouter.
Am I doing something wrong or do I have to implement something else?
Thanks,
Thomas
[Updated on: Tue, 05 September 2017 10:28] by Moderator
|
|
|
|
|
Re: Bend Connections routed by OrthogonalRouter (GEF 5) [message #1772293 is a reply to message #1772204] |
Thu, 07 September 2017 12:24  |
Eclipse User |
|
|
|
Glad you found the solution!
Just as a clarification:
1) User clicks a connection
=> FocusAndSelectOnClickHandler selects the corresponding content part (SelectionModel is changed)
2) SelectionBehavior is notified about the selection change
=> SelectionFeedbackPartFactory generates SelectionFeedbackPart(s) for the new selection, highlighting it.
=> SelectionHandlePartFactory generates SelectionHandlePart(s) for the new selection. For an orthogonally routed connection, RectangleSegmentHandlePart(s) are created for the individual segments of the connection.
3) User drags a rectangular handle that was generated for the connection
=> BendFirstAnchorageOnHandleDragHandler manipulates the connection using BendConnectionPolicy.
Since the user interacts with a handle, an BendFirstAnchorageOnHandleDragHandler needs to be registered for that handle part, instead of being registered for the connection's content part. That's why the handler class has "BendFirstAnchorage" and "OnHandleDrag" in its name, to indicate that this handler should be registered for a handle part.
Best regards,
Matthias
|
|
|
Powered by
FUDForum. Page generated in 0.11536 seconds