Class BoundsSite

  • All Implemented Interfaces:
    Site

    public class BoundsSite
    extends AbstractSite
    A site that locates itself on the bounds of a figure's shape. It has two fields that govern its position on the bounds.
    Version:
    $Id$
    Author:
    John Reekie
    • Constructor Detail

      • BoundsSite

        public BoundsSite​(Figure figure,
                          int id,
                          int side,
                          double offset)
        Create a new site on the given figure with the given ID and at the location given by the side and the offset.
    • 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.
      • getNormal

        public double getNormal()
        Get the normal of the site.
        Specified by:
        getNormal in interface Site
        Overrides:
        getNormal in class AbstractSite
        Returns:
        The normal.
      • getOffset

        public double getOffset()
        Get the distance to be located along the side, in percent.
      • getSide

        public int getSide()
        Get the side to be located on: NORTH, SOUTH, EAST, WEST.
      • getX

        public double getX()
        Get the x-coordinate of the site.
        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.
        Specified by:
        getY in interface Site
        Specified by:
        getY in class AbstractSite
        Returns:
        The y-coordinate of the site.
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object