|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.ObjectEllipse
public class Ellipse
Constructor Summary | |
---|---|
Ellipse(double x,
double y,
double width,
double height)
Constructs an ellipse. |
Method Summary | |
---|---|
void |
draw()
Draws this ellipse. |
void |
fill()
Fills this ellipse. |
int |
getHeight()
Gets the height of the bounding box. |
int |
getWidth()
Gets the width of the bounding box. |
int |
getX()
Gets the leftmost x-position of this ellipse. |
int |
getY()
Gets the topmost y-position of this ellipse. |
void |
grow(double dw,
double dh)
Resizes this ellipse both horizontally and vertically. |
void |
paintShape(Graphics2D g2)
Paints the shape |
void |
setColor(Color newColor)
Sets the color of this ellipse. |
String |
toString()
|
void |
translate(double dx,
double dy)
Moves this ellipse by a given amount. |
Methods inherited from class |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public Ellipse(double x, double y, double width, double height)
x
- the leftmost x-coordinatey
- the topmost y-coordinatewidth
- the width of the bounding boxheight
- the height of the bounding boxMethod Detail |
---|
public void draw()
public void fill()
public int getHeight()
getHeight
in interface Shape
public int getWidth()
getWidth
in interface Shape
public int getX()
getX
in interface Shape
public int getY()
getY
in interface Shape
public void grow(double dw, double dh)
dw
- the amount by which to resize the width on each sidedw
- the amount by which to resize the height on each sidepublic void paintShape(Graphics2D g2)
Shape
paintShape
in interface Shape
g2
- the graphics objectpublic void setColor(Color newColor)
newColor
- the new colorpublic String toString()
toString
in class Object
public void translate(double dx, double dy)
dx
- the amount by which to move in x-directiondy
- the amount by which to move in y-direction
|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |