objectdraw
Class FilledRect

java.lang.Object
  |
  +--objectdraw.Drawable
        |
        +--objectdraw.Drawable2D
              |
              +--objectdraw.Resizable2D
                    |
                    +--objectdraw.Rect
                          |
                          +--objectdraw.FilledRect
All Implemented Interfaces:
Drawable2DInterface, DrawableInterface, Resizable2DInterface, java.io.Serializable

public class FilledRect
extends Rect

FilledRect is an implementation of a drawable filled rectangle object.

See Also:
Serialized Form

Fields inherited from class objectdraw.Rect
height, origin, width
 
Fields inherited from class objectdraw.Drawable
canvas, canvasContent, color, DEBUGGING, shown
 
Constructor Summary
FilledRect(double x, double y, double width, double height, DrawingCanvas c)
          Creates a new FilledRect object.
FilledRect(Location origin, double width, double height, DrawingCanvas c)
          Creates a new FilledRect object.
FilledRect(Location p0, Location p1, DrawingCanvas c)
          Creates a new FilledRect object.
 
Method Summary
 void draw(java.awt.Graphics g)
          Draws the object.
 java.lang.String toString()
          Generates a string representation of the object.
 
Methods inherited from class objectdraw.Rect
getBounds, getHeight, getWidth, setBounds, setHeight, setWidth
 
Methods inherited from class objectdraw.Resizable2D
move, moveTo
 
Methods inherited from class objectdraw.Drawable2D
contains, getLocation, getX, getY, overlaps
 
Methods inherited from class objectdraw.Drawable
addToCanvas, getColor, hide, isHidden, moveTo, removeFromCanvas, sendBackward, sendForward, sendToBack, sendToFront, setColor, setStateChanged, show
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface objectdraw.Drawable2DInterface
getLocation, getX, getY, overlaps
 
Methods inherited from interface objectdraw.DrawableInterface
addToCanvas, contains, getColor, hide, isHidden, moveTo, removeFromCanvas, sendBackward, sendForward, sendToBack, sendToFront, setColor, show
 

Constructor Detail

FilledRect

public FilledRect(Location origin,
                  double width,
                  double height,
                  DrawingCanvas c)
Creates a new FilledRect object.
Parameters:
origin - the upper left corner of the bounding rectangle
width - the width of the bounding rectangle
height - the height of the bounding rectangle
c - the canvas in which the image is created

FilledRect

public FilledRect(double x,
                  double y,
                  double width,
                  double height,
                  DrawingCanvas c)
Creates a new FilledRect object.
Parameters:
x - coordinate of the upper left corner of the bounding rectangle
y - coordinate of the upper left corner of the bounding rectangle
width - the width of the bounding rectangle
height - the height of the bounding rectangle
c - the canvas in which the image is created

FilledRect

public FilledRect(Location p0,
                  Location p1,
                  DrawingCanvas c)
Creates a new FilledRect object.
Parameters:
p0 - endpoint of a diagonal of the rectangle
p1 - other diagonal endpoint
c - the canvas in which the object is created
Method Detail

draw

public void draw(java.awt.Graphics g)
Draws the object.
Overrides:
draw in class Drawable2D
Parameters:
g - the graphics context into which the object is drawn

toString

public java.lang.String toString()
Generates a string representation of the object.
Overrides:
toString in class java.lang.Object
Returns:
a string representation of the object