Package org.opentrafficsim.draw.road
Class TrafficLightAnimation
java.lang.Object
nl.tudelft.simulation.dsol.animation.D2.Renderable2D<T>
org.opentrafficsim.draw.road.AbstractLineAnimation<TrafficLight>
org.opentrafficsim.draw.road.TrafficLightAnimation
- All Implemented Interfaces:
Serializable
,nl.tudelft.simulation.dsol.animation.D2.Renderable2DInterface<TrafficLight>
public class TrafficLightAnimation
extends AbstractLineAnimation<TrafficLight>
implements nl.tudelft.simulation.dsol.animation.D2.Renderable2DInterface<TrafficLight>, Serializable
Draw a traffic light on the road at th place where the cars are expected to stop.
Copyright (c) 2013-2023 Delft University of Technology, PO Box 5, 2600 AA, Delft, the Netherlands. All rights reserved.
BSD-style license. See OpenTrafficSim License.
- Author:
- Alexander Verbraeck, Peter Knoppers
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionclass
Text animation for the TrafficLight. -
Constructor Summary
ConstructorsConstructorDescriptionTrafficLightAnimation
(TrafficLight trafficLight, org.opentrafficsim.core.dsol.OtsSimulatorInterface simulator) Construct the DefaultCarAnimation for a LaneBlock (road block). -
Method Summary
Modifier and TypeMethodDescriptionvoid
destroy
(Contextualized contextProvider) getText()
final void
paint
(Graphics2D graphics, ImageObserver observer) final String
toString()
Methods inherited from class org.opentrafficsim.draw.road.AbstractLineAnimation
getHalfLength
Methods inherited from class nl.tudelft.simulation.dsol.animation.D2.Renderable2D
bind2Context, contains, getId, getSource, isFlip, isRotate, isScale, isScaleObject, isScaleY, isTranslate, paint, paintComponent, setFlip, setRotate, setScale, setScaleObject, setScaleY, setTranslate
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface nl.tudelft.simulation.dsol.animation.D2.Renderable2DInterface
contains, getId, getSource, paintComponent
-
Constructor Details
-
TrafficLightAnimation
public TrafficLightAnimation(TrafficLight trafficLight, org.opentrafficsim.core.dsol.OtsSimulatorInterface simulator) throws NamingException, RemoteException Construct the DefaultCarAnimation for a LaneBlock (road block).- Parameters:
trafficLight
- TrafficLight; the CSEBlock to drawsimulator
- OtsSimulatorInterface; the simulator to schedule on- Throws:
NamingException
- in case of registration failure of the animationRemoteException
- on communication failure
-
-
Method Details
-
getText
- Returns:
- text.
-
paint
- Overrides:
paint
in classAbstractLineAnimation<TrafficLight>
-
destroy
- Specified by:
destroy
in interfacenl.tudelft.simulation.dsol.animation.D2.Renderable2DInterface<TrafficLight>
- Overrides:
destroy
in classnl.tudelft.simulation.dsol.animation.D2.Renderable2D<TrafficLight>
-
toString
- Overrides:
toString
in classnl.tudelft.simulation.dsol.animation.D2.Renderable2D<TrafficLight>
-