Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 488356

Summary: Implement an orthogonal connection router
Product: [Tools] GEF Reporter: Alexander Nyßen <nyssen>
Component: GEF FXAssignee: gef-inbox <gef-inbox>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: matthias.wienand
Version: 0.2.0   
Target Milestone: 4.0.0 (Neon) M6   
Hardware: All   
OS: All   
Whiteboard:
Bug Depends on:    
Bug Blocks: 488358    

Description Alexander Nyßen CLA 2016-02-24 02:15:11 EST
In order to support orthogonal connection routing, we need to provide an IConnectionRouter implementation that routes a connection orthogonally.
Comment 1 Matthias Wienand CLA 2016-03-02 12:22:16 EST
Alexander created an initial implementation (OrthogonalRouter) that I augmented today. The OrthogonalRouter is 'minimalistic', i.e. it inserts control points only if necessary, and it removes the control points that it created itself before determining the new control points to be inserted.

Today, I fixed the routing for a few corner cases. For example, fully horizontal/vertical connection segments are not allowed to start/end parallel to an anchorage's outline. For example, imagine the following situation with two rectangular anchorages that are connected by a fully horizontal line. The line starts in the middle of the bottom outline segment of the first anchorage, and ends in the middle of the top outline segment of the second anchorage, as follows:

 +---+
 |A0 |
 +-+-+
   +-----------+
             +-+-+
             |A1 |
             +---+

Therefore, both anchorages are orthogonally connected. However, the connection does not look correct as it overlaps the anchorages' outlines. This is fixed by inserting four control points, as follows:

 +---+
 |A0 |   +-----+
 +-+-+   |     |
   |     |   +-+-+
   +-----+   |A1 |
             +---+

The code is published on the master branch. Therefore, I resolve this as fixed for 4.0.0 M6.