Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 352119 - Curved connection style (splines)
Summary: Curved connection style (splines)
Status: CLOSED FIXED
Alias: None
Product: Graphiti
Classification: Modeling
Component: Core (show other bugs)
Version: 0.8.0   Edit
Hardware: All All
: P4 enhancement (vote)
Target Milestone: 0.9.0   Edit
Assignee: Michael Wenz CLA
QA Contact:
URL:
Whiteboard: Juno M5 Theme_round_offs
Keywords:
Depends on:
Blocks:
 
Reported: 2011-07-14 11:34 EDT by Michael Wenz CLA
Modified: 2012-06-29 04:18 EDT (History)
1 user (show)

See Also:
michael.wenz: juno+


Attachments
This patch add CurvedConnection support to Graphiti (141.62 KB, patch)
2011-12-22 17:33 EST, Benjamin Schmeling CLA
no flags Details | Diff
A set of patches for CurvedConnection support. (14.65 KB, patch)
2012-01-04 05:53 EST, Benjamin Schmeling CLA
michael.wenz: iplog+
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Michael Wenz CLA 2011-07-14 11:34:30 EDT
Graphiti should support an additional connection type: Curved connection style (splines)
Comment 1 Michael Wenz CLA 2011-07-14 11:34:45 EDT
Requested by JPA Editor
Comment 2 Michael Wenz CLA 2011-07-14 11:35:02 EDT
Would like to target for Juno
Comment 3 Michael Wenz CLA 2011-07-14 11:36:19 EDT
(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
Comment 4 Benjamin Schmeling CLA 2011-12-22 17:33:47 EST
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.
Comment 5 Michael Wenz CLA 2011-12-29 07:56:18 EST
(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?
Comment 6 Benjamin Schmeling CLA 2012-01-04 05:53:57 EST
Created attachment 208995 [details]
A set of patches for CurvedConnection support.
Comment 7 Benjamin Schmeling CLA 2012-01-04 05:54:18 EST
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.
Comment 8 Michael Wenz CLA 2012-01-10 08:55:22 EST
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.
Comment 9 Michael Wenz CLA 2012-01-11 04:55:10 EST
(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
Comment 10 Michael Wenz CLA 2012-01-11 04:57:10 EST
(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.
Comment 11 Michael Wenz CLA 2012-01-11 04:59:34 EST
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
Comment 12 Michael Wenz CLA 2012-01-11 05:00:42 EST
Flagged to be part of Juno M5
Comment 13 Michael Wenz CLA 2012-01-11 05:01:20 EST
Comment on attachment 208995 [details]
A set of patches for CurvedConnection support.

Marked patch as IP log relevant
Comment 14 Michael Wenz CLA 2012-01-11 07:33:06 EST
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
Comment 15 Michael Wenz CLA 2012-04-11 10:52:41 EDT
Bookkeeping: Set target release
Comment 16 Michael Wenz CLA 2012-06-29 04:18:58 EDT
Part of Graphiti 0.9.0 (Eclipse Juno)