Package org.opentrafficsim.draw.road
Class TrafficLightAnimation
java.lang.Object
nl.tudelft.simulation.dsol.animation.d2.Renderable2d<L>
org.opentrafficsim.base.geometry.OtsRenderable<T>
org.opentrafficsim.draw.road.AbstractLineAnimation<TrafficLightAnimation.TrafficLightData>
org.opentrafficsim.draw.road.TrafficLightAnimation
- All Implemented Interfaces:
Serializable
,nl.tudelft.simulation.dsol.animation.d2.Renderable2dInterface<TrafficLightAnimation.TrafficLightData>
public class TrafficLightAnimation
extends AbstractLineAnimation<TrafficLightAnimation.TrafficLightData>
Draw a traffic light on the road at th place where the cars are expected to stop.
Copyright (c) 2013-2024 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, Wouter Schakel
- See Also:
-
Nested Class Summary
Modifier and TypeClassDescriptionclass
Text animation for the TrafficLight.static interface
TrafficLightData provides the information required to draw a traffic light.Nested classes/interfaces inherited from class org.opentrafficsim.draw.road.AbstractLineAnimation
AbstractLineAnimation.LaneBasedObjectData
-
Field Summary
Fields inherited from class org.opentrafficsim.base.geometry.OtsRenderable
RENDERING_KEYS, RENDERING_VALUES
-
Constructor Summary
ConstructorDescriptionTrafficLightAnimation
(TrafficLightAnimation.TrafficLightData trafficLight, nl.tudelft.simulation.naming.context.Contextualized contextualized) Construct the DefaultCarAnimation for a LaneBlock (road block). -
Method Summary
Modifier and TypeMethodDescriptionvoid
destroy
(nl.tudelft.simulation.naming.context.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 org.opentrafficsim.base.geometry.OtsRenderable
contains, resetRendering, setRendering, toBoundsTransform
Methods inherited from class nl.tudelft.simulation.dsol.animation.d2.Renderable2d
bind2Context, getId, getSource, isFlip, isRotate, isScale, isScaleObject, isScaleY, isTranslate, paint, paintComponent, setFlip, setRotate, setScale, setScaleObject, setScaleY, setTranslate
-
Constructor Details
-
TrafficLightAnimation
public TrafficLightAnimation(TrafficLightAnimation.TrafficLightData trafficLight, nl.tudelft.simulation.naming.context.Contextualized contextualized) throws NamingException, RemoteException Construct the DefaultCarAnimation for a LaneBlock (road block).- Parameters:
trafficLight
- TrafficLightData; the traffic lightcontextualized
- Contextualized; context provider- Throws:
NamingException
- in case of registration failure of the animationRemoteException
- on communication failure
-
-
Method Details
-
getText
- Returns:
- text.
-
paint
- Overrides:
paint
in classAbstractLineAnimation<TrafficLightAnimation.TrafficLightData>
-
destroy
public void destroy(nl.tudelft.simulation.naming.context.Contextualized contextProvider) - Specified by:
destroy
in interfacenl.tudelft.simulation.dsol.animation.d2.Renderable2dInterface<TrafficLightAnimation.TrafficLightData>
- Overrides:
destroy
in classnl.tudelft.simulation.dsol.animation.d2.Renderable2d<TrafficLightAnimation.TrafficLightData>
-
toString
- Overrides:
toString
in classnl.tudelft.simulation.dsol.animation.d2.Renderable2d<TrafficLightAnimation.TrafficLightData>
-