diva.canvas.interactor
Class BoundsGeometry.BoundsSite

java.lang.Object
  extended by diva.canvas.AbstractSite
      extended by diva.canvas.interactor.BoundsGeometry.BoundsSite
All Implemented Interfaces:
Site
Enclosing class:
BoundsGeometry

public class BoundsGeometry.BoundsSite
extends AbstractSite

BoundsSite is the local class that implements editable sites of Rectangle objects.


Field Summary
private  int _id
           
private  double piOver4
           
 
Fields inherited from class diva.canvas.AbstractSite
_hasNormal, _normal
 
Constructor Summary
BoundsGeometry.BoundsSite(int id)
          Create a new site with the given ID
 
Method Summary
 Figure getFigure()
          Get the figure to which this site is attached, or null if it is not attached to a figure.
 int getID()
          Get the ID of this site.
 double getNormal()
          Get the angle of the normal to this site, in radians between zero and 2pi.
 java.awt.geom.Point2D getPoint()
          Get the point location of the site.
 double getX()
          Get the x-coordinate of the site, in the local coordinates of the containing pane.
 double getY()
          Get the y-coordinate of the site, in the local coordinates of the containing pane.
 boolean hasNormal()
          Test if this site has a "normal" to it.
 boolean isNormal(int direction)
          Test if this site has a normal in the given direction.
 void setPoint(java.awt.geom.Point2D point)
          Set the point location of the site
 void translate(double x, double y)
          Translate the site by the indicated distance, where distances are in the local coordinates of the containing pane.
 
Methods inherited from class diva.canvas.AbstractSite
getPoint, getPoint, getPoint, getTransformContext, setNormal
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

_id

private int _id

piOver4

private double piOver4
Constructor Detail

BoundsGeometry.BoundsSite

BoundsGeometry.BoundsSite(int id)
Create a new site with the given ID

Method Detail

getID

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

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

getFigure

public Figure getFigure()
Get the figure to which this site is attached, or null if it is not attached to a figure.

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

getNormal

public double getNormal()
Get the angle of the normal to this site, in radians between zero and 2pi.

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

getPoint

public java.awt.geom.Point2D getPoint()
Get the point location of the site.

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

getX

public double getX()
Get the x-coordinate of the site, in the local coordinates of the containing pane.

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

getY

public double getY()
Get the y-coordinate of the site, in the local coordinates of the containing pane.

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

hasNormal

public boolean hasNormal()
Test if this site has a "normal" to it. Returns true.

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

isNormal

public boolean isNormal(int direction)
Test if this site has a normal in the given direction.

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

translate

public void translate(double x,
                      double y)
Translate the site by the indicated distance, where distances are in the local coordinates of the containing pane.

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

setPoint

public void setPoint(java.awt.geom.Point2D point)
Set the point location of the site