Package org.eclipse.gef.fx.anchors
Interface IAnchor
-
- All Known Implementing Classes:
AbstractAnchor
,AbstractRouter.VolatileStaticAnchor
,DynamicAnchor
,StaticAnchor
public interface IAnchor
AnIAnchor
is a visual anchor that will provide positions for attachedAnchorKey
s (i.e. anchoredNode
s) in local coordinates of theAnchorKey
's anchoredNode
.The position for each attached
Node
will be recomputed in case the attachedNode
or 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
IAnchor
may be bound to an anchorageNode
. If this is the case, positions for all attachedNode
s will also be recomputed in case the anchorageNode
or 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 anchorageNode
thisIAnchor
is bound to.void
attach(AnchorKey key)
void
detach(AnchorKey key)
javafx.scene.Node
getAnchorage()
Provides the anchorageNode
thisIAnchor
is bound to.Point
getPosition(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 anchoredNode
s) for all attachedAnchorKey
s.boolean
isAttached(AnchorKey key)
javafx.beans.property.ReadOnlyMapProperty<AnchorKey,Point>
positionsUnmodifiableProperty()
Provides a read-only (map) property with positions (in local coordinates of the anchoredNode
s) for all attachedAnchorKey
s.
-
-
-
Method Detail
-
anchorageProperty
javafx.beans.property.ReadOnlyObjectProperty<javafx.scene.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
.- Returns:
- A read-only property storing the anchorage
Node
.
-
getAnchorage
javafx.scene.Node getAnchorage()
Provides the anchorageNode
thisIAnchor
is 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 providedAnchorKey
has to be attached to thisIAnchor
(seeattach(AnchorKey)
).- Parameters:
key
- TheAnchorKey
to retrieve a position for. It has to be attached (attach(AnchorKey)
) to thisIAnchor
before.- Returns:
- The position for the given
AnchorKey
within 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 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
boolean isAttached(AnchorKey key)
- Parameters:
key
- TheAnchorKey
to test.- Returns:
true
if 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 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 (map) property storing positions for all attached
AnchorKey
s.
-
-