Package org.eclipse.gef.fx.anchors
Class ChopBoxStrategy
- java.lang.Object
-
- org.eclipse.gef.fx.anchors.ProjectionStrategy
-
- org.eclipse.gef.fx.anchors.ChopBoxStrategy
-
- All Implemented Interfaces:
IComputationStrategy
public class ChopBoxStrategy extends ProjectionStrategy
A specific projection strategy that is based on a center-projection of the given reference point.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.eclipse.gef.fx.anchors.IComputationStrategy
IComputationStrategy.Parameter<T>
-
-
Constructor Summary
Constructors Constructor Description ChopBoxStrategy()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected PointcomputeAnchorageReferencePointInLocal(javafx.scene.Node anchorage, IGeometry geometryInLocal, Point anchoredReferencePointInAnchorageLocal)Computes the anchorage reference position within the coordinate system of the givenIGeometry.protected PointcomputeAnchorageReferencePointInScene(javafx.scene.Node anchorage, IGeometry geometryInLocal, Point anchoredReferencePointInScene)Computes the anchorage reference position in scene coordinates, based on the given anchorage geometry.PointcomputePositionInScene(javafx.scene.Node anchorage, javafx.scene.Node anchored, java.util.Set<IComputationStrategy.Parameter<?>> parameters)Computes an anchor position based on the given anchorage visual, anchored visual, and anchored reference point.-
Methods inherited from class org.eclipse.gef.fx.anchors.ProjectionStrategy
computeProjectionInScene, getOutlineSegments, getRequiredParameters
-
-
-
-
Method Detail
-
computeAnchorageReferencePointInLocal
protected Point computeAnchorageReferencePointInLocal(javafx.scene.Node anchorage, IGeometry geometryInLocal, Point anchoredReferencePointInAnchorageLocal)
Computes the anchorage reference position within the coordinate system of the givenIGeometry. Will return the center of aIShapeorPathgeometry, if it is contained within the shape or path. Will returnnullotherwise to indicate that the computation should fall back to the nearest projection on the anchorage geometry outline.- Parameters:
anchorage- The anchorage visual.geometryInLocal- The anchorage geometry within the local coordinate system of the anchorage visual.anchoredReferencePointInAnchorageLocal- Reference point of the anchored for which to determine the anchorage reference point. Within the local coordinate system of the anchorage.- Returns:
- A position within the given
IGeometry, ornullif the computation should rather fall back to the nearest projection.
-
computeAnchorageReferencePointInScene
protected Point computeAnchorageReferencePointInScene(javafx.scene.Node anchorage, IGeometry geometryInLocal, Point anchoredReferencePointInScene)
Computes the anchorage reference position in scene coordinates, based on the given anchorage geometry.- Parameters:
anchorage- The anchorage visual.geometryInLocal- The anchorage geometry within the coordinate system of the anchorage visual.anchoredReferencePointInScene- The referencePointof the anchored for which the anchorage referencePointis to be determined.- Returns:
- The anchorage reference position in scene coordinates or
nullif the computation should rather fall back to the nearest projection. - See Also:
computeAnchorageReferencePointInLocal(Node, IGeometry, Point)
-
computePositionInScene
public Point computePositionInScene(javafx.scene.Node anchorage, javafx.scene.Node anchored, java.util.Set<IComputationStrategy.Parameter<?>> parameters)
Description copied from interface:IComputationStrategyComputes an anchor position based on the given anchorage visual, anchored visual, and anchored reference point.- Specified by:
computePositionInScenein interfaceIComputationStrategy- Overrides:
computePositionInScenein classProjectionStrategy- Parameters:
anchorage- The anchorage visual.anchored- The anchored visual.parameters- The available computation parameters. strategy.- Returns:
- The anchor position.
-
-