Class AbstractAnchor

java.lang.Object
org.eclipse.gef.fx.anchors.AbstractAnchor
All Implemented Interfaces:
IAnchor
Direct Known Subclasses:
DynamicAnchor, StaticAnchor

public abstract class AbstractAnchor extends Object implements IAnchor
AbstractAnchor is the abstract base implementation for IAnchors. It provides the facility to bind an anchor to an anchorage Node (anchorageProperty()), to attach and detach Nodes via AnchorKeys, and to provide positions ( positionsUnmodifiableProperty()) for the attached AnchorKey s.

It also registers the necessary listeners at the anchorage Node and the attached Nodes as well as relevant ancestor Nodes, to trigger the (re-)computation of positions.

The actual computation of positions for attached nodes is delegated to computePosition(AnchorKey), thus left to subclasses. If a subclass needs additional information to compute positions for attached AnchorKeys, it may request that an IAdaptable info gets passed into attach(AnchorKey) and detach(AnchorKey), and may overwrite both methods to get access to it.