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 Figure
getFigure()
Get the figure to which this site is attached.int
getID()
Get the ID of this site.double
getNormal()
Get the normal of the site.double
getOffset()
Get the distance to be located along the side, in percent.int
getSide()
Get the side to be located on: NORTH, SOUTH, EAST, WEST.double
getX()
Get the x-coordinate of the site.double
getY()
Get the y-coordinate of the site.java.lang.String
toString()
-
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:
getFigure
in interfaceSite
- Specified by:
getFigure
in classAbstractSite
- Returns:
- The figure.
-
getID
public int getID()
Get the ID of this site.- Specified by:
getID
in interfaceSite
- Specified by:
getID
in classAbstractSite
- Returns:
- The unique identifier.
-
getNormal
public double getNormal()
Get the normal of the site.- Specified by:
getNormal
in interfaceSite
- Overrides:
getNormal
in 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:
getX
in interfaceSite
- Specified by:
getX
in classAbstractSite
- Returns:
- The x-coordinate of the site.
-
getY
public double getY()
Get the y-coordinate of the site.- Specified by:
getY
in interfaceSite
- Specified by:
getY
in classAbstractSite
- Returns:
- The y-coordinate of the site.
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-