diva.canvas.connector
Class ParametricSite

java.lang.Object
  extended by diva.canvas.AbstractSite
      extended by 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: ParametricSite.java 38798 2005-07-08 20:00:01Z cxh $
Author:
Michael Shilman

Field Summary
private  int _id
          The id
private  Figure _parentFigure
          The parent figure
private  double _xt
          The X parameter, denoting the percentage of the width relative to the left side of the figure.
private  double _yt
          The Y parameter, denoting the percentage of the height relative to the top side of the figure.
 
Fields inherited from class diva.canvas.AbstractSite
_hasNormal, _normal
 
Constructor Summary
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
 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.
 
Methods inherited from class diva.canvas.AbstractSite
getNormal, getPoint, getPoint, getPoint, getPoint, getTransformContext, hasNormal, isNormal, setNormal, translate
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

_id

private int _id
The id


_parentFigure

private Figure _parentFigure
The parent figure


_xt

private double _xt
The X parameter, denoting the percentage of the width relative to the left side of the figure.


_yt

private double _yt
The Y parameter, denoting the percentage of the height relative to the top side of the figure.

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:
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

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

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