Class NextButtonListener
java.lang.Object
|
+--NextButtonListener
- All Implemented Interfaces:
- ActionListener, EventListener
- public class NextButtonListener
- extends Object
- implements ActionListener
A NextButtonListener sends a "next" message to its
Sequencer each time a button to which it is listening
is pressed.
- Version:
- 1
Constructor Summary |
NextButtonListener(Sequencer sequencer)
Construct a listener that "listens for" a user's
pressing the "Next" button. |
Method Summary |
void |
actionPerformed(ActionEvent event)
The action performed when a push of the button is detected:
send a next message to the Sequencer to advance it to
its next state. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
NextButtonListener
public NextButtonListener(Sequencer sequencer)
- Construct a listener that "listens for" a user's
pressing the "Next" button.
- Parameters:
sequencer
- the Sequencer for the TrafficLight.
actionPerformed
public void actionPerformed(ActionEvent event)
- The action performed when a push of the button is detected:
send a next message to the Sequencer to advance it to
its next state.
- Specified by:
actionPerformed
in interface ActionListener
- Parameters:
event
- the event detected at the button.