public class DefaultAnchorProvider extends IAdaptable.Bound.Impl<IVisualPart<? extends javafx.scene.Node>> implements IAnchorProvider
DefaultAnchorProvider
can be used to provide
DynamicAnchor
s for anchored IVisualPart
s depending on their
visual. For Connection
visuals with an OrthogonalRouter
, a
DynamicAnchor
with an OrthogonalProjectionStrategy
is used.
Otherwise, a DynamicAnchor
with a ChopBoxStrategy
is used.adaptable
IAdaptable.Bound.Impl<T extends IAdaptable>
Constructor and Description |
---|
DefaultAnchorProvider()
Constructs a new instance of
DefaultAnchorProvider . |
Modifier and Type | Method and Description |
---|---|
protected IGeometry |
computeAnchorageReferenceGeometry(DynamicAnchor anchor)
Returns the
DynamicAnchor.AnchorageReferenceGeometry that is to be used for the
given DynamicAnchor . |
protected DynamicAnchor |
createDynamicAnchor(IComputationStrategy strategy)
Creates a new
DynamicAnchor using the visual of the
IAdaptable.Bound.Impl.getAdaptable() as its anchorage and passing-in the given
IComputationStrategy . |
IAnchor |
get(IVisualPart<? extends javafx.scene.Node> anchoredPart,
java.lang.String role)
Returns an
IAnchor that should be used to provide a position for
the given anchored IVisualPart and the given role. |
protected IAnchor |
getDefaultAnchor()
Returns the
IAnchor that is to be used when no other, more
specific anchor is used. |
protected IAnchor |
getOrthogonalAnchor()
Returns the
IAnchor that is to be used for orthogonal
Connection s. |
protected void |
initializeComputationParameters(DynamicAnchor anchor)
Initializes the computation parameters for the given
DynamicAnchor . |
adaptableProperty, getAdaptable, setAdaptable
public DefaultAnchorProvider()
DefaultAnchorProvider
.protected IGeometry computeAnchorageReferenceGeometry(DynamicAnchor anchor)
DynamicAnchor.AnchorageReferenceGeometry
that is to be used for the
given DynamicAnchor
.anchor
- The DynamicAnchor
for which to compute the
DynamicAnchor.AnchorageReferenceGeometry
.DynamicAnchor.AnchorageReferenceGeometry
that is to be used for the
given DynamicAnchor
.protected DynamicAnchor createDynamicAnchor(IComputationStrategy strategy)
DynamicAnchor
using the visual of the
IAdaptable.Bound.Impl.getAdaptable()
as its anchorage and passing-in the given
IComputationStrategy
. Also sets up the computation parameters for
the newly constructed anchor using
initializeComputationParameters(DynamicAnchor)
.strategy
- The IComputationStrategy
to use.DynamicAnchor
.public IAnchor get(IVisualPart<? extends javafx.scene.Node> anchoredPart, java.lang.String role)
IAnchorProvider
IAnchor
that should be used to provide a position for
the given anchored IVisualPart
and the given role.get
in interface IAnchorProvider
anchoredPart
- The anchored IVisualPart
which the returned
IAnchor
should provide a position for.role
- The role which the returned IAnchor
should provide a
position for.IAnchor
that should be used to provide a position for
the given anchored IVisualPart
and the given role.protected IAnchor getDefaultAnchor()
IAnchor
that is to be used when no other, more
specific anchor is used.IAnchor
that is to be used when no other, more
specific anchor is used.protected IAnchor getOrthogonalAnchor()
IAnchor
that is to be used for orthogonal
Connection
s.IAnchor
that is to be used for orthogonal
Connection
sprotected void initializeComputationParameters(DynamicAnchor anchor)
DynamicAnchor
.anchor
- The DynamicAnchor
for which to initialize computation
parameters.Copyright (c) 2014, 2016 itemis AG and others. All rights reserved.