|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Object | +--TrafficLight
| Constructor Summary | |
TrafficLight(Director director,
Road ewRoad,
Road nsRoad,
int timeLimit)
Create a new TrafficLight object with 4 lamps, one facing each cardinal direction, surrounding the center of an intersection. |
|
| Method Summary | |
void |
addTo(uwcse.graphics.GWindow g)
Add the elements of this display object to the graphics window. |
java.awt.Color |
getEastColor()
Return the color of the east-facing lamp. |
Road |
getEWRoad()
Return the East-West road running under this light. |
java.awt.Color |
getNorthColor()
Return the color of the north-facing lamp. |
Road |
getNSRoad()
Return the North-South road running under this light. |
java.awt.Color |
getSouthColor()
Return the color of the south-facing lamp. |
java.awt.Color |
getWestColor()
Return the color of the west-facing lamp. |
void |
removeFromWindow()
Remove the elements of this display object from the graphics window. |
void |
tick()
Count off a clock tick for this TrafficLight. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public TrafficLight(Director director,
Road ewRoad,
Road nsRoad,
int timeLimit)
director - the Director object which must be queried for Car informationewRoad - the East-West Road passing under this lightnsRoad - the North-South Road passing under this lighttimeLimit - the integer timeout value governing the frequency of light changes| Method Detail |
public void addTo(uwcse.graphics.GWindow g)
addTo in interface uwcse.animation.Propg - the graphics window to usepublic void removeFromWindow()
removeFromWindow in interface uwcse.animation.Proppublic void tick()
public java.awt.Color getNorthColor()
public java.awt.Color getEastColor()
public java.awt.Color getSouthColor()
public java.awt.Color getWestColor()
public Road getEWRoad()
public Road getNSRoad()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||