Community
Participate
Working Groups
Graphiti should support an additional connection type: Curved connection style (splines)
Requested by JPA Editor
Would like to target for Juno
(In reply to comment #2) > Would like to target for Juno Sorry, wrong request: Out-of-scope for Juno unless there are contributions in this area
Created attachment 208758 [details] This patch add CurvedConnection support to Graphiti This patch extends Graphiti by the new CurvedConnection type. This connection is defined as a list of control points. Each control point has x and y coordinates (double values) defining the location of the control point relative to the connection. The x coordinate should be between 0.0 and 1.0 and defines the position on the line (e.g. 0.5 for the half/center of the line). The y coordinate describes the length of a northogonal (to the line if it were a linear one) vector starting at x. The number of control points (+2 for start and end anchors ) defines the degree n of the Bezier curve. See http://en.wikipedia.org/wiki/B%C3%A9zier_curve for further information regarding Bezier curves.
(In reply to comment #4) > Created attachment 208758 [details] > This patch add CurvedConnection support to Graphiti Sorry, but CurvedConnectionEditPart seems to be missing in the attached patch. Could you add that?
Created attachment 208995 [details] A set of patches for CurvedConnection support.
Sorry, I did not recognize that Git patches need to be created for every commit to the local repo. Hence, I attached 4 patches in one zip.
Thanks for this contribution, it looks very good! I added the patch to my local workspace and was able to add curbed connections to the Sketch test editor. I will also check in this change to the Sketch test too as soon as everything is complete. But while doing that I found one issue: after changing the control points of a curved connection that is already drawn on a diagram the connection will not be updated. it appears that refreshVisuals need to be enhanced to correctly trigger the update.
(In reply to comment #8) > But while doing that I found one issue: after changing the control points of a > curved connection that is already drawn on a diagram the connection will not be > updated. it appears that refreshVisuals need to be enhanced to correctly > trigger the update. I found a solution for this: on refreshVisuals the the edit part needs to refresh the control points in the router. It does this by calling invalidate on the router; the router then grabs the current set of control points from the curved connection and sets it. Checked in to head and pushed to Eclipse: commit b9922d9386944e5e4bf291b2d90724ea8e94d9d0 Author: mwenz <michael.wenz@sap.com> 2012-01-11 10:28:03 Committer: mwenz <michael.wenz@sap.com> 2012-01-11 10:28:03 Parent: 8f8d61e4c4acb8c98e8fa2a97d3ff7c88584b20d (Bug 352119: Added custom feature in sketch test tool to modify control points) Branches: origin/master, master
(In reply to comment #6) > Created attachment 208995 [details] > A set of patches for CurvedConnection support. At first glance the patch looked big enough to require a CQ for check-in. After a closer look it turned out that it was only that big because it also contained the generated classes for the Graphiti EMF model. The actual change was much smaller and turned out to be well below 200 lines, so no CQ is required.
I have checked in your patch to head and pushed it to Eclipse: commit ca080be99c1f18c7eea8fc2f82bf2ef2bcbf65a1 Author: mwenz <michael.wenz@sap.com> 2012-01-05 16:27:04 Committer: mwenz <michael.wenz@sap.com> 2012-01-05 16:27:04 Parent: 21f2d6edcd4325d9be86c31a6ceb4a6a1c8dd1c0 (Bug 323034: Headers) Child: eddd532c4d79efe8d5f8ebdf23f4ef5fb0daa595 (Bug 352119: Added small example to sketch) Branches: origin/master, master Also I added a small enhancement to the Sketch test tool: it allows to create curevd connections (3 initial control points are set automatically) and a new custom feature allows to modify the control points of an existing curved connection: commit eddd532c4d79efe8d5f8ebdf23f4ef5fb0daa595 Author: mwenz <michael.wenz@sap.com> 2012-01-05 16:53:09 Committer: mwenz <michael.wenz@sap.com> 2012-01-05 16:53:09 Parent: ca080be99c1f18c7eea8fc2f82bf2ef2bcbf65a1 (Bug 352119: Applied patch for adding CurvedConnection) Child: 6c5f3d467ad21b689eef7153bdd916a30f89af00 (Bug 352119: JavaDoc) Branches: origin/master, master and commit 8f8d61e4c4acb8c98e8fa2a97d3ff7c88584b20d Author: mwenz <michael.wenz@sap.com> 2012-01-11 09:50:56 Committer: mwenz <michael.wenz@sap.com> 2012-01-11 09:50:56 Parent: 8148a874c28ee9b4e3b4fe328a456bee558cfd1e (Bug 352119: Updated headers) Child: b9922d9386944e5e4bf291b2d90724ea8e94d9d0 (Bug 352119: Enabled refresh of control points an redraw) Branches: origin/master, master
Flagged to be part of Juno M5
Comment on attachment 208995 [details] A set of patches for CurvedConnection support. Marked patch as IP log relevant
I have added a basic test case for curved connections to the Bot test suite: commit b155de0780055613b7750f99ef03553abb265439 Author: mwenz <michael.wenz@sap.com> 2012-01-11 13:28:55 Committer: mwenz <michael.wenz@sap.com> 2012-01-11 13:28:55 Parent: f3fb023fe7f3a225659406594671bdc900c04b0b (Bug 363796: Added JavaDoc also to IToolBehaviorProvider) Branches: origin/master, master
Bookkeeping: Set target release
Part of Graphiti 0.9.0 (Eclipse Juno)