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
The
DefaultAnchorProvider can be used to provide
DynamicAnchors for anchored IVisualParts 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 IGeometryReturns 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.get(IVisualPart<? extends javafx.scene.Node> anchoredPart, String role) Returns anIAnchorthat should be used to provide a position for the given anchoredIVisualPartand the given role.protected IAnchorReturns theIAnchorthat is to be used when no other, more specific anchor is used.protected IAnchorReturns theIAnchorthat is to be used for orthogonalConnections.protected voidInitializes 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.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
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
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
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
Returns theIAnchorthat is to be used for orthogonalConnections.- Returns:
- The
IAnchorthat is to be used for orthogonalConnections
-
initializeComputationParameters
Initializes the computation parameters for the givenDynamicAnchor.- Parameters:
anchor- TheDynamicAnchorfor which to initialize computation parameters.
-