All Packages Class Hierarchy This Package Previous Next Index
java.lang.Object
|
+----gerken.vehicles.SimulationParticipant
|
+----gerken.vehicles.Light
A Light is a simulation participant that basically sits still and produces a constant light (much as you would expect). Its screen representation is that of a small colored circle, just as a light bulb might appear from the top. When the light is broken by a vehicle that gets too close, the light goes out.
This software is provided on an as-is basis and is copyright Chris Gerken. The only rights granted to you are to enjoy and learn from this software.
Return a light at location (x,y) which produces c colored light.
Tell the Light to display itself using the given Graphics.
Tell the Light to display itself as being broken using the given Graphics.
Return a string describing this light.
Answer true to indicate that this light does in fact have a location.
Perform light-specific simulation tasks
public Light(double x,
double y,
Color c)
Return a light at location (x,y) which produces c colored light. The light must still be registered with the scenario in order to participate in the simulation.
public void display(Graphics g)
Tell the Light to display itself using the given Graphics.
public void displayBroken(Graphics g)
Tell the Light to display itself as being broken using the given Graphics.
public String getDescription()
Return a string describing this light.
public boolean hasPointLocation()
Answer true to indicate that this light does in fact have a location.
public void step()
Perform light-specific simulation tasks
All Packages Class Hierarchy This Package Previous Next Index