|
Breakout Problem Set Javadocs | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object breakout.BasicPaddle
A basic implementation of the Paddle interface.
Field Summary | |
protected Board |
board
The Board containing this BasicPaddle |
protected int |
eastmost
Rightmost point able to be occupied by this BasicPaddle. |
protected java.awt.Point |
location
The location of this BasicPaddle. |
protected java.awt.Dimension |
size
The size of this BasicPaddle. |
protected int |
westmost
Leftmost point able to be occupied by this BasicPaddle. |
Constructor Summary | |
BasicPaddle(Board b)
Creates a BasicPaddle of a default size and location, belonging to a specified Board. |
Method Summary | |
java.awt.Point |
getLocation()
Gets the current location of this BasicPaddle. |
java.awt.Shape |
getShape()
Gets the java.awt.Shape of this BasicPaddle. |
java.awt.Dimension |
getSize()
Gets the size of this BasicPaddle. |
boolean |
hit(BreakoutComponent bc)
Called by a Rebounding BreakoutComponent when it has detected an intersection with this BasicPaddle. |
void |
mouseDragged(java.awt.event.MouseEvent me)
(unused) |
void |
mouseMoved(java.awt.event.MouseEvent me)
Listens to mouse movements, and sets the x-coordinate of the BasicPaddle accordingly. |
void |
paint(java.awt.Graphics g)
Paints the BasicPaddle. |
void |
setLocation(java.awt.Point p)
Inactive. |
void |
update()
Called by World every tick; does nothing. |
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
protected Board board
protected final int westmost
protected final int eastmost
Constructor Detail |
public BasicPaddle(Board b)
b
- the Board object of which this BasicPaddle is a member.Method Detail |
public void setLocation(java.awt.Point p)
setLocation
in interface BreakoutComponent
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 Rebounding/BreakoutComponent object that detected the hit.
false
-- a BasicPaddle 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 for this BasicPaddle's coordinate frame(ie, already located where we are).BoardPanel
public void mouseDragged(java.awt.event.MouseEvent me)
mouseDragged
in interface java.awt.event.MouseMotionListener
public void mouseMoved(java.awt.event.MouseEvent me)
this.westmost
and this.eastmost
.
mouseMoved
in interface java.awt.event.MouseMotionListener
|
Breakout Problem Set Javadocs | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |