Package diva.canvas.connector
Class ParametricSite
- java.lang.Object
-
- diva.canvas.AbstractSite
-
- diva.canvas.connector.ParametricSite
-
- All Implemented Interfaces:
Site
public class ParametricSite extends AbstractSite
A site that locates itself in a figure at a location in X and Y that is some percentage of the bounding box of the figure. So as the figure grows, the site relocates itself proportionally.- Version:
- $Id$
- Author:
- Michael Shilman
-
-
Field Summary
-
Fields inherited from class diva.canvas.AbstractSite
_hasNormal, _normal
-
-
Constructor Summary
Constructors Constructor Description ParametricSite(Figure figure, int id, double xt, double yt)Create a new site on the given figure with the given id, located at (xt, yt) percentage of the given figure's bounding box, with (0,0) being the upper left-hand corner and (1,1) being the lower right.
-
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.doublegetX()Get the X-coordinate of the site.doublegetY()Get the Y-coordinate of the site.
-
-
-
Constructor Detail
-
ParametricSite
public ParametricSite(Figure figure, int id, double xt, double yt)
Create a new site on the given figure with the given id, located at (xt, yt) percentage of the given figure's bounding box, with (0,0) being the upper left-hand corner and (1,1) being the lower right. The site will have the ID zero.
-
-
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.
-
getX
public double getX()
Get the X-coordinate of the site. The site is located at some percentage of the parent figure's bounding width.- 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. The site is located at some percentage of the parent figure's bounding height.- Specified by:
getYin interfaceSite- Specified by:
getYin classAbstractSite- Returns:
- The y-coordinate of the site.
-
-