Interface ConnectorShape

All Known Implementing Classes:
AbstractConnector, CurvedConnectorShape, ElbowConnectorShape, FreeConnectorShape, SegmentedConnector, StraightConnectorShape

public interface ConnectorShape
Implement this to provide a line shape for connectors. Different implementations may draw a Line in different ways, for example with curved or straight lines.
Author:
unknown
  • Nested Class Summary

    Nested Classes
    Modifier and Type Interface Description
    static class  ConnectorShape.Segment
    A single segment of the connector path.
    static class  ConnectorShape.WayPoint
    The class for a waypoint, a point through which the connector passes.
  • Field Summary

    Fields
    Modifier and Type Field Description
    static int AXIS_X  
    static int AXIS_Y  
  • Method Summary

    Modifier and Type Method Description
    java.awt.Shape calculateAdjustedShape​(double startLineEndingWidth, double endLineEndingWidth)
    Calculates shape from the width of the line endings.
    java.awt.geom.Point2D fromLineCoordinate​(double l)
    Translates a 1-dimensional line coordinate to a 2-dimensional view coordinate.
    ConnectorShape.Segment[] getSegments()
    Get the individual segments of the path
    java.awt.Shape getShape()
    Returns the Shape that represents the connector path.
    ConnectorShape.WayPoint[] getWayPoints()
    Get the waypoints through which the connector passes
    boolean hasValidWaypoints​(ConnectorRestrictions restrictions)
    Checks whether the waypoints as provided by the ConnectorRestrictions are valid and will be used to draw the connector path
    void recalculateShape​(ConnectorRestrictions restrictions)
    Forces the connector to redraw it's path.
    double toLineCoordinate​(java.awt.geom.Point2D v)
    Translates a 2-dimensional view coordinate to a 1-dimensional line coordinate.
  • Field Details

  • Method Details

    • recalculateShape

      void recalculateShape​(ConnectorRestrictions restrictions)
      Forces the connector to redraw it's path. The cache for segments, waypoints and shape.
      Parameters:
      restrictions - the ConnectorRestrictions that provides the start, end and preferred waypoints
    • getShape

      java.awt.Shape getShape()
      Returns the Shape that represents the connector path.
    • calculateAdjustedShape

      java.awt.Shape calculateAdjustedShape​(double startLineEndingWidth, double endLineEndingWidth)
      Calculates shape from the width of the line endings. This gets...
      Parameters:
      startLineEndingWidth - .
      endLineEndingWidth - .
    • getSegments

      ConnectorShape.Segment[] getSegments()
      Get the individual segments of the path
      Returns:
      array of segments.
    • getWayPoints

      ConnectorShape.WayPoint[] getWayPoints()
      Get the waypoints through which the connector passes
      Returns:
      array of waypoints.
    • hasValidWaypoints

      boolean hasValidWaypoints​(ConnectorRestrictions restrictions)
      Checks whether the waypoints as provided by the ConnectorRestrictions are valid and will be used to draw the connector path
      Parameters:
      restrictions - the connector restrictions.
      Returns:
      true if the waypoints are used, false if not
    • fromLineCoordinate

      java.awt.geom.Point2D fromLineCoordinate​(double l)
      Translates a 1-dimensional line coordinate to a 2-dimensional view coordinate. The 1-dimensional line coordinate is position objects that are attached to the line.
      Parameters:
      l - the double.
    • toLineCoordinate

      double toLineCoordinate​(java.awt.geom.Point2D v)
      Translates a 2-dimensional view coordinate to a 1-dimensional line coordinate.
      Parameters:
      v - the Point2D