Class XYAnchor

All Implemented Interfaces:
ConnectionAnchor

public class XYAnchor extends ConnectionAnchorBase
Supports an anchor in the XY layout. This anchor exists independently without an owner.
  • Constructor Details

    • XYAnchor

      public XYAnchor(Point p)
      Constructs an XYAnchor at the Point p.
      Parameters:
      p - the point where this anchor will be located
      Since:
      2.0
  • Method Details

    • getLocation

      public Point getLocation(Point reference)
      Returns the location of this anchor relative to the reference point given in as input. Since this is XY layout, the location of the point is independent of the reference point.
      Parameters:
      reference - The reference Point in absolute coordinates
      Returns:
      The anchor's location
      See Also:
    • getOwner

      public IFigure getOwner()
      Returns null as these anchors inherently do not depend on other figures for their location.
      Returns:
      The IFigure that contains this ConnectionAnchor
      Since:
      2.0
      See Also:
    • getReferencePoint

      public Point getReferencePoint()
      Returns the point which is used as the reference by this connection anchor. In the case of the XYAnchor, this point is the same as its location.
      Returns:
      The reference Point
      See Also:
    • setLocation

      public void setLocation(Point p)
      Sets the location of this anchor and notifies all the listeners of the update.
      Parameters:
      p - the new location of this anchor
      Since:
      2.0
      See Also: