Package
Class
Tree
Index
Help
PREV NEXT
FRAMES
NO FRAMES
All Classes
A
L
M
N
P
S
T
A
actionPerformed(ActionEvent)
- Method in class
NextButtonListener
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.
L
Lens
- class
Lens
.
A Lens has a certain color and can either be turned on (the color) or turned off (black).
Lens(Color)
- Constructor for class
Lens
Construct a Lens to display a given color.
M
main(String[])
- Static method in class
TrafficLight
The traffic light simulation starts at main.
N
next()
- Method in class
Sequencer
How the light changes when a next Button is pressed depends on the current state.
NextButtonListener
- class
NextButtonListener
.
A NextButtonListener sends a "next" message to its Sequencer each time a button to which it is listening is pressed.
NextButtonListener(Sequencer)
- Constructor for class
NextButtonListener
Construct a listener that "listens for" a user's pressing the "Next" button.
P
paint(Graphics)
- Method in class
Lens
How this Lens paints itself.
S
Sequencer
- class
Sequencer
.
A Sequencer controls a TrafficLight.
Sequencer(TrafficLight)
- Constructor for class
Sequencer
Construct a sequencer to control a TrafficLight.
setCaution()
- Method in class
TrafficLight
Set the light to caution (yellow).
setGo()
- Method in class
TrafficLight
Set the light to go (green).
setStop()
- Method in class
TrafficLight
Set the light to stop (red).
setWalk()
- Method in class
TrafficLight
Set the light to walk.
T
TrafficLight
- class
TrafficLight
.
A TrafficLight has three lenses: red, yellow and green.
TrafficLight()
- Constructor for class
TrafficLight
Construct a traffic light.
turnOff()
- Method in class
Lens
Darken this lens.
turnOn()
- Method in class
Lens
Have this Lens display its color.
A
L
M
N
P
S
T
Package
Class
Tree
Index
Help
PREV NEXT
FRAMES
NO FRAMES
All Classes