Community
Participate
Working Groups
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
there is a little bug in the patch: protected XYAnchor createDummyAnchor() { return new XYAnchor(new Point(10, 10)); } (the anchor must be an XYAnchor).
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.