Package org.eclipse.gef.fx.anchors
Class StaticAnchor
java.lang.Object
org.eclipse.gef.fx.anchors.AbstractAnchor
org.eclipse.gef.fx.anchors.StaticAnchor
- All Implemented Interfaces:
IAnchor
- Direct Known Subclasses:
AbstractRouter.VolatileStaticAnchor
An
StaticAnchor provides a position for each AnchorKey, based
on a reference position relative to the anchorage Node, to which the
StaticAnchor is bound, or based on a (global) static reference
position in case the StaticAnchor is unbound.-
Property Summary
PropertiesTypePropertyDescriptionjavafx.beans.property.ObjectProperty<Point>Returns theObjectPropertythat manages the reference position of thisStaticAnchor.Properties inherited from class org.eclipse.gef.fx.anchors.AbstractAnchor
anchorage, positionsUnmodifiable -
Constructor Summary
ConstructorsConstructorDescriptionStaticAnchor(javafx.scene.Node anchorage, Point referencePositionInAnchorageLocal) Creates anStaticAnchorthat is bound to the provided anchorage.StaticAnchor(Point referencePositionInScene) Creates anStaticAnchorthat is not bound to an anchorageNodeand will always provide the passed in position (in scene coordinates) for all attachedAnchorKeys (i.e. anchoredNodes). -
Method Summary
Modifier and TypeMethodDescriptionprotected PointcomputePosition(AnchorKey key) Recomputes the position for the given attachedAnchorKeyby delegating to the respectiveIComputationStrategy.Returns the reference position of thisStaticAnchor.javafx.beans.property.ObjectProperty<Point>Returns theObjectPropertythat manages the reference position of thisStaticAnchor.voidsetReferencePosition(Point referencePosition) Sets the reference position of thisStaticAnchorto the given value.toString()Methods inherited from class org.eclipse.gef.fx.anchors.AbstractAnchor
anchorageProperty, attach, detach, getAnchorage, getKeys, getKeysByNode, getPosition, getPositionsUnmodifiable, isAttached, positionsUnmodifiableProperty, registerVCL, registerVCLs, setAnchorage, unregisterVCL, unregisterVCLs, updatePosition, updatePositions
-
Property Details
-
referencePosition
Returns theObjectPropertythat manages the reference position of thisStaticAnchor.
-
-
Constructor Details
-
StaticAnchor
Creates anStaticAnchorthat is bound to the provided anchorage. It will used the passed in reference position (in the local coordinate system of the anchorageNode) to compute positions (seeAbstractAnchor.positionsUnmodifiableProperty()) for all attachedAnchorKeys (in the local coordinate system of the attachedAnchorKey'sNode).In case the anchorage
Nodeor any of its ancestors are changed in a way that will affect the position, theAbstractAnchor.positionsUnmodifiableProperty()will be updated.- Parameters:
anchorage- The anchorageNodeto bind thisStaticAnchorto.referencePositionInAnchorageLocal- The position within the local coordinate space of the anchorageNode, which is used to compute the position (in scene coordinates) for all attachedAnchorKeys.
-
StaticAnchor
Creates anStaticAnchorthat is not bound to an anchorageNodeand will always provide the passed in position (in scene coordinates) for all attachedAnchorKeys (i.e. anchoredNodes).- Parameters:
referencePositionInScene- The position in scene coordinates to be provided for all attachedAnchorKeys.
-
-
Method Details
-
computePosition
Description copied from class:AbstractAnchorRecomputes the position for the given attachedAnchorKeyby delegating to the respectiveIComputationStrategy.- Specified by:
computePositionin classAbstractAnchor- Parameters:
key- TheAnchorKeyfor which to compute an anchor position.- Returns:
- The point for the given
AnchorKeyin local coordinates of the anchoredNode.
-
getReferencePosition
Returns the reference position of thisStaticAnchor.- Returns:
- The reference position of this
StaticAnchor.
-
referencePositionProperty
Returns theObjectPropertythat manages the reference position of thisStaticAnchor. -
setReferencePosition
Sets the reference position of thisStaticAnchorto the given value.- Parameters:
referencePosition- The new reference position for thisStaticAnchor.
-
toString
-