Package org.opentrafficsim.draw.road
Class SensorAnimation
java.lang.Object
nl.tudelft.simulation.dsol.animation.D2.Renderable2D<T>
org.opentrafficsim.draw.road.AbstractLineAnimation<SingleSensor>
org.opentrafficsim.draw.road.SensorAnimation
- All Implemented Interfaces:
Serializable,Renderable2DInterface<SingleSensor>,ClonableRenderable2DInterface<SingleSensor>
public class SensorAnimation extends AbstractLineAnimation<SingleSensor> implements ClonableRenderable2DInterface<SingleSensor>, Serializable
Sensor animation.
Copyright (c) 2013-2020 Delft University of Technology, PO Box 5, 2600 AA, Delft, the Netherlands.
All rights reserved.
BSD-style license. See OpenTrafficSim License.
$LastChangedDate: 2015-08-12 16:37:45 +0200 (Wed, 12 Aug 2015) $, @version $Revision: 1240 $, by $Author: averbraeck $,
initial version Jan 30, 2015
- Author:
- Alexander Verbraeck, Peter Knoppers
- See Also:
- Serialized Form
-
Nested Class Summary
Nested Classes Modifier and Type Class Description classSensorAnimation.TextText animation for the Sensor.Nested classes/interfaces inherited from interface nl.tudelft.simulation.dsol.animation.D2.Renderable2DInterface
Renderable2DInterface.Util -
Constructor Summary
Constructors Constructor Description SensorAnimation(SingleSensor sensor, Length sensorPosition, SimulatorInterface.TimeDoubleUnit simulator, Color color)Construct a SensorAnimation. -
Method Summary
Modifier and Type Method Description ClonableRenderable2DInterface<SingleSensor>clone(SingleSensor newSource, SimulatorInterface.TimeDoubleUnit newSimulator)Clone the animation object and register it for the new source on the new simulation.voiddestroy()SensorAnimation.TextgetText()voidpaint(Graphics2D graphics, ImageObserver observer)StringtoString()Methods inherited from class nl.tudelft.simulation.dsol.animation.D2.Renderable2D
bind2Context, contains, equals, getSource, hashCode, isFlip, isRotate, isScale, isTranslate, paint, setFlip, setRotate, setScale, setTranslateMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface nl.tudelft.simulation.dsol.animation.D2.Renderable2DInterface
contains, getSource, paint
-
Constructor Details
-
SensorAnimation
public SensorAnimation(SingleSensor sensor, Length sensorPosition, SimulatorInterface.TimeDoubleUnit simulator, Color color) throws NamingException, RemoteExceptionConstruct a SensorAnimation.- Parameters:
sensor- SingleSensor; the Sensor to drawsensorPosition- Length; the position of the sensor on the lane to determine the width of the lane at that pointsimulator- SimulatorInterface.TimeDoubleUnit; the simulator to schedule oncolor- Color; the display color of the sensor- Throws:
NamingException- in case of registration failure of the animationRemoteException- in case of remote registration failure of the animation
-
-
Method Details
-
getText
- Returns:
- text.
-
paint
- Overrides:
paintin classAbstractLineAnimation<SingleSensor>- Throws:
RemoteException
-
destroy
- Specified by:
destroyin interfaceRenderable2DInterface<SingleSensor>- Overrides:
destroyin classRenderable2D<SingleSensor>- Throws:
NamingExceptionRemoteException
-
clone
public ClonableRenderable2DInterface<SingleSensor> clone(SingleSensor newSource, SimulatorInterface.TimeDoubleUnit newSimulator) throws NamingException, RemoteExceptionClone the animation object and register it for the new source on the new simulation.- Specified by:
clonein interfaceClonableRenderable2DInterface<SingleSensor>- Parameters:
newSource- T; the sourcenewSimulator- SimulatorInterface.TimeDoubleUnit; the simulator- Returns:
- the generated clone
- Throws:
NamingException- when animation context cannot be created or retrievedRemoteException- - when remote context cannot be found
-
toString
- Overrides:
toStringin classRenderable2D<SingleSensor>
-