Package diva.canvas.interactor
Class BoundsGeometry.BoundsSite
- java.lang.Object
-
- diva.canvas.AbstractSite
-
- 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
-
Fields inherited from class diva.canvas.AbstractSite
_hasNormal, _normal
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description 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 sitevoid
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
-
-
-
-
Method Detail
-
getID
public int getID()
Get the ID of this site.- Specified by:
getID
in interfaceSite
- Specified by:
getID
in classAbstractSite
- Returns:
- The unique identifier.
-
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 interfaceSite
- Specified by:
getFigure
in classAbstractSite
- Returns:
- The figure.
-
getNormal
public double getNormal()
Get the angle of the normal to this site, in radians between zero and 2pi.- Specified by:
getNormal
in interfaceSite
- Overrides:
getNormal
in classAbstractSite
- Returns:
- The normal.
-
getPoint
public java.awt.geom.Point2D getPoint()
Get the point location of the site.- Specified by:
getPoint
in interfaceSite
- Overrides:
getPoint
in classAbstractSite
- Returns:
- The point.
-
getX
public double getX()
Get the x-coordinate of the site, in the local coordinates of the containing pane.- 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, in the local coordinates of the containing pane.- Specified by:
getY
in interfaceSite
- Specified by:
getY
in classAbstractSite
- Returns:
- The y-coordinate of the site.
-
hasNormal
public boolean hasNormal()
Test if this site has a "normal" to it. Returns true.- Specified by:
hasNormal
in interfaceSite
- Overrides:
hasNormal
in classAbstractSite
- Returns:
- true if the site has a normal.
-
isNormal
public boolean isNormal(int direction)
Test if this site has a normal in the given direction.- Specified by:
isNormal
in interfaceSite
- Overrides:
isNormal
in classAbstractSite
- Parameters:
direction
- The direction- Returns:
- true if the site is normal in the given direction.
-
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 interfaceSite
- Overrides:
translate
in classAbstractSite
- Parameters:
x
- The x distance to be translated.y
- The y distance to be translated.
-
setPoint
public void setPoint(java.awt.geom.Point2D point)
Set the point location of the site
-
-