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

Bug 443781

Summary: Merge IFXConnection, AbstractFXConnection, and FXCurveConnection into FXConnection, extracting an IFXConnectionRouter
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: unspecified   
Target Milestone: 3.10.0 (Mars) M2   
Hardware: All   
OS: All   
Whiteboard:

Description Alexander Nyßen CLA 2014-09-11 03:41:39 EDT
Up to now, AbstractFXConnection contains an abstract computeGeometry(Point[]) method, which in case of FXCurveConnection creates a Polyline. In an anonymous subclass within the MVC.FX example, the same is overwritten to create a PolyBezier. 

IMHO, constructing a curve geometry from given start, end, and manual way points, should be extracted into a connection router, which could be passed in to the connection as a delegate (rather than realized by subclassing of AbstractFXConnection). 

If we thus implement computeGeometry(Point[]) (and rename it properly) to delegate the responsibility to an IFXConnectionRouter, we could remove the FXCurveConnection subclass and also remove the IFXConnection interface, which does not provide any abstraction over the AbstractFXConnection class.
Comment 1 Matthias Wienand CLA 2014-09-11 09:28:12 EDT
I implemented the proposed changes:
 - Replace abstract method AbstractFXConnection#computeGeometry() by introducing IFXConnectionRouter which is responsible for computing the geometry now.
 - Renamed AbstractFXConnection to FXConnection and made it concrete.
 - Removed FXCurveConnection (as it does not extend FXConnection by anything).
 - Added two default implementations for IFXConnectionRouter: FXPolylineConnectionRouter and FXPolyBezierConnectionRouter.

The code is published on the master branch, therefore I change the status to RESOLVED, FIXED.