public class DynamicAnchor extends AbstractAnchor
DynamicAnchor computes anchor positions through a
IComputationStrategy. The strategy performs the position calculation
based on IComputationStrategy.Parameters, which are controlled by the
DynamicAnchor.| Type | Property and Description |
|---|---|
protected ReadOnlySetProperty<IComputationStrategy.Parameter<?>> |
anchorageComputationParameters
Returns a
ReadOnlySetProperty that provides the
computation parameters of kind
IComputationStrategy.Parameter.Kind.ANCHORAGE. |
protected ReadOnlySetMultimapProperty<AnchorKey,IComputationStrategy.Parameter<?>> |
anchoredComputationParameters
Returns a
ReadOnlySetMultimapProperty that provides the
computation parameters of kind
IComputationStrategy.Parameter.Kind.ANCHORED per AnchorKey. |
anchorage, positionsUnmodifiable| Modifier and Type | Class and Description |
|---|---|
static class |
DynamicAnchor.AnchorageReferenceGeometry
An
IComputationStrategy.Parameter that encapsulates an
(anchorage) reference geometry. |
static class |
DynamicAnchor.AnchorageReferencePosition
An
IComputationStrategy.Parameter that encapsulates an
(anchorage) reference point. |
static class |
DynamicAnchor.AnchoredReferencePoint
An
IComputationStrategy.Parameter that encapsulates a projection
reference point. |
static class |
DynamicAnchor.PreferredOrientation
An
IComputationStrategy.Parameter that encapsulates the preferred
orientation to be used for orthogonal projections. |
| Constructor and Description |
|---|
DynamicAnchor(Node anchorage)
Constructs a new
DynamicAnchor for the given anchorage visual
that uses a ChopBoxStrategy as computation strategy. |
DynamicAnchor(Node anchorage,
IComputationStrategy computationStrategy)
Constructs a new
DynamicAnchor for the given anchorage visual
using the given IComputationStrategy. |
anchorageProperty, getAnchorage, getKeys, getKeysByNode, getPosition, getPositionsUnmodifiable, isAttached, positionsUnmodifiableProperty, registerVCL, registerVCLs, setAnchorage, unregisterVCL, unregisterVCLs, updatePosition, updatePositionsprotected ReadOnlySetProperty<IComputationStrategy.Parameter<?>> anchorageComputationParametersProperty
ReadOnlySetProperty that provides the
computation parameters of kind
IComputationStrategy.Parameter.Kind.ANCHORAGE.protected ReadOnlySetMultimapProperty<AnchorKey,IComputationStrategy.Parameter<?>> anchoredComputationParametersProperty
ReadOnlySetMultimapProperty that provides the
computation parameters of kind
IComputationStrategy.Parameter.Kind.ANCHORED per AnchorKey. The set of computation
parameters for each AnchorKey is initialed by the responsible
computation strategy.public DynamicAnchor(Node anchorage)
DynamicAnchor for the given anchorage visual
that uses a ChopBoxStrategy as computation strategy. The anchor
will also add a default binding for the
DynamicAnchor.AnchorageReferenceGeometry computation parameter, which is
required by the ChopBoxStrategy, that infers the geometry from
the anchorage's shape outline.anchorage - The anchorage visual.public DynamicAnchor(Node anchorage, IComputationStrategy computationStrategy)
DynamicAnchor for the given anchorage visual
using the given IComputationStrategy. The anchor will also add a
default binding for the DynamicAnchor.AnchorageReferenceGeometry computation
parameter, inferring the geometry from the anchorage's shape outline, in
case this parameter is required by the given
IComputationStrategy.anchorage - The anchorage visual.computationStrategy - The IComputationStrategy to use.protected ReadOnlySetProperty<IComputationStrategy.Parameter<?>> anchorageComputationParametersProperty()
ReadOnlySetProperty that provides the
computation parameters of kind
IComputationStrategy.Parameter.Kind.ANCHORAGE.protected ReadOnlySetMultimapProperty<AnchorKey,IComputationStrategy.Parameter<?>> anchoredComputationParametersProperty()
ReadOnlySetMultimapProperty that provides the
computation parameters of kind
IComputationStrategy.Parameter.Kind.ANCHORED per AnchorKey. The set of computation
parameters for each AnchorKey is initialed by the responsible
computation strategy.public void attach(AnchorKey key)
IAnchorattach in interface IAnchorattach in class AbstractAnchorkey - The AnchorKey to be attached.protected Point computePosition(AnchorKey key)
AnchorKey by
delegating to the respective IComputationStrategy.computePosition in class AbstractAnchorkey - The AnchorKey for which to compute an anchor position.AnchorKey in local coordinates of
the anchored Node.public void detach(AnchorKey key)
IAnchordetach in interface IAnchordetach in class AbstractAnchorkey - The AnchorKey to be detached.public <T extends IComputationStrategy.Parameter<?>> T getComputationParameter(AnchorKey key, Class<T> parameterType)
AnchorKey.T - The value type of the computation parameter.key - The AnchorKey for which to retrieve the anchored
parameter.parameterType - The type of computation parameter.public <T extends IComputationStrategy.Parameter<?>> T getComputationParameter(Class<T> parameterType)
T - The value type of the computation parameter.parameterType - The type of computation parameter.public IComputationStrategy getComputationStrategy()
IComputationStrategy used by this
DynamicAnchor.IComputationStrategy.protected Set<IComputationStrategy.Parameter<?>> getParameters(AnchorKey key)
AnchorKey.public void setComputationStrategy(IComputationStrategy computationStrategy)
IComputationStrategy to be used by this
IAnchor.computationStrategy - The IComputationStrategy that will be used to compute
positions for all attached AnchorKeys.Copyright (c) 2014, 2016 itemis AG and others. All rights reserved.