diva.canvas.connector
Class BoundsSite

java.lang.Object
  extended by diva.canvas.AbstractSite
      extended by 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: BoundsSite.java 40092 2005-12-14 04:17:17Z cxh $
Author:
John Reekie

Field Summary
private  int _id
          The id
private  double _offset
          The distance to be located along that side, in percent
private  Figure _parentFigure
          The parent figure
private  int _side
          The side to be located on: NORTH, SOUTH, EAST, WEST
 
Fields inherited from class diva.canvas.AbstractSite
_hasNormal, _normal
 
Constructor Summary
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
 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
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

_id

private int _id
The id


_side

private int _side
The side to be located on: NORTH, SOUTH, EAST, WEST


_offset

private double _offset
The distance to be located along that side, in percent


_parentFigure

private Figure _parentFigure
The parent figure

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 interface Site
Specified by:
getFigure in class AbstractSite

getID

public int getID()
Get the ID of this site.

Specified by:
getID in interface Site
Specified by:
getID in class AbstractSite

getNormal

public double getNormal()
Get the normal of the site.

Specified by:
getNormal in interface Site
Overrides:
getNormal in class AbstractSite

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

getY

public double getY()
Get the y-coordinate of the site.

Specified by:
getY in interface Site
Specified by:
getY in class AbstractSite

toString

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