public class SquareShape extends Shape
Shape, with multiple constructors to specify its
location, size, and color.| Constructor and Description |
|---|
SquareShape(int x,
int y)
Builds a SquareShape at the x and y indices.
|
SquareShape(int x,
int y,
java.awt.Color color)
Builds a SquareShape using the given color for the text color, at the x
and y indices.
|
SquareShape(int x,
int y,
int size)
Builds a SquareShape at the x and y indices.
|
SquareShape(int x,
int y,
int size,
java.awt.Color color)
Builds a SquareShape using the given color, at the x and y indices, of
the size specified.
|
| Modifier and Type | Method and Description |
|---|---|
void |
draw(java.awt.Graphics2D g)
draw method (overridden)
|
equals, getHeight, getWidth, move, moveTo, onClick, onClick, onTimer, onTimer, remove, stopTimercollidesWith, contains, getBackgroundColor, getBounds, getForegroundColor, getWindow, getX, getY, onClick, repaint, setBackgroundColor, setForegroundColor, setX, setYpublic SquareShape(int x,
int y)
x - the x index in pixelsy - the y index in pixelspublic SquareShape(int x,
int y,
int size)
x - the x index in pixelsy - the y index in pixelssize - the width/height of your square in pixelspublic SquareShape(int x,
int y,
java.awt.Color color)
x - the x index in pixelsy - the y index in pixelscolor - The text colorpublic SquareShape(int x,
int y,
int size,
java.awt.Color color)
x - the x index in pixelsy - the y index in pixelssize - the width and height of the squarecolor - The text colorpublic void draw(java.awt.Graphics2D g)
draw in class Shapeg - graphics object from SwingShape.draw(java.awt.Graphics2D)