|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.ObjectL20_pkg.PolkaDot
public class PolkaDot
This class encapsulates a polka dot shape, which has a diameter, a color, and a position.
Constructor Summary | |
---|---|
PolkaDot(int xPos,
int yPos,
java.awt.Color col,
int diameter)
Construct a polka dot with the specified attributes. |
|
PolkaDot(java.awt.Point point,
java.awt.Color col,
int diameter)
Construct a polka dot with the specified attributes. |
Method Summary | |
---|---|
void |
drawComponent(java.awt.Graphics2D graphics2D)
This method causes this polka dot to be drawn on the passed Graphics2D objects. |
static PolkaDot |
getRandom(int xDim,
int yDim)
This method generates a random polka dot, with a color randomly chosen among RGB and a position chosen randomly from within a palette of 6 basic colors (red, orange, yellow, green, blue, magenta). |
java.awt.Color |
getTheColor()
Get the color of this Polka Dot |
void |
setTheColor(java.awt.Color theColor)
Specify the color of this Polka Dot |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public PolkaDot(int xPos, int yPos, java.awt.Color col, int diameter)
xPos
- yPos
- col
- diameter
- public PolkaDot(java.awt.Point point, java.awt.Color col, int diameter)
point
- col
- diameter
- Method Detail |
---|
public void setTheColor(java.awt.Color theColor)
theColor
- public java.awt.Color getTheColor()
public void drawComponent(java.awt.Graphics2D graphics2D)
graphics2D
- public static PolkaDot getRandom(int xDim, int yDim)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |