A C D G M R S

A

action() - Method in class Director
Direct the action on stage.
addTo(GWindow) - Method in class Car
Add the elements of this display object to the graphics window.
addTo(GWindow) - Method in class Road
Add the elements of this display object to the graphics window.
advance() - Method in class Car
This method moves the car a little bit.

C

Car - class Car.
This class models a car in our scene.
Car(Director, Road, char, int, int, int, Color) - Constructor for class Car
Construct the Rectangle avatar for the Car given the Road it is on and the direction of travel.
carIsOnRoad(Road) - Method in class Car
This method checks whether the Car is on a given Road by checking its upper left corner against the boundaries of the Road.
createProps() - Method in class Director
Add all the stationary props to the stage.

D

Director - class Director.
This class creates a graphics window, adds Props to the scene, and controls their actions.
Director() - Constructor for class Director
Create a new Director and all the required accessories.

G

getCrossRoad() - Method in class Car
This method checks the coordinates of all Roads (other than the one the Car is intended to be traveling on) to see if the Car also happens to be on one of those Roads.
getCurrentRoad() - Method in class Car
Return the Road that the Car is currently traveling along.
getHeight() - Method in class Road
Return the y-span of the Road.
getRoad(int) - Method in class Director
Return the Road with this number or null if there is none
getWidth() - Method in class Road
Return the x-span of the Road.
getX() - Method in class Road
Return the x-coordinate of the upper left corner of the Road.
getY() - Method in class Road
Return the y-coordinate of the upper left corner of the Road.

M

main(String[]) - Static method in class Director
The main() method instantiates a new Director object, creates the Props, starts the action, and displays a notice when the Action is complete.

R

removeFromWindow() - Method in class Car
Remove the elements of this display object from the graphics window.
removeFromWindow() - Method in class Road
Remove the elements of this display object from the graphics window.
Road - class Road.
This class models a roadway in our scene.
Road(int, int, int, int, boolean) - Constructor for class Road
Construct the surface and the centerline of the road given the parameters.
roadIsEastWest() - Method in class Road
Returns a boolean regarding orientation of the Road

S

speedUpIfInNewIntersection() - Method in class Car
This method asks getCrossRoad() if the Car is in any intersection.

A C D G M R S