Class RoundedRectangleAnchor

All Implemented Interfaces:
AncestorListener, ConnectionAnchor

public class RoundedRectangleAnchor extends ChopboxAnchor
Anchor for rounded rectangles which is always on a line between the center and the reference point.
Since:
3.8
  • Constructor Details

    • RoundedRectangleAnchor

      public RoundedRectangleAnchor(RoundedRectangle figure)
      Rounded Rectangle getCornerDimension should be public #302836 then Rounded Rectangle would be sufficient.
    • RoundedRectangleAnchor

      public RoundedRectangleAnchor(Figure figure, Dimension corners)
      Rounded Rectangle getCornerDimension should be public #302836 then Rounded Rectangle would be sufficient.
  • Method Details

    • getLocation

      public Point getLocation(Point ref)
      Calculates the position with ChopboxAnchor#getLocation() and if the anchor is not at the rounded corners, the result is returned. If the anchor point should be at a corner, the rectangle for the ellipse is determined and ellipseAnchorGetLocation returns the two intersection points between the line from calculated anchor point and the center of the rounded rectangle.
      Specified by:
      getLocation in interface ConnectionAnchor
      Overrides:
      getLocation in class ChopboxAnchor
      Parameters:
      ref - The reference point
      Returns:
      The anchor location