Constructor and Description |
---|
Ellipse(double x,
double y,
double width,
double height)
Constructs an ellipse.
|
Modifier and Type | Method and Description |
---|---|
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(java.awt.Graphics2D g2)
Paints the shape.
|
void |
setColor(Color newColor)
Sets the color of this ellipse.
|
java.lang.String |
toString()
Yields a description of this shape.
|
void |
translate(double dx,
double dy)
Moves this ellipse by a given amount.
|
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 boxpublic int getX()
public int getY()
public int getWidth()
public int getHeight()
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-directionpublic void grow(double dw, double dh)
dw
- the amount by which to resize the width on each sidedh
- the amount by which to resize the height on each sidepublic void setColor(Color newColor)
newColor
- the new colorpublic void draw()
public void fill()
public java.lang.String toString()
Shape
public void paintShape(java.awt.Graphics2D g2)
Shape
paintShape
in interface Shape
g2
- the graphics object