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
TypePropertyDescriptionReturns theObjectProperty
that manages the reference position of thisStaticAnchor
.Properties inherited from class org.eclipse.gef.fx.anchors.AbstractAnchor
anchorage, positionsUnmodifiable
-
Constructor Summary
ConstructorDescriptionStaticAnchor
(Node anchorage, Point referencePositionInAnchorageLocal) Creates anStaticAnchor
that is bound to the provided anchorage.StaticAnchor
(Point referencePositionInScene) Creates anStaticAnchor
that is not bound to an anchorageNode
and will always provide the passed in position (in scene coordinates) for all attachedAnchorKey
s (i.e. anchoredNode
s). -
Method Summary
Modifier and TypeMethodDescriptionprotected Point
computePosition
(AnchorKey key) Recomputes the position for the given attachedAnchorKey
by delegating to the respectiveIComputationStrategy
.Returns the reference position of thisStaticAnchor
.Returns theObjectProperty
that manages the reference position of thisStaticAnchor
.void
setReferencePosition
(Point referencePosition) Sets the reference position of thisStaticAnchor
to 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 theObjectProperty
that manages the reference position of thisStaticAnchor
.
-
-
Constructor Details
-
StaticAnchor
Creates anStaticAnchor
that 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 attachedAnchorKey
s (in the local coordinate system of the attachedAnchorKey
'sNode
).In case the anchorage
Node
or any of its ancestors are changed in a way that will affect the position, theAbstractAnchor.positionsUnmodifiableProperty()
will be updated.- Parameters:
anchorage
- The anchorageNode
to bind thisStaticAnchor
to.referencePositionInAnchorageLocal
- The position within the local coordinate space of the anchorageNode
, which is used to compute the position (in scene coordinates) for all attachedAnchorKey
s.
-
StaticAnchor
Creates anStaticAnchor
that is not bound to an anchorageNode
and will always provide the passed in position (in scene coordinates) for all attachedAnchorKey
s (i.e. anchoredNode
s).- Parameters:
referencePositionInScene
- The position in scene coordinates to be provided for all attachedAnchorKey
s.
-
-
Method Details
-
computePosition
Description copied from class:AbstractAnchor
Recomputes the position for the given attachedAnchorKey
by delegating to the respectiveIComputationStrategy
.- Specified by:
computePosition
in classAbstractAnchor
- Parameters:
key
- TheAnchorKey
for which to compute an anchor position.- Returns:
- The point for the given
AnchorKey
in local coordinates of the anchoredNode
.
-
getReferencePosition
Returns the reference position of thisStaticAnchor
.- Returns:
- The reference position of this
StaticAnchor
.
-
referencePositionProperty
Returns theObjectProperty
that manages the reference position of thisStaticAnchor
. -
setReferencePosition
Sets the reference position of thisStaticAnchor
to the given value.- Parameters:
referencePosition
- The new reference position for thisStaticAnchor
.
-
toString
-