Package diva.canvas.connector
Class ArcMidpointSite
- java.lang.Object
-
- diva.canvas.AbstractSite
-
- diva.canvas.connector.ArcMidpointSite
-
- All Implemented Interfaces:
Site
public class ArcMidpointSite 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
-
-
Field Summary
-
Fields inherited from class diva.canvas.AbstractSite
_hasNormal, _normal
-
-
Constructor Summary
Constructors Constructor Description ArcMidpointSite(ArcConnector connector, int id)
Create a new site on the given arc connector with the given ID.
-
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
getX()
Get the x-coordinate of the site.double
getY()
Get the y-coordinate of the site.
-
-
-
Constructor Detail
-
ArcMidpointSite
public ArcMidpointSite(ArcConnector connector, int id)
Create a new site on the given arc connector with the given ID.- Parameters:
connector
- The arc connector.id
- The id.
-
-
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.
-
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 interfaceSite
- Specified by:
getX
in classAbstractSite
- 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 interfaceSite
- Specified by:
getY
in classAbstractSite
- Returns:
- The y-coordinate of the site.
-
-