Package diva.canvas.interactor
Class BoundsGeometry
- java.lang.Object
-
- diva.canvas.interactor.BoundsGeometry
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description classBoundsGeometry.BoundsSiteBoundsSite is the local class that implements editable sites of Rectangle objects.
-
Constructor Summary
Constructors Constructor Description BoundsGeometry(Figure figure, java.awt.geom.Rectangle2D bounds)Create a new geometry object on the given figure and with the given initial bounds.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.awt.geom.Rectangle2DgetBounds()Get the current rectangle that defines this geometry.SitegetE()Get the east site.FiguregetFigure()Get the figure to which this geometry object is attached.doublegetMinimumSize()Get the minimum size of the rectangle.SitegetN()Get the north site.SitegetNE()Get the north-east site.SitegetNW()Get the north-west site.SitegetS()Get the south site.SitegetSE()Get the south-east site.java.awt.ShapegetShape()Get the current shape that defines this geometrySitegetSite(int id)Get the single site with the given ID.SitegetSW()Get the south-west site.SitegetW()Get the west site.voidsetBounds(java.awt.geom.Rectangle2D rect)Set the rectangle that defines this geometry object.voidsetMinimumSize(double minimumSize)Set the minimum size of the rectangle.voidsetShape(java.awt.Shape shape)Set the shape that defines this geometry object.java.util.Iteratorsites()Return an iteration over the sites in this geometry object.voidtranslate(double x, double y)Translate the geometry object
-
-
-
Constructor Detail
-
BoundsGeometry
public BoundsGeometry(Figure figure, java.awt.geom.Rectangle2D bounds)
Create a new geometry object on the given figure and with the given initial bounds.
-
-
Method Detail
-
getSite
public Site getSite(int id)
Get the single site with the given ID.
-
getMinimumSize
public double getMinimumSize()
Get the minimum size of the rectangle.
-
getNE
public Site getNE()
Get the north-east site.
-
getNW
public Site getNW()
Get the north-west site.
-
getSE
public Site getSE()
Get the south-east site.
-
getSW
public Site getSW()
Get the south-west site.
-
getN
public Site getN()
Get the north site.
-
getS
public Site getS()
Get the south site.
-
getE
public Site getE()
Get the east site.
-
getW
public Site getW()
Get the west site.
-
getFigure
public Figure getFigure()
Get the figure to which this geometry object is attached. Returns null if there isn't one.
-
getShape
public java.awt.Shape getShape()
Get the current shape that defines this geometry
-
getBounds
public java.awt.geom.Rectangle2D getBounds()
Get the current rectangle that defines this geometry. This returns the same shape as getShape(), but as a Rectangle2D type.
-
setMinimumSize
public void setMinimumSize(double minimumSize)
Set the minimum size of the rectangle. The default is 1.0.
-
setShape
public void setShape(java.awt.Shape shape)
Set the shape that defines this geometry object. The shape must be a Rectangle2D, or an exception will be thrown.
-
setBounds
public void setBounds(java.awt.geom.Rectangle2D rect)
Set the rectangle that defines this geometry object. This is the same as setShape(), but does not need to perform the type check.
-
sites
public java.util.Iterator sites()
Return an iteration over the sites in this geometry object.
-
-