Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 278559 - Change visibility of member in FeedbackHelper
Summary: Change visibility of member in FeedbackHelper
Status: RESOLVED WONTFIX
Alias: None
Product: GEF
Classification: Tools
Component: GEF-Legacy GEF (MVC) (show other bugs)
Version: unspecified   Edit
Hardware: All All
: P3 trivial (vote)
Target Milestone: ---   Edit
Assignee: gef-inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-05-31 15:35 EDT by Jens Von Pilgrim CLA
Modified: 2015-09-27 13:34 EDT (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Jens Von Pilgrim CLA 2009-05-31 15:35:01 EDT
In org.eclipse.gef.editpolicies.FeedbackHelper, a dummyAnchor is used to calculate a connections end point while a connection is drawn. If the default behaviour of this helper should be changed, a subclass may also change the anchor. (This is the case in GEF3D, in which we exchange the dummyAnchor by a 3D anchor). Unfortunately, the member field is private and no setter is defined. Currently, a subclass can only ignore all the functionality of FeedbackHelper and override all methods. By letting the dummyAnchor be created by a create-method, this class would become much more flexible for extensions.

Here is the "patch":

/**
 * Constructs a new FeedbackHelper.
 */
public FeedbackHelper() {
	dummyAnchor = createDummyAnchor
}

/**
* Creates the dummy anchor used while connection is drawn and
* not target edit part is hit. 
* This method is called by the constructor and may be overridden by
* subclasses, if an anchor different from {@link XYAnchor} should be
* used as dummy anchor.
*/
protected ConnectionAnchor createDummyAnchor() {
        return new XYAnchor(new Point(10, 10));
}

Cheers,

Jens
Comment 1 Jens Von Pilgrim CLA 2009-05-31 15:50:12 EDT
there is a little bug in the patch:

protected XYAnchor createDummyAnchor() {
        return new XYAnchor(new Point(10, 10));
}

(the anchor must be an XYAnchor). 

 
Comment 2 Alexander Nyßen CLA 2015-09-27 13:34:21 EDT
I don't think it makes sense to break up this class as proposed here. The only method where the anchor is actually used is update(). By overwriting it, the anchor can easily be exchanged. Resolving as WONTFIX though.