Class SquareParticle

java.lang.Object
  extended by Particle
      extended by SquareParticle

public class SquareParticle
extends Particle

This particle is drawn as a square.

Author:
Tim

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

SquareParticle

public SquareParticle(double hue,
                      double startX,
                      double startY,
                      int size)
Constructor that lets you determine color, start position, and size of the square.

Parameters:
hue - A number from 0 to 1 that specifies desired hue of the Particle
startX - The starting x coordinate
startY - The starting y coordinate
size - The size of this rectangular particle
Method Detail

drawSelf

public void drawSelf(java.awt.Graphics graphics)
Draw this Particle onto the provided Graphics object as a square of the size determined in the constructor.

Overrides:
drawSelf in class Particle
Parameters:
graphics - The Graphics object to draw onto.