Class CenterSite

  • All Implemented Interfaces:
    Site

    public class CenterSite
    extends AbstractSite
    A concrete implementation of Site that is located in the center of the bounding box of a figure. This is a utility class provided for convenience of figures that need to make their center points connectible.
    Version:
    $Id$
    Author:
    John Reekie
    • Constructor Detail

      • CenterSite

        public CenterSite​(Figure figure)
        Create a new site on the given figure. The site will have the ID zero. FIXME: This should be deprecated? Use the constructor that takes an ID.
      • CenterSite

        public CenterSite​(Figure figure,
                          int id)
        Create a new site on the given figure and with the given ID
    • Method Detail

      • getID

        public int getID()
        Get the ID of this site.
        Specified by:
        getID in interface Site
        Specified by:
        getID in class AbstractSite
        Returns:
        The unique identifier.
      • getX

        public double getX()
        Get the x-coordinate of the site. The site is located in the center of the parent figure's bounding box.
        Specified by:
        getX in interface Site
        Specified by:
        getX in class AbstractSite
        Returns:
        The x-coordinate of the site.
      • getY

        public double getY()
        Get the y-coordinate of the site. The site is located in the center of the parent figure's bounding box.
        Specified by:
        getY in interface Site
        Specified by:
        getY in class AbstractSite
        Returns:
        The y-coordinate of the site.