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 AnchorKey
s (i.e. anchored Node
s) 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 Node
s 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
TypePropertyDescription -
Method Summary
Modifier and TypeMethodDescriptionvoid
void
getPosition
(AnchorKey key) Provides a position for the givenAnchorKey
.boolean
isAttached
(AnchorKey key)
-
Property Details
-
anchorage
ReadOnlyObjectProperty<Node> anchoragePropertyProvides a read-only property with the anchorageNode
thisIAnchor
is bound to. The property value may benull
in case thisIAnchor
is not bound to an anchorageNode
.- See Also:
-
positionsUnmodifiable
ReadOnlyMapProperty<AnchorKey,Point> positionsUnmodifiablePropertyProvides a read-only (map) property with positions (in local coordinates of the anchoredNode
s) for all attachedAnchorKey
s. The positions will be updated for all attachedAnchorKey
s if the attachedNode
s or the anchorageNode
, theIAnchor
is bound to, or any of their ancestors changes in a way that will effect the positions (within the local coordinate space of the attachedNode
s).- See Also:
-
-
Method Details
-
anchorageProperty
ReadOnlyObjectProperty<Node> anchorageProperty()Provides a read-only property with the anchorageNode
thisIAnchor
is bound to. The property value may benull
in case thisIAnchor
is not bound to an anchorageNode
.- See Also:
-
attach
- Parameters:
key
- TheAnchorKey
to be attached.
-
detach
- Parameters:
key
- TheAnchorKey
to be detached.
-
getAnchorage
Node getAnchorage()Provides the anchorageNode
thisIAnchor
is bound to. Will return the value of theanchorageProperty()
.- Returns:
- The value of the
anchorageProperty()
.
-
getPosition
Provides a position for the givenAnchorKey
. The providedAnchorKey
has 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 anchoredNode
s) for all attachedAnchorKey
s. The positions will be updated for all attachedAnchorKey
s if the attachedNode
s or the anchorageNode
, theIAnchor
is bound to, or any of their ancestors changes in a way that will effect the positions (within the local coordinate space of the attachedNode
s).- Returns:
- A read-only observable map storing positions for all attached
AnchorKey
s.
-
isAttached
- Parameters:
key
- TheAnchorKey
to test.- Returns:
true
if the given key is attached, otherwisefalse
.
-
positionsUnmodifiableProperty
ReadOnlyMapProperty<AnchorKey,Point> positionsUnmodifiableProperty()Provides a read-only (map) property with positions (in local coordinates of the anchoredNode
s) for all attachedAnchorKey
s. The positions will be updated for all attachedAnchorKey
s if the attachedNode
s or the anchorageNode
, theIAnchor
is bound to, or any of their ancestors changes in a way that will effect the positions (within the local coordinate space of the attachedNode
s).- See Also:
-