Package org.eclipse.gef.mvc.fx.providers
Class DefaultAnchorProvider
- java.lang.Object
-
- org.eclipse.gef.common.adapt.IAdaptable.Bound.Impl<IVisualPart<? extends javafx.scene.Node>>
-
- org.eclipse.gef.mvc.fx.providers.DefaultAnchorProvider
-
- All Implemented Interfaces:
IAdaptable.Bound<IVisualPart<? extends javafx.scene.Node>>
,IAnchorProvider
public class DefaultAnchorProvider extends IAdaptable.Bound.Impl<IVisualPart<? extends javafx.scene.Node>> implements IAnchorProvider
TheDefaultAnchorProvider
can be used to provideDynamicAnchor
s for anchoredIVisualPart
s depending on their visual. ForConnection
visuals with anOrthogonalRouter
, aDynamicAnchor
with anOrthogonalProjectionStrategy
is used. Otherwise, aDynamicAnchor
with aChopBoxStrategy
is used.
-
-
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 Constructor Description DefaultAnchorProvider()
Constructs a new instance ofDefaultAnchorProvider
.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected IGeometry
computeAnchorageReferenceGeometry(DynamicAnchor anchor)
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
.IAnchor
get(IVisualPart<? extends javafx.scene.Node> anchoredPart, java.lang.String role)
Returns anIAnchor
that should be used to provide a position for the given anchoredIVisualPart
and the given role.protected IAnchor
getDefaultAnchor()
Returns theIAnchor
that is to be used when no other, more specific anchor is used.protected IAnchor
getOrthogonalAnchor()
Returns theIAnchor
that is to be used for orthogonalConnection
s.protected void
initializeComputationParameters(DynamicAnchor anchor)
Initializes the computation parameters for the givenDynamicAnchor
.-
Methods inherited from class org.eclipse.gef.common.adapt.IAdaptable.Bound.Impl
adaptableProperty, getAdaptable, setAdaptable
-
-
-
-
Constructor Detail
-
DefaultAnchorProvider
public DefaultAnchorProvider()
Constructs a new instance ofDefaultAnchorProvider
.
-
-
Method Detail
-
computeAnchorageReferenceGeometry
protected IGeometry computeAnchorageReferenceGeometry(DynamicAnchor anchor)
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
protected DynamicAnchor createDynamicAnchor(IComputationStrategy strategy)
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
public IAnchor get(IVisualPart<? extends javafx.scene.Node> anchoredPart, java.lang.String role)
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
protected IAnchor 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
protected IAnchor getOrthogonalAnchor()
Returns theIAnchor
that is to be used for orthogonalConnection
s.- Returns:
- The
IAnchor
that is to be used for orthogonalConnection
s
-
initializeComputationParameters
protected void initializeComputationParameters(DynamicAnchor anchor)
Initializes the computation parameters for the givenDynamicAnchor
.- Parameters:
anchor
- TheDynamicAnchor
for which to initialize computation parameters.
-
-