Breakout Problem Set Javadocs

breakout
Class BasicBreakoutComponent

java.lang.Object
  extended bybreakout.BasicBreakoutComponent
All Implemented Interfaces:
BreakoutComponent

public class BasicBreakoutComponent
extends java.lang.Object
implements BreakoutComponent

Pretty much as basic a BreakoutComponent as you can get. Okay, so it's green, and it does have a default size, but other than that, basic basic.


Field Summary
protected  java.awt.Point location
          The location of this BasicBreakoutComponent.
protected  java.awt.Dimension size
          The size of this BasicBreakoutComponent.
 
Constructor Summary
BasicBreakoutComponent()
          Creates a BasicBreakoutComonent of default size(60x20).
BasicBreakoutComponent(java.awt.Dimension newSize)
          Creates a BasicBreakoutComponent of specified size.
 
Method Summary
 java.awt.Point getLocation()
          Gets the location of this BasicBreakoutComponent.
 java.awt.Shape getShape()
          Gets the java.awt.Shape of this BasicBreakoutComponent.
 java.awt.Dimension getSize()
          Gets the size of this BasicBreakoutComponent.
 boolean hit(BreakoutComponent bc)
          Called by a Rebounding BreakoutComponent when it has detected an intersection with this BasicBreakoutComponent.
 void paint(java.awt.Graphics g)
          Paints the BasicBreakoutComponent.
 void setLocation(java.awt.Point p)
          Sets the location of this BasicBreakoutComponent.
 void update()
          Called by World every tick; empty method.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

size

protected java.awt.Dimension size
The size of this BasicBreakoutComponent.


location

protected java.awt.Point location
The location of this BasicBreakoutComponent.

Constructor Detail

BasicBreakoutComponent

public BasicBreakoutComponent()
Creates a BasicBreakoutComonent of default size(60x20).


BasicBreakoutComponent

public BasicBreakoutComponent(java.awt.Dimension newSize)
Creates a BasicBreakoutComponent of specified size.

Parameters:
newSize - a Dimension object representing the intended size of the BasicBreakoutComponent.
Method Detail

setLocation

public void setLocation(java.awt.Point p)
Sets the location of this BasicBreakoutComponent.

Specified by:
setLocation in interface BreakoutComponent
Parameters:
p - a Point Object representing the intended location of the BasicBreakoutComponent.

getLocation

public java.awt.Point getLocation()
Gets the location of this BasicBreakoutComponent.

Specified by:
getLocation in interface BreakoutComponent
Returns:
A new Point object representing this BasicBreakoutComponent's current location.

getSize

public java.awt.Dimension getSize()
Gets the size of this BasicBreakoutComponent.

Specified by:
getSize in interface BreakoutComponent
Returns:
A new Dimension object representing this BasicBreakoutComponent's size.

update

public void update()
Called by World every tick; empty method.

Specified by:
update in interface BreakoutComponent

hit

public boolean hit(BreakoutComponent bc)
Called by a Rebounding BreakoutComponent when it has detected an intersection with this BasicBreakoutComponent.

Specified by:
hit in interface BreakoutComponent
Parameters:
bc - the BreakoutComponent/Rebounding object that detected the intersection.
Returns:
false by default -- doesn't die when hit.

getShape

public java.awt.Shape getShape()
Gets the java.awt.Shape of this BasicBreakoutComponent.

Specified by:
getShape in interface BreakoutComponent
Returns:
a new Shape label at the same location and of the same size/shape as this BasicBreakoutComponent.

paint

public void paint(java.awt.Graphics g)
Paints the BasicBreakoutComponent. It happens to be green, and rectangular. So there.

Specified by:
paint in interface BreakoutComponent
Parameters:
g - Graphics object of this BasicBreakoutComponent's coordinate frame (ie, already located where we are).
See Also:
BoardPanel

Breakout Problem Set Javadocs