p_models
Class RunnableViewablePaddle
java.lang.Object
p_models.Paddle
p_models.RunnableViewablePaddle
- All Implemented Interfaces:
- java.lang.Runnable, PaddleSpecification, HasInvariant
public class RunnableViewablePaddle
- extends Paddle
- implements java.lang.Runnable
Implements Runnable
Extends Paddle
with link back to the view and a run method
For teaching MVC design pattern.
- Version:
- 1.0.0
- Author:
- J Paul Gibson
Field Summary |
static int |
DELAY
A 1/10th second delay between movements of Paddle |
Method Summary |
void |
run()
Every 10th of second:
update the paddle position
inform the view (if it has been initialised) of the update
|
void |
setView(PaddleViewSpecification paddleView2)
|
Methods inherited from class java.lang.Object |
getClass, hashCode, notify, notifyAll, wait, wait, wait |
DELAY
public static final int DELAY
- A 1/10th second delay between movements of Paddle
- See Also:
- Constant Field Values
RunnableViewablePaddle
public RunnableViewablePaddle()
setView
public void setView(PaddleViewSpecification paddleView2)
- Parameters:
paddleView2
- the current view which responds to state changes
run
public void run()
- Every 10th of second:
- update the paddle position
- inform the view (if it has been initialised) of the update
- Specified by:
run
in interface java.lang.Runnable