Bend Connections routed by OrthogonalRouter (GEF 5) [message #1772104] |
Tue, 05 September 2017 14:27 |
Thomas Oberle Messages: 11 Registered: April 2017 |
Junior Member |
|
|
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 14:28] Report message to a moderator
|
|
|
Re: Bend Connections routed by OrthogonalRouter (GEF 5) [message #1772106 is a reply to message #1772104] |
Tue, 05 September 2017 14:47 |
|
IMHO it should not be possible to use BendOnSegmentDragHandler with StraightRouter. In the implementation, there is a guard, disallowing all IRouter implementations except OrthogonalRouter. Therefore, you should verify that it works for StraightRouter / does not work for OrthogonalRouter (that would be very strange).
If you want to bend a connection that is not routed via OrthogonalRouter, however, you should generate handles for the connection that can be used for manipulation via BendFirstAnchorageOnSegmentHandleDragHandler instead of BendOnSegmentDragHandler.
The BendOnSegmentDragHandler allows a manipulation of a segment in only one direction, i.e. horizontally or vertically. Therefore, it cannot be used to manipulate bendable-content-parts where not all segments are orthogonal. That's why it checks for OrthogonalRouter explicitly. We could instead think of another behaviour when manipulating differently routed bendable-content-parts.
Best regards,
Matthias
|
|
|
|
Re: Bend Connections routed by OrthogonalRouter (GEF 5) [message #1772293 is a reply to message #1772204] |
Thu, 07 September 2017 16:24 |
|
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.25235 seconds