Package org.eclipse.gef.mvc.fx.providers
Class DefaultAnchorProvider
java.lang.Object
org.eclipse.gef.common.adapt.IAdaptable.Bound.Impl<IVisualPart<? extends Node>>
org.eclipse.gef.mvc.fx.providers.DefaultAnchorProvider
- All Implemented Interfaces:
IAdaptable.Bound<IVisualPart<? extends Node>>
,IAnchorProvider
public class DefaultAnchorProvider
extends IAdaptable.Bound.Impl<IVisualPart<? extends Node>>
implements IAnchorProvider
The
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.-
Property Summary
Properties inherited from class org.eclipse.gef.common.adapt.IAdaptable.Bound.Impl
adaptable
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.eclipse.gef.common.adapt.IAdaptable.Bound
IAdaptable.Bound.Impl<T extends IAdaptable>
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected IGeometry
Returns theDynamicAnchor.AnchorageReferenceGeometry
that is to be used for the givenDynamicAnchor
.protected DynamicAnchor
createDynamicAnchor
(IComputationStrategy strategy) Creates a newDynamicAnchor
using the visual of theIAdaptable.Bound.Impl.getAdaptable()
as its anchorage and passing-in the givenIComputationStrategy
.get
(IVisualPart<? extends Node> anchoredPart, String role) Returns anIAnchor
that should be used to provide a position for the given anchoredIVisualPart
and the given role.protected IAnchor
Returns theIAnchor
that is to be used when no other, more specific anchor is used.protected IAnchor
Returns theIAnchor
that is to be used for orthogonalConnection
s.protected void
Initializes the computation parameters for the givenDynamicAnchor
.Methods inherited from class org.eclipse.gef.common.adapt.IAdaptable.Bound.Impl
adaptableProperty, getAdaptable, setAdaptable
-
Constructor Details
-
DefaultAnchorProvider
public DefaultAnchorProvider()Constructs a new instance ofDefaultAnchorProvider
.
-
-
Method Details
-
computeAnchorageReferenceGeometry
Returns theDynamicAnchor.AnchorageReferenceGeometry
that is to be used for the givenDynamicAnchor
.- Parameters:
anchor
- TheDynamicAnchor
for which to compute theDynamicAnchor.AnchorageReferenceGeometry
.- Returns:
- The
DynamicAnchor.AnchorageReferenceGeometry
that is to be used for the givenDynamicAnchor
.
-
createDynamicAnchor
Creates a newDynamicAnchor
using the visual of theIAdaptable.Bound.Impl.getAdaptable()
as its anchorage and passing-in the givenIComputationStrategy
. Also sets up the computation parameters for the newly constructed anchor usinginitializeComputationParameters(DynamicAnchor)
.- Parameters:
strategy
- TheIComputationStrategy
to use.- Returns:
- The newly constructed and set up
DynamicAnchor
.
-
get
Description copied from interface:IAnchorProvider
Returns anIAnchor
that should be used to provide a position for the given anchoredIVisualPart
and the given role.- Specified by:
get
in interfaceIAnchorProvider
- Parameters:
anchoredPart
- The anchoredIVisualPart
which the returnedIAnchor
should provide a position for.role
- The role which the returnedIAnchor
should provide a position for.- Returns:
- An
IAnchor
that should be used to provide a position for the given anchoredIVisualPart
and the given role.
-
getDefaultAnchor
Returns theIAnchor
that is to be used when no other, more specific anchor is used.- Returns:
- The
IAnchor
that is to be used when no other, more specific anchor is used.
-
getOrthogonalAnchor
Returns theIAnchor
that is to be used for orthogonalConnection
s.- Returns:
- The
IAnchor
that is to be used for orthogonalConnection
s
-
initializeComputationParameters
Initializes the computation parameters for the givenDynamicAnchor
.- Parameters:
anchor
- TheDynamicAnchor
for which to initialize computation parameters.
-