objectdraw
Class Rect
java.lang.Object
objectdraw.Drawable
objectdraw.Drawable2D
objectdraw.Resizable2D
objectdraw.Rectangular
objectdraw.Rect
- All Implemented Interfaces:
- Serializable, Drawable2DInterface, DrawableInterface, Resizable2DInterface
- Direct Known Subclasses:
- FilledRect, FramedRect
abstract class Rect
- extends Rectangular
Rect is an abstract class representing rectangle objects.
- Version:
- 1.1.1 released February 2005
Method Summary |
String |
toString()
Generates a string representation of the object. |
Methods inherited from class objectdraw.Drawable |
addToCanvas, clearCanvasContent, getCanvas, getColor, hide, isHidden, moveTo, removeFromCanvas, sendBackward, sendForward, sendToBack, sendToFront, setCanvasContent, setColor, setStateChanged, show |
Methods inherited from interface objectdraw.DrawableInterface |
addToCanvas, contains, getCanvas, getColor, hide, isHidden, move, moveTo, moveTo, removeFromCanvas, sendBackward, sendForward, sendToBack, sendToFront, setColor, show |
Rect
public Rect(double x,
double y,
double width,
double height,
DrawingCanvas canvas)
- Creates a new Rect object.
- Parameters:
x
- coordinate of the upper left corner of the bounding rectangley
- coordinate of the upper left corner of the bounding rectanglewidth
- the width of the bounding rectangleheight
- the height of the bounding rectanglecanvas
- the canvas in which the image is created
Rect
public Rect(Location origin,
double width,
double height,
DrawingCanvas canvas)
- Creates a new Rect object.
- Parameters:
origin
- the upper left corner of the bounding rectanglewidth
- the width of the bounding rectangleheight
- the height of the bounding rectanglecanvas
- the canvas in which the image is created
Rect
public Rect(Location p0,
Location p1,
DrawingCanvas canvas)
- Creates a new Rect object.
- Parameters:
p0
- endpoint of a diagonal of the rectanglep1
- other diagonal endpointcanvas
- the canvas in which the object is created
toString
public String toString()
- Generates a string representation of the object.
- Overrides:
toString
in class Object
- Returns:
- a string representation of the object