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

Bug 444393

Summary: Revise contract between FXChopBoxAnchor and FXChopBoxAnchor$ReferencePointProvider
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-17 12:43:49 EDT
It should be ensured that the ReferencePointProvider does never return null as a reference point to the FXChopBoxAnchor (i.e. the referencePointProperty() should always contain a reference point). Currently, FXChopBoxHelper (the only implementation of the ReferencePointProvider) will not provide a reference point before the anchor is actually attached to the curve. 

We should change the contract, because the contract is much clearer if a reference point is always to be provided. FXChopBoxAnchor could throw an exception rather than tolerating the null value.
Comment 1 Matthias Wienand CLA 2014-09-18 13:41:31 EDT
I changed the contract correspondingly: if the ReferencePointProvider does not provide a reference point, an exception is thrown.

Some parts of the FXChopBoxHelper and FXConnection classes were depending on the old behavior. Therefore, I refactored those classes, too. As a result, reference points are now also provided for way points (if necessary).

The code is published on the master branch. Resolving as fixed for target milestone 3.10.0M2.