ClickAction
public class CircleShape extends Shape
Shape
, with multiple constructors to specify its
location, size, and color.Constructor | Description |
---|---|
CircleShape(int x,
int y) |
CircleShape's simplest constructor, it only needs an x and y pixel
location on your window.
|
CircleShape(int x,
int y,
int size) |
CircleShape constructor where the default color is orange.
|
CircleShape(int x,
int y,
int size,
java.awt.Color color) |
CircleShape constructor where every parameter is specified.
|
CircleShape(int x,
int y,
java.awt.Color color) |
CircleShape constructor where the default size is 50.
|
Modifier and Type | Method | Description |
---|---|---|
void |
draw(java.awt.Graphics2D graph) |
draw method (overridden)
|
getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
equals, getHeight, getWidth, move, moveTo, onClick, onClick, onTimer, onTimer, remove, stopTimer
collidesWith, contains, getBackgroundColor, getBounds, getForegroundColor, getWindow, getX, getY, onClick, repaint, setBackgroundColor, setForegroundColor, setX, setY
public CircleShape(int x, int y)
x
- x axis location in pixelsy
- y axis location in pixelspublic CircleShape(int x, int y, java.awt.Color color)
x
- x axis location in pixelsy
- y axis location in pixelscolor
- The awt.Color chosen for this circlepublic CircleShape(int x, int y, int size)
x
- x axis location in pixelsy
- y axis location in pixelssize
- the width and height of your circle in pixels.public CircleShape(int x, int y, int size, java.awt.Color color)
x
- x axis location in pixelsy
- y axis location in pixelssize
- the width and height of your circle in pixels.color
- The awt.Color chosen for this circlepublic void draw(java.awt.Graphics2D graph)
draw
in class Shape
graph
- graphics object from SwingShape.draw(java.awt.Graphics2D)