Interface Connector

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 Details

    • getPointAndDerivativeInLocal

      PointAndDerivative getPointAndDerivativeInLocal(Figure connection, Figure target)
      Returns a point and derivative on the target figure for the specified connection figure in local coordinates.
      Parameters:
      connection - a connection figure
      target - the target
      Returns:
      A point and derivative on the target figure in local coordinates of the target figure.
    • getPointAndDerivativeInWorld

      default PointAndDerivative getPointAndDerivativeInWorld(Figure connection, Figure target)
      Returns a point and derivative on the target figure for the specified connection figure in world coordinates.
      Parameters:
      connection - a connection figure
      target - 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 context
      connection - a connection figure
      target - the target
      sx - x-coordinate at the start of the line
      sy - x-coordinate at the start of the line
      ex - x-coordinate at the end of the line
      ey - 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 context
      connection - a connection figure
      target - the target
      start - the start of the line, should be inside the target figure
      end - 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 context
      connection - the connection figure
      target - the target figure
      start - the start point of the line in world coordinates, should be inside the target figure
      end - 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.