public static class DynamicAnchor.ProjectionStrategy extends DynamicAnchor.AbstractComputationStrategy
DynamicAnchor.IComputationStrategy
that computes anchor position by
projecting the respective anchored reference point to the outline of the
anchorage reference geometry so that the respective point has minimal
distance to the anchored reference point.
In detail, the computation is done as follows:
DynamicAnchor.AbstractComputationStrategy.getAnchorageReferenceGeometryInLocal(Node)
).computeAnchorageReferencePointInLocal(Node, IGeometry, Point)
).
computeAnchorageReferencePointInScene(Node, IGeometry, Point)
).
DynamicAnchor.AbstractComputationStrategy.getOutlineSegments(IGeometry)
).Constructor and Description |
---|
ProjectionStrategy() |
Modifier and Type | Method and Description |
---|---|
Point |
computeAnchorageReferencePointInLocal(javafx.scene.Node anchorage,
IGeometry geometryInLocal,
Point anchoredReferencePointInAnchorageLocal)
Computes the anchorage reference position within the coordinate
system of the given
IGeometry . |
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.
|
Point |
computePositionInScene(javafx.scene.Node anchorage,
javafx.scene.Node anchored,
Point anchoredReferencePointInLocal)
Computes an anchor position based on the given anchorage visual,
anchored visual, and anchored reference point.
|
protected Point |
getNearestVertex(Point boundsCenter,
ICurve curve)
|
protected Point |
getNearestVertex(Point boundsCenter,
IShape shape)
|
protected Point |
getNearestVertex(Point boundsCenter,
Path path)
|
getAnchorageReferenceGeometryInLocal, getAnchorageReferenceGeometryInScene, getOutlineGeometry, getOutlineSegments
public Point computeAnchorageReferencePointInLocal(javafx.scene.Node anchorage, IGeometry geometryInLocal, Point anchoredReferencePointInAnchorageLocal)
IGeometry
. For an IShape
geometry, the center is used if it is contained within the shape,
otherwise, the vertex nearest to the center is used as the reference
position. For an ICurve
geometry, the first point is used as
the reference position.anchorage
- The anchorage visual.geometryInLocal
- The anchorage geometry within the local coordinate system
of the anchorage visual.anchoredReferencePointInAnchorageLocal
- Refernce point of the anchored for which to determine the
anchorage reference point. Within the local coordinate
system of the anchorage.IGeometry
.protected Point computeAnchorageReferencePointInScene(javafx.scene.Node anchorage, IGeometry geometryInLocal, Point anchoredReferencePointInScene)
anchorage
- The anchorage visual.geometryInLocal
- The anchorage geometry within the coordinate system of the
anchorage visual.anchoredReferencePointInScene
- The reference Point
of the anchored for which the
anchorage reference Point
is to be determined.computeAnchorageReferencePointInLocal(Node, IGeometry, Point)
public Point computePositionInScene(javafx.scene.Node anchorage, javafx.scene.Node anchored, Point anchoredReferencePointInLocal)
DynamicAnchor.IComputationStrategy
anchorage
- The anchorage visual.anchored
- The anchored visual.anchoredReferencePointInLocal
- The anchored reference point within the local coordinate
system of the anchored visual.protected Point getNearestVertex(Point boundsCenter, ICurve curve)
ICurve
which is nearest to
the given center Point
. The vertices for the ICurve
are computed via its bezier curve approximation. For all
BezierCurve
s that are part of the approximation, the start
point, middle point, and end point is considered as a vertex.boundsCenter
- The ideal anchorage reference position.curve
- The anchorage geometry.protected Point getNearestVertex(Point boundsCenter, IShape shape)
boundsCenter
- The ideal anchorage reference position.shape
- The anchorage geometry.Copyright (c) 2014 itemis AG and others. All rights reserved.