|Adding bendpoints as part of Arrange All [message #990886]
||Fri, 14 December 2012 16:26
| Stephen Slaboda
Registered: November 2012
I currently have an AbstractLayoutNodeProvider that implements the arrangement of my elements on the GMF diagram. However, since I have several connections between several of the elements, I would like to programmatically add bendpoints to the connections to avoid them crossing over the layed out elements. What is the correct way to do this from within the arrange all command?
The math and arrangement logic isn't what I'm concerned about - I haven't figured out how to submit an appropriate command or use an appropriate editing domain to accomplish the addition of the bendpoint to the Edge.
A minor complication: When a new diagram of my type is created, elements are added to the model and I perform an arrange all command in the XYZDiagramEditorUtil.openDiagram method if the diagram has just been created (checked courtesy of a boolean value set from within the XYZDiagramEditorUtil.createDiagram method), but not when a diagram that already exists is opened.
Is there a better way to provide both the functionality to arrange all in an existing diagram, and to perform the same arrangement logic upon diagram creation?
I do think I understand how to add bendpoints (get the points from the edge and insert a new RelativeBendpoint), but any concrete examples of that would be appreciated, especially since it was difficult for me to find an example online at all.
Powered by FUDForum
. Page generated in 0.01622 seconds