- All Known Implementing Classes:
AbstractConnector,EllipseConnector,LocatorConnector,PathConnector,RectangleConnector
public interface Connector
A connector encapsulates a strategy for locating a connection point
for a connection figure on a target figure.
- Author:
- Werner Randelshofer
-
Method Summary
Modifier and TypeMethodDescriptiondefault IntersectionPointExchopStart(RenderContext ctx, Figure connection, Figure target, double sx, double sy, double ex, double ey) Clips the start of the provided line at the bounds of the target figure.default IntersectionPointExchopStart(RenderContext ctx, Figure connection, Figure target, javafx.geometry.Point2D start, javafx.geometry.Point2D end) Clips the start of the provided line at the bounds of the target figure.getPointAndDerivativeInLocal(Figure connection, Figure target) Returns a point and derivative on the target figure for the specified connection figure in local coordinates.default PointAndDerivativegetPointAndDerivativeInWorld(Figure connection, Figure target) Returns a point and derivative on the target figure for the specified connection figure in world coordinates.default @Nullable IntersectionPointExintersect(RenderContext ctx, Figure connection, Figure target, javafx.geometry.Point2D start, javafx.geometry.Point2D end) Returns the intersection of the line going from start to end with the target figure.
-
Method Details
-
getPointAndDerivativeInLocal
Returns a point and derivative on the target figure for the specified connection figure in local coordinates.- Parameters:
connection- a connection figuretarget- the target- Returns:
- A point and derivative on the target figure in local coordinates of the target figure.
-
getPointAndDerivativeInWorld
Returns a point and derivative on the target figure for the specified connection figure in world coordinates.- Parameters:
connection- a connection figuretarget- the target- Returns:
- A point and derivative on the target figure in world coordinates
-
chopStart
default IntersectionPointEx chopStart(RenderContext ctx, Figure connection, Figure target, double sx, double sy, double ex, double ey) Clips the start of the provided line at the bounds of the target figure. The line must be given in world coordinates.- Parameters:
ctx- the render contextconnection- a connection figuretarget- the targetsx- x-coordinate at the start of the linesy- x-coordinate at the start of the lineex- x-coordinate at the end of the lineey- y-coordinate at the end of the line- Returns:
- the new start point in world coordinates
-
chopStart
default IntersectionPointEx chopStart(RenderContext ctx, Figure connection, Figure target, javafx.geometry.Point2D start, javafx.geometry.Point2D end) Clips the start of the provided line at the bounds of the target figure. The line must be given in world coordinates.- Parameters:
ctx- the render contextconnection- a connection figuretarget- the targetstart- the start of the line, should be inside the target figureend- the end of the line, should be outside the target figure- Returns:
- the new start point in world coordinates
-
intersect
default @Nullable IntersectionPointEx intersect(RenderContext ctx, Figure connection, Figure target, javafx.geometry.Point2D start, javafx.geometry.Point2D end) Returns the intersection of the line going from start to end with the target figure. The line must be given in world coordinates.- Parameters:
ctx- the render contextconnection- the connection figuretarget- the target figurestart- the start point of the line in world coordinates, should be inside the target figureend- the end point of the line in world coordinates, should be outside the target figure- Returns:
- the intersection in the interval [0,1], null if no intersection. In case of multiple intersections returns the largest value.
-