Bug 262617 - Extending ManhattanConnectionRouter
Summary: Extending ManhattanConnectionRouter
Status: NEW
Alias: None
Product: GEF
Classification: Tools
Component: GEF-Legacy Draw2d (show other bugs)
Version: 3.3.1   Edit
Hardware: PC Windows XP
: P3 normal with 2 votes (vote)
Target Milestone: ---   Edit
Assignee: gef-inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-01-27 13:32 EST by Raymond Leung CLA
Modified: 2012-05-10 02:54 EDT (History)
6 users (show)

See Also:


Attachments
Diagram 1 (33.11 KB, image/jpeg)
2009-01-27 13:33 EST, Raymond Leung CLA
no flags Details
Diagram 2 (34.02 KB, image/jpeg)
2009-01-27 13:34 EST, Raymond Leung CLA
no flags Details
SCDLManhattanConnectionRouter.java (17.29 KB, application/octet-stream)
2009-01-27 13:35 EST, Raymond Leung CLA
no flags Details
Variant of SCDLManhattanConnectionRouter.java (17.14 KB, text/plain)
2009-02-03 11:58 EST, Richard Mah CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Raymond Leung CLA 2009-01-27 13:32:54 EST
Build ID: M20080221-1800

Steps To Reproduce:
The ManhattanConnectionRouter which is provided by org.eclipse.draw2d provided a good basis for drawing connections in our tooling but it had problems in a few situations.  If you take a look at the image in diagram1.jpg you will notice the problems it has in drawing the connection between Component1 and Component2 (it appears behind Component3).  We prefer to draw the connection around Component3 as shown in diagram2.jpg.

You will also notice that the two connections between Component4 and Component5 and between Component4 and Component6 (in diagram1.bmp) have vertical portions which are very close to each other.  We prefer to separate them more for clarity as shown in diagram2.bmp.

More information:
In order to implement our desired connection layout, we created class SCDLManhattanConnectionRouter that was based on the original ManhattanConnectionRouter from org.eclipse.draw2d.

We would like to submit our implementation of the connection router (SCDLManhattanConnectionRouter) for consideration into the base eclipse code, and we are making our changes available as required under the Eclipse Public License.  Please see the attachment called SCDLManhattanConnectionRouter.java for that implementation.
Comment 1 Raymond Leung CLA 2009-01-27 13:33:57 EST
Created attachment 123913 [details]
Diagram 1
Comment 2 Raymond Leung CLA 2009-01-27 13:34:22 EST
Created attachment 123914 [details]
Diagram 2
Comment 3 Raymond Leung CLA 2009-01-27 13:35:30 EST
Created attachment 123915 [details]
SCDLManhattanConnectionRouter.java
Comment 4 Richard Mah CLA 2009-02-03 11:58:35 EST
Created attachment 124564 [details]
Variant of SCDLManhattanConnectionRouter.java
Comment 5 Anthony Hunter CLA 2009-04-02 13:33:44 EDT
Why does SCDLManhattanConnectionRouter not extend the ManhattanConnectionRouter?
Comment 6 Raymond Leung CLA 2009-04-02 14:27:52 EDT
SCDLManhattanConnectionRouter is a copy of ManhattanConnectionRouter with some private methods tweaked.
Comment 7 Anthony Hunter CLA 2009-04-02 15:50:03 EDT
(In reply to comment #6)
> SCDLManhattanConnectionRouter is a copy of ManhattanConnectionRouter with some
> private methods tweaked.

OK, so why not just request some additional API with the existing ManhattanConnectionRouter , why contribute a new one?
Comment 8 Raymond Leung CLA 2009-04-02 17:04:35 EDT
That's why we are submitting our code here for you to do whatever you see fit, whether creating extra APIs or changing the existing behavior. We didn't have the time to go through the process earlier.
Comment 9 Jeff Berkowitz CLA 2009-04-02 20:39:46 EDT
The functionality of this router depends on a number of supporting classes, such as SCDLPolylineConnection, that appear to be internal to IBM/Rational.  The "variant" makes use of a different set of supporting classes, such as ComponentReferenceGroupingFigure, that also appear to be internal.  I have no experience with Eclipse development, so perhaps I'm missing something, but what purpose do the Java file attachments serve if nobody else can compile them?
Comment 10 Aleksandr Kravets CLA 2010-01-15 11:43:58 EST
(In reply to comment #9)
> The functionality of this router depends on a number of supporting classes,
> such as SCDLPolylineConnection, that appear to be internal to IBM/Rational. 
> The "variant" makes use of a different set of supporting classes, such as
> ComponentReferenceGroupingFigure, that also appear to be internal.  I have no
> experience with Eclipse development, so perhaps I'm missing something, but what
> purpose do the Java file attachments serve if nobody else can compile them?

I think these can be easily refactored to create a more general collision avoidance router. I like this implementation, it's very useful in heavily populated diagram.