java.lang.ObjectParticle
SquareParticle
public class SquareParticle
This particle is drawn as a square.
| Constructor Summary | |
|---|---|
SquareParticle(double hue,
double startX,
double startY,
int size)
Constructor that lets you determine color, start position, and size of the square. |
|
| Method Summary | |
|---|---|
void |
drawSelf(java.awt.Graphics graphics)
Draw this Particle onto the provided Graphics object as a square of the size determined in the constructor. |
| Methods inherited from class Particle |
|---|
getColor, getTimesMoved, getXPosition, getXVelocity, getYPosition, getYVelocity, setXPosition, setXVelocity, setYPosition, setYVelocity, takeOneStep |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public SquareParticle(double hue,
double startX,
double startY,
int size)
hue - A number from 0 to 1 that specifies desired hue of the
ParticlestartX - The starting x coordinatestartY - The starting y coordinatesize - The size of this rectangular particle| Method Detail |
|---|
public void drawSelf(java.awt.Graphics graphics)
drawSelf in class Particlegraphics - The Graphics object to draw onto.