java.lang.ObjectDrawableShape
Circle
public class Circle
A circle that can be manipulated and drawn.
Constructor Summary | |
---|---|
Circle()
Creates a new Circle object with default location, radius, and color. |
Method Summary | |
---|---|
void |
bringToFront()
Brings the shape to the "front" of the drawing (in front of other shapes) |
protected boolean |
contains(int x,
int y)
Returns whether the shape contains the given point |
protected void |
draw(java.awt.Graphics2D g2d)
|
java.lang.String |
getColorName()
Returns the circle's current color (as a String). |
int |
getRadius()
Returns the circle's current radius |
int |
getXPosition()
Returns the circle's current x position |
int |
getYPosition()
Returns the circle's current y position |
boolean |
isFilled()
Returns whether the circle is filled or not |
void |
moveHorizontal(int distance)
Move the circle horizontally the specified number of pixels. |
void |
moveVertical(int distance)
Move the circle vertically the specified number of pixels. |
void |
removeSelfFromCanvas()
Removes the shape from the canvas |
void |
sendToBack()
Sends the shape to the "back" of the drawing (behind other shapes) |
void |
setColorByName(java.lang.String newColor)
Set the circle's color to the given value. |
void |
setFilled(boolean newFilled)
Sets whether the circle should be filled; can either be true or false |
void |
setRadius(int newRadius)
Sets the circle's radius to the given value |
void |
setXPosition(int newX)
Sets the circle's x position to the given value |
void |
setYPosition(int newY)
Sets the circle's y position to the given value |
Methods inherited from class |
---|
addSelfToCanvas, getColorFromString, redraw |
Methods inherited from class |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public Circle()
Method Detail |
---|
public void bringToFront()
bringToFront
in class DrawableShape
protected boolean contains(int x, int y)
DrawableShape
contains
in class DrawableShape
protected void draw(java.awt.Graphics2D g2d)
draw
in class DrawableShape
public java.lang.String getColorName()
public int getRadius()
public int getXPosition()
public int getYPosition()
public boolean isFilled()
public void moveHorizontal(int distance)
public void moveVertical(int distance)
public void removeSelfFromCanvas()
removeSelfFromCanvas
in class DrawableShape
public void sendToBack()
sendToBack
in class DrawableShape
public void setColorByName(java.lang.String newColor)
public void setFilled(boolean newFilled)
public void setRadius(int newRadius)
public void setXPosition(int newX)
public void setYPosition(int newY)