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
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
-
Method Summary
Modifier and TypeMethodDescriptionprotected Point
computeAnchorageReferencePointInLocal
(javafx.scene.Node anchorage, IGeometry geometryInLocal, Point anchoredReferencePointInAnchorageLocal) Computes the anchorage reference position within the coordinate system of the givenIGeometry
.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.computePositionInScene
(javafx.scene.Node anchorage, javafx.scene.Node anchored, 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
-
Constructor Details
-
ChopBoxStrategy
public ChopBoxStrategy()
-
-
Method Details
-
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 aIShape
orPath
geometry, if it is contained within the shape or path. Will returnnull
otherwise 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
, ornull
if 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 referencePoint
of the anchored for which the anchorage referencePoint
is to be determined.- Returns:
- The anchorage reference position in scene coordinates or
null
if the computation should rather fall back to the nearest projection. - See Also:
-
computePositionInScene
public Point computePositionInScene(javafx.scene.Node anchorage, javafx.scene.Node anchored, Set<IComputationStrategy.Parameter<?>> parameters) Description copied from interface:IComputationStrategy
Computes an anchor position based on the given anchorage visual, anchored visual, and anchored reference point.- Specified by:
computePositionInScene
in interfaceIComputationStrategy
- Overrides:
computePositionInScene
in classProjectionStrategy
- Parameters:
anchorage
- The anchorage visual.anchored
- The anchored visual.parameters
- The available computation parameters. strategy.- Returns:
- The anchor position.
-