Skip to main content



      Home
Home » Modeling » Graphiti » Custom connection
Custom connection [message #1759733] Mon, 17 April 2017 16:07 Go to next message
Eclipse UserFriend
Hi,

I am trying to create a connection similar to this one
http://i.imgur.com/v9UKcKh.png

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 09:47] by Moderator

Re: Custom connection [message #1760349 is a reply to message #1759733] Wed, 26 April 2017 04:28 Go to previous messageGo to next message
Eclipse UserFriend
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
Re: Custom connection [message #1760403 is a reply to message #1760349] Wed, 26 April 2017 12:47 Go to previous message
Eclipse UserFriend
Thanks Michael.
Previous Topic:Loading images
Next Topic:Toolbar actions
Goto Forum:
  


Current Time: Fri Jul 11 22:31:13 EDT 2025

Powered by FUDForum. Page generated in 0.04529 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top