public interface MoveListener
Any class that wants to be updated automatically by a MoveProvider should implement this interface. Both movementStarted() and movementStopped() also return a MoveProvider object.
There are several practical scenarios to use a MoveListener. If you have a robot that has a range scanner pointed forward and mounted on a motor, a MoveListener could listen for arc movements and rotate the scanner left or right if the vehicle begins steering around a corner so the sensor is pointed where the robot is traveling.
In another scenario, a MoveListener GUI can listen for movements from multiple MovementProviders. It might want to draw one robot as blue, one as green, one as red, etc.. The MoveProvider allows it to differentiate the MovementProviders from one another.
Modifier and Type | Method and Description |
---|---|
void |
moveStarted(Move event,
MoveProvider mp)
Called when a Move Provider starts a move
|
void |
moveStopped(Move event,
MoveProvider mp)
Called by the movement provider when a move stops
|
void moveStarted(Move event, MoveProvider mp)
event
- the movementmp
- the movement providervoid moveStopped(Move event, MoveProvider mp)
event
- the movementmp
- movement provider