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
TheDefaultAnchorProvidercan be used to provideDynamicAnchors for anchoredIVisualParts depending on their visual. ForConnectionvisuals with anOrthogonalRouter, aDynamicAnchorwith anOrthogonalProjectionStrategyis used. Otherwise, aDynamicAnchorwith aChopBoxStrategyis 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 IGeometrycomputeAnchorageReferenceGeometry(DynamicAnchor anchor)Returns theDynamicAnchor.AnchorageReferenceGeometrythat is to be used for the givenDynamicAnchor.protected DynamicAnchorcreateDynamicAnchor(IComputationStrategy strategy)Creates a newDynamicAnchorusing the visual of theIAdaptable.Bound.Impl.getAdaptable()as its anchorage and passing-in the givenIComputationStrategy.IAnchorget(IVisualPart<? extends javafx.scene.Node> anchoredPart, java.lang.String role)Returns anIAnchorthat should be used to provide a position for the given anchoredIVisualPartand the given role.protected IAnchorgetDefaultAnchor()Returns theIAnchorthat is to be used when no other, more specific anchor is used.protected IAnchorgetOrthogonalAnchor()Returns theIAnchorthat is to be used for orthogonalConnections.protected voidinitializeComputationParameters(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.AnchorageReferenceGeometrythat is to be used for the givenDynamicAnchor.- Parameters:
anchor- TheDynamicAnchorfor which to compute theDynamicAnchor.AnchorageReferenceGeometry.- Returns:
- The
DynamicAnchor.AnchorageReferenceGeometrythat is to be used for the givenDynamicAnchor.
-
createDynamicAnchor
protected DynamicAnchor createDynamicAnchor(IComputationStrategy strategy)
Creates a newDynamicAnchorusing 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- TheIComputationStrategyto 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:IAnchorProviderReturns anIAnchorthat should be used to provide a position for the given anchoredIVisualPartand the given role.- Specified by:
getin interfaceIAnchorProvider- Parameters:
anchoredPart- The anchoredIVisualPartwhich the returnedIAnchorshould provide a position for.role- The role which the returnedIAnchorshould provide a position for.- Returns:
- An
IAnchorthat should be used to provide a position for the given anchoredIVisualPartand the given role.
-
getDefaultAnchor
protected IAnchor getDefaultAnchor()
Returns theIAnchorthat is to be used when no other, more specific anchor is used.- Returns:
- The
IAnchorthat is to be used when no other, more specific anchor is used.
-
getOrthogonalAnchor
protected IAnchor getOrthogonalAnchor()
Returns theIAnchorthat is to be used for orthogonalConnections.- Returns:
- The
IAnchorthat is to be used for orthogonalConnections
-
initializeComputationParameters
protected void initializeComputationParameters(DynamicAnchor anchor)
Initializes the computation parameters for the givenDynamicAnchor.- Parameters:
anchor- TheDynamicAnchorfor which to initialize computation parameters.
-
-