Package org.eclipse.gef.fx.anchors
Interface IAnchor
-
- All Known Implementing Classes:
AbstractAnchor,AbstractRouter.VolatileStaticAnchor,DynamicAnchor,StaticAnchor
public interface IAnchorAnIAnchoris a visual anchor that will provide positions for attachedAnchorKeys (i.e. anchoredNodes) in local coordinates of theAnchorKey's anchoredNode.The position for each attached
Nodewill be recomputed in case the attachedNodeor any of its ancestors are changed in a way that has an effect on the position being provided for the attachedNode. ThepositionsUnmodifiableProperty()will be updated accordingly, it may be monitored for changes.An
IAnchormay be bound to an anchorageNode. If this is the case, positions for all attachedNodes will also be recomputed in case the anchorageNodeor any of its ancestors are changed in a way that will have an effect on the position of the attachedNode.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description javafx.beans.property.ReadOnlyObjectProperty<javafx.scene.Node>anchorageProperty()Provides a read-only property with the anchorageNodethisIAnchoris bound to.voidattach(AnchorKey key)voiddetach(AnchorKey key)javafx.scene.NodegetAnchorage()Provides the anchorageNodethisIAnchoris bound to.PointgetPosition(AnchorKey key)Provides a position for the givenAnchorKey.javafx.collections.ObservableMap<AnchorKey,Point>getPositionsUnmodifiable()Provides an observable read-only (map) with positions (in local coordinates of the anchoredNodes) for all attachedAnchorKeys.booleanisAttached(AnchorKey key)javafx.beans.property.ReadOnlyMapProperty<AnchorKey,Point>positionsUnmodifiableProperty()Provides a read-only (map) property with positions (in local coordinates of the anchoredNodes) for all attachedAnchorKeys.
-
-
-
Method Detail
-
anchorageProperty
javafx.beans.property.ReadOnlyObjectProperty<javafx.scene.Node> anchorageProperty()
Provides a read-only property with the anchorageNodethisIAnchoris bound to. The property value may benullin case thisIAnchoris not bound to an anchorageNode.- Returns:
- A read-only property storing the anchorage
Node.
-
getAnchorage
javafx.scene.Node getAnchorage()
Provides the anchorageNodethisIAnchoris bound to. Will return the value of theanchorageProperty().- Returns:
- The value of the
anchorageProperty().
-
getPosition
Point getPosition(AnchorKey key)
Provides a position for the givenAnchorKey. The providedAnchorKeyhas to be attached to thisIAnchor(seeattach(AnchorKey)).- Parameters:
key- TheAnchorKeyto retrieve a position for. It has to be attached (attach(AnchorKey)) to thisIAnchorbefore.- Returns:
- The position for the given
AnchorKeywithin local coordinates of theAnchorKey's anchoredNode.
-
getPositionsUnmodifiable
javafx.collections.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
boolean isAttached(AnchorKey key)
- Parameters:
key- TheAnchorKeyto test.- Returns:
trueif the given key is attached, otherwisefalse.
-
positionsUnmodifiableProperty
javafx.beans.property.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).- Returns:
- A read-only (map) property storing positions for all attached
AnchorKeys.
-
-