Package org.opentrafficsim.draw.road
Class LaneDetectorAnimation<L extends LaneDetectorAnimation.LaneDetectorData,T extends TextAnimation<L,T>>
java.lang.Object
nl.tudelft.simulation.dsol.animation.d2.Renderable2d<L>
org.opentrafficsim.draw.OtsRenderable<T>
org.opentrafficsim.draw.road.AbstractLineAnimation<L>
org.opentrafficsim.draw.road.LaneDetectorAnimation<L,T>
- Type Parameters:
L- detector data typeT- text type
- All Implemented Interfaces:
Serializable,nl.tudelft.simulation.dsol.animation.d2.Renderable2dInterface<L>
public class LaneDetectorAnimation<L extends LaneDetectorAnimation.LaneDetectorData,T extends TextAnimation<L,T>>
extends AbstractLineAnimation<L>
Draw LaneDetectorData.
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
Nested ClassesModifier and TypeClassDescriptionstatic interfaceLaneDetectorData provides the information required to draw a lane detector.static interfaceSinkData provides the information required to draw a sink.static interfaceSinkData provides the information required to draw a sink.static classText animation for the Detector.Nested classes/interfaces inherited from class org.opentrafficsim.draw.road.AbstractLineAnimation
AbstractLineAnimation.LaneBasedObjectData -
Constructor Summary
ConstructorsConstructorDescriptionLaneDetectorAnimation(L laneDetector, nl.tudelft.simulation.naming.context.Contextualized contextualized, Color color, Function<LaneDetectorAnimation<L, T>, T> textSupplier) This constructor uses a provider for the text animation. -
Method Summary
Modifier and TypeMethodDescriptionvoiddestroy(nl.tudelft.simulation.naming.context.Contextualized contextProvider) final TgetText()ofGenericType(LaneDetectorAnimation.LaneDetectorData laneDetector, nl.tudelft.simulation.naming.context.Contextualized contextualized, Color color) This method produces a detector animation that toggles generally for all LaneDetectorData and its respective text id.final voidpaint(Graphics2D graphics, ImageObserver observer) final StringtoString()Methods inherited from class org.opentrafficsim.draw.OtsRenderable
contains, resetRendering, setRenderingMethods 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
-
LaneDetectorAnimation
public LaneDetectorAnimation(L laneDetector, nl.tudelft.simulation.naming.context.Contextualized contextualized, Color color, Function<LaneDetectorAnimation<L, T>, throws NamingException, RemoteExceptionT> textSupplier) This constructor uses a provider for the text animation. This should provide an animation that extendsTextAnimationand implements the right tagging interface to toggle the correct label belonging to L. Alternatively, the toggle can be specified to the class that extendsTextAnimationdirectly.- Parameters:
laneDetector- the lane detector to draw.contextualized- context provider.color- the display color of the detector.textSupplier- text supplier.- Throws:
NamingException- in case of registration failure of the animationRemoteException- in case of remote registration failure of the animation
-
-
Method Details
-
ofGenericType
public static LaneDetectorAnimation<LaneDetectorAnimation.LaneDetectorData,LaneDetectorAnimation.Text> ofGenericType(LaneDetectorAnimation.LaneDetectorData laneDetector, nl.tudelft.simulation.naming.context.Contextualized contextualized, Color color) throws RemoteException, NamingException This method produces a detector animation that toggles generally for all LaneDetectorData and its respective text id.- Parameters:
laneDetector- detector data.contextualized- context provider.color- color.- Returns:
- animation for generic lane detector type.
- Throws:
NamingException- in case of registration failure of the animationRemoteException- in case of remote registration failure of the animation
-
getText
- Returns:
- text.
-
paint
- Overrides:
paintin classAbstractLineAnimation<L extends LaneDetectorAnimation.LaneDetectorData>
-
destroy
public void destroy(nl.tudelft.simulation.naming.context.Contextualized contextProvider) - Specified by:
destroyin interfacenl.tudelft.simulation.dsol.animation.d2.Renderable2dInterface<L extends LaneDetectorAnimation.LaneDetectorData>- Overrides:
destroyin classnl.tudelft.simulation.dsol.animation.d2.Renderable2d<L extends LaneDetectorAnimation.LaneDetectorData>
-
toString
- Overrides:
toStringin classnl.tudelft.simulation.dsol.animation.d2.Renderable2d<L extends LaneDetectorAnimation.LaneDetectorData>
-