|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcsa120.shape.Shape
csa120.shape.FillableShape
csa120.shape.Rectangle
A Rectangle is a subclass of a FillableShape. The
'location' point inherited from Shape will be interpreted
as the center of the rectangle.
| Field Summary | |
protected int |
height
The height of the rectangle, measured in pixels. |
protected int |
width
The width of the rectangle, measured in pixels. |
| Fields inherited from class csa120.shape.FillableShape |
fillColor, filled |
| Fields inherited from class csa120.shape.Shape |
borderColor, borderThickness, depth, location |
| Constructor Summary | |
Rectangle(int w,
int h)
Constructor for objects of class Rectangle |
|
| Method Summary | |
void |
draw(Graphics2D g)
Draws the Rectangle on the given Graphics2D object. |
void |
draw(Graphics2D g,
int deltaX,
int deltaY)
Draws the Rectangle on the given Graphics2D object, with additional offset as given. |
int |
getHeight()
Returns current height of rectangle |
int |
getWidth()
Returns current width of rectangle |
void |
setHeight(int newHeight)
Sets height of rectangle |
void |
setWidth(int newWidth)
Sets width of rectangle |
| Methods inherited from class csa120.shape.FillableShape |
getFillColor, getFilled, setFillColor, setFillColor, setFilled |
| Methods inherited from class csa120.shape.Shape |
getBorderColor, getBorderThickness, getDepth, getLocation, move, setBorderColor, setBorderColor, setBorderThickness, setDepth, setLocation |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface csa120.shape.ShapeOrGroup |
move, setBorderColor, setBorderColor, setBorderThickness, setDepth |
| Methods inherited from interface csa120.shape.Drawable |
getDepth |
| Field Detail |
protected int width
protected int height
| Constructor Detail |
public Rectangle(int w,
int h)
w - original widthh - original height| Method Detail |
public void setWidth(int newWidth)
newWidth - the new valuepublic int getWidth()
public void setHeight(int newHeight)
newHeight - the new valuepublic int getHeight()
public void draw(Graphics2D g)
draw in interface Drawabledraw in class Shapeg - the Graphics2D object upon which to draw
public void draw(Graphics2D g,
int deltaX,
int deltaY)
draw in interface Drawabledraw in class Shapeg - the Graphics2D object upon which to drawdeltaX - additional offset to be considereddeltaY - additional offest to be considered
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||