Custom connection [message #1759733] |
Mon, 17 April 2017 20:07  |
Eclipse User |
|
|
|
Hi,
I am trying to create a connection similar to this one

This connection is static in a sense that as two connected objects move, either the height of left and right vertical lines change or the horizontal line between them does. This was done in GEF editor with custom router.
The closest connection I saw in Graphiti is CurvedConnection. However, it does not work in my case because as position of connecting object changes, so does the shape of the curve (bezier curve) - in my case it always needs to be a quadrilateral with 90 degree angles.
What can I use/write to create connection that I need?
Thanks,
Alex
[Updated on: Tue, 18 April 2017 13:47] by Moderator Report message to a moderator
|
|
|
Re: Custom connection [message #1760349 is a reply to message #1759733] |
Wed, 26 April 2017 08:28   |
Eclipse User |
|
|
|
Alex,
Graphiti does not offer the option to hook in a custom router. I would propose to use a Freeform Connection for that and create the required bendpoints directly on creation of that connection. On moving any of the shapes you would then need to adapt the positions of the bendpoints accordingly.
Additionally you might want to disable the option for the user to move and add/remove bendpoints; to achive that you would need to disable the DefaultMoveBendpointFeature, DefaultAddBendpointFeature and DefaultRemoveBendpointFeature by returning null in your feature provider for those connections.
Michael
|
|
|
|
Powered by
FUDForum. Page generated in 0.02155 seconds