Package diva.canvas.connector
Class BoundsSite
- java.lang.Object
-
- diva.canvas.AbstractSite
-
- diva.canvas.connector.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
-
-
Field Summary
-
Fields inherited from class diva.canvas.AbstractSite
_hasNormal, _normal
-
-
Constructor Summary
Constructors Constructor Description 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 Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description FiguregetFigure()Get the figure to which this site is attached.intgetID()Get the ID of this site.doublegetNormal()Get the normal of the site.doublegetOffset()Get the distance to be located along the side, in percent.intgetSide()Get the side to be located on: NORTH, SOUTH, EAST, WEST.doublegetX()Get the x-coordinate of the site.doublegetY()Get the y-coordinate of the site.java.lang.StringtoString()-
Methods inherited from class diva.canvas.AbstractSite
getPoint, getPoint, getPoint, getPoint, getTransformContext, hasNormal, isNormal, setNormal, translate
-
-
-
-
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
-
getFigure
public Figure getFigure()
Get the figure to which this site is attached.- Specified by:
getFigurein interfaceSite- Specified by:
getFigurein classAbstractSite- Returns:
- The figure.
-
getID
public int getID()
Get the ID of this site.- Specified by:
getIDin interfaceSite- Specified by:
getIDin classAbstractSite- Returns:
- The unique identifier.
-
getNormal
public double getNormal()
Get the normal of the site.- Specified by:
getNormalin interfaceSite- Overrides:
getNormalin classAbstractSite- 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:
getXin interfaceSite- Specified by:
getXin classAbstractSite- Returns:
- The x-coordinate of the site.
-
getY
public double getY()
Get the y-coordinate of the site.- Specified by:
getYin interfaceSite- Specified by:
getYin classAbstractSite- Returns:
- The y-coordinate of the site.
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-