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
public class StaticAnchor extends AbstractAnchor
AnStaticAnchorprovides a position for eachAnchorKey, based on a reference position relative to the anchorageNode, to which theStaticAnchoris bound, or based on a (global) static reference position in case theStaticAnchoris unbound.
-
-
Constructor Summary
Constructors Constructor Description StaticAnchor(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
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected PointcomputePosition(AnchorKey key)Recomputes the position for the given attachedAnchorKeyby delegating to the respectiveIComputationStrategy.PointgetReferencePosition()Returns the reference position of thisStaticAnchor.javafx.beans.property.ObjectProperty<Point>referencePositionProperty()Returns theObjectPropertythat manages the reference position of thisStaticAnchor.voidsetReferencePosition(Point referencePosition)Sets the reference position of thisStaticAnchorto the given value.java.lang.StringtoString()-
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
-
-
-
-
Constructor Detail
-
StaticAnchor
public StaticAnchor(javafx.scene.Node anchorage, Point referencePositionInAnchorageLocal)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
public 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).- Parameters:
referencePositionInScene- The position in scene coordinates to be provided for all attachedAnchorKeys.
-
-
Method Detail
-
computePosition
protected Point computePosition(AnchorKey key)
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
public Point getReferencePosition()
Returns the reference position of thisStaticAnchor.- Returns:
- The reference position of this
StaticAnchor.
-
referencePositionProperty
public javafx.beans.property.ObjectProperty<Point> referencePositionProperty()
Returns theObjectPropertythat manages the reference position of thisStaticAnchor.- Returns:
- The
ObjectPropertythat manages the reference position of thisStaticAnchor.
-
setReferencePosition
public void setReferencePosition(Point referencePosition)
Sets the reference position of thisStaticAnchorto the given value.- Parameters:
referencePosition- The new reference position for thisStaticAnchor.
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-