Package org.eclipse.gef.fx.anchors
Interface IAnchor
- All Known Implementing Classes:
AbstractAnchor,AbstractRouter.VolatileStaticAnchor,DynamicAnchor,StaticAnchor
public interface IAnchor
An
IAnchor is a visual anchor that will provide positions for
attached AnchorKeys (i.e. anchored Nodes) in local
coordinates of the AnchorKey's anchored Node.
The position for each attached Node will be recomputed in case the
attached Node or any of its ancestors are changed in a way that has
an effect on the position being provided for the attached Node. The
positionsUnmodifiableProperty() will be updated accordingly, it may
be monitored for changes.
An IAnchor may be bound to an anchorage Node. If this is the
case, positions for all attached Nodes will also be recomputed in
case the anchorage Node or any of its ancestors are changed in a way
that will have an effect on the position of the attached Node.
-
Property Summary
PropertiesTypePropertyDescription -
Method Summary
Modifier and TypeMethodDescriptionvoidvoidgetPosition(AnchorKey key) Provides a position for the givenAnchorKey.booleanisAttached(AnchorKey key)
-
Property Details
-
anchorage
ReadOnlyObjectProperty<Node> anchoragePropertyProvides a read-only property with the anchorageNodethisIAnchoris bound to. The property value may benullin case thisIAnchoris not bound to an anchorageNode.- See Also:
-
positionsUnmodifiable
ReadOnlyMapProperty<AnchorKey,Point> positionsUnmodifiablePropertyProvides a read-only (map) property with positions (in local coordinates of the anchoredNodes) for all attachedAnchorKeys. The positions will be updated for all attachedAnchorKeys if the attachedNodes or the anchorageNode, theIAnchoris bound to, or any of their ancestors changes in a way that will effect the positions (within the local coordinate space of the attachedNodes).- See Also:
-
-
Method Details
-
anchorageProperty
ReadOnlyObjectProperty<Node> anchorageProperty()Provides a read-only property with the anchorageNodethisIAnchoris bound to. The property value may benullin case thisIAnchoris not bound to an anchorageNode.- See Also:
-
attach
- Parameters:
key- TheAnchorKeyto be attached.
-
detach
- Parameters:
key- TheAnchorKeyto be detached.
-
getAnchorage
Node getAnchorage()Provides the anchorageNodethisIAnchoris bound to. Will return the value of theanchorageProperty().- Returns:
- The value of the
anchorageProperty().
-
getPosition
Provides a position for the givenAnchorKey. The providedAnchorKeyhas to be attached to thisIAnchor(seeattach(AnchorKey)). -
getPositionsUnmodifiable
ObservableMap<AnchorKey,Point> getPositionsUnmodifiable()Provides an observable read-only (map) with positions (in local coordinates of the anchoredNodes) for all attachedAnchorKeys. The positions will be updated for all attachedAnchorKeys if the attachedNodes or the anchorageNode, theIAnchoris bound to, or any of their ancestors changes in a way that will effect the positions (within the local coordinate space of the attachedNodes).- Returns:
- A read-only observable map storing positions for all attached
AnchorKeys.
-
isAttached
- Parameters:
key- TheAnchorKeyto test.- Returns:
trueif the given key is attached, otherwisefalse.
-
positionsUnmodifiableProperty
ReadOnlyMapProperty<AnchorKey,Point> positionsUnmodifiableProperty()Provides a read-only (map) property with positions (in local coordinates of the anchoredNodes) for all attachedAnchorKeys. The positions will be updated for all attachedAnchorKeys if the attachedNodes or the anchorageNode, theIAnchoris bound to, or any of their ancestors changes in a way that will effect the positions (within the local coordinate space of the attachedNodes).- See Also:
-