|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object edu.byu.phun2d.DrawObj edu.byu.phun2d.Rect
public class Rect
This class will draw a rectangle based on a center point and a width and height. The rectangle will be aligned with the X and Y axes.
Constructor Summary | |
---|---|
Rect(double centerX,
double centerY,
double width,
double height)
This creates a new rectangle object with the specified location and size. |
Method Summary | |
---|---|
double |
getCenterX()
The X coordinate of the center of the rectangle. |
double |
getCenterY()
The Y coordinate of the center of the rectangle. |
double |
getHeight()
The height of the rectangle. |
double |
getWidth()
The width of the rectangle. |
void |
setCenter(double centerX,
double centerY)
Changes the center coordinates of the rectangle. |
void |
setHeight(double newHeight)
Changes the height of the rectangle. |
void |
setWidth(double newWidth)
Changes the width of the rectangle. |
Methods inherited from class edu.byu.phun2d.DrawObj |
---|
getFillColor, getLineColor, getLineWidth, getRotate, getScaleX, getScaleY, getTranslate, insideToOutside, outsideToInside, setFillColor, setLineColor, setLineWidth, setRotate, setScale, setTranslate |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public Rect(double centerX, double centerY, double width, double height)
centerX
- is the X coordinate of the center of the rectanglecenterY
- is the Y coordinate of the center of the rectanglewidth
- this is the width of the new rectangleheight
- this is the height of the rectangleMethod Detail |
---|
public void setCenter(double centerX, double centerY)
centerX
- the new X coordinate.centerY
- the new Y coordinate.public void setWidth(double newWidth)
newWidth
- the new width.public void setHeight(double newHeight)
newHeight
- the new height.public double getWidth()
public double getHeight()
public double getCenterX()
public double getCenterY()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |