|
Breakout Problem Set Javadocs | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object breakout.BasicBreakoutComponent
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 |
protected java.awt.Dimension size
protected java.awt.Point location
Constructor Detail |
public BasicBreakoutComponent()
public BasicBreakoutComponent(java.awt.Dimension newSize)
newSize
- a Dimension object representing the intended size of the BasicBreakoutComponent.Method Detail |
public void setLocation(java.awt.Point p)
setLocation
in interface BreakoutComponent
p
- a Point Object representing the intended location of the BasicBreakoutComponent.public java.awt.Point getLocation()
getLocation
in interface BreakoutComponent
public java.awt.Dimension getSize()
getSize
in interface BreakoutComponent
public void update()
update
in interface BreakoutComponent
public boolean hit(BreakoutComponent bc)
hit
in interface BreakoutComponent
bc
- the BreakoutComponent/Rebounding object that detected the intersection.
false
by default -- doesn't die when hit.public java.awt.Shape getShape()
getShape
in interface BreakoutComponent
public void paint(java.awt.Graphics g)
paint
in interface BreakoutComponent
g
- Graphics object of this BasicBreakoutComponent's coordinate frame
(ie, already located where we are).BoardPanel
|
Breakout Problem Set Javadocs | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |