Package org.opentrafficsim.draw.network
Class NodeAnimation
java.lang.Object
nl.tudelft.simulation.dsol.animation.D2.Renderable2D
org.opentrafficsim.draw.network.NodeAnimation
- All Implemented Interfaces:
java.io.Serializable,Renderable2DInterface,ClonableRenderable2DInterface
public class NodeAnimation extends Renderable2D implements ClonableRenderable2DInterface, java.io.Serializable
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: 2018-10-11 22:54:04 +0200 (Thu, 11 Oct 2018) $, @version $Revision: 4696 $, by $Author: averbraeck $,
initial version Oct 17, 2014
- Author:
- Alexander Verbraeck
- See Also:
- Serialized Form
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classNodeAnimation.ElevatedNodeClass for elevating the node for animation purposes.classNodeAnimation.TextText animation for the Node.Nested classes/interfaces inherited from interface nl.tudelft.simulation.dsol.animation.D2.Renderable2DInterface
Renderable2DInterface.Util -
Field Summary
Fields Modifier and Type Field Description static doubleZOFFSETEnsure that node animations are slightly above lane surface. -
Constructor Summary
Constructors Constructor Description NodeAnimation(Node node, SimulatorInterface.TimeDoubleUnit simulator) -
Method Summary
Modifier and Type Method Description ClonableRenderable2DInterfaceclone(Locatable newSource, SimulatorInterface.TimeDoubleUnit newSimulator)Clone the animation object and register it for the new source on the new simulation.voiddestroy()voidpaint(java.awt.Graphics2D graphics, java.awt.image.ImageObserver observer)java.lang.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
-
Field Details
-
ZOFFSET
public static final double ZOFFSETEnsure that node animations are slightly above lane surface.- See Also:
- Constant Field Values
-
-
Constructor Details
-
NodeAnimation
public NodeAnimation(Node node, SimulatorInterface.TimeDoubleUnit simulator) throws javax.naming.NamingException, java.rmi.RemoteException- Parameters:
node- Node; nsimulator- SimulatorInterface.TimeDoubleUnit; s- Throws:
javax.naming.NamingException- when animation context cannot be found.java.rmi.RemoteException- on communication failure
-
-
Method Details
-
paint
public final void paint(java.awt.Graphics2D graphics, java.awt.image.ImageObserver observer)- Specified by:
paintin classRenderable2D
-
destroy
public final void destroy() throws javax.naming.NamingException, java.rmi.RemoteException- Specified by:
destroyin interfaceRenderable2DInterface- Overrides:
destroyin classRenderable2D- Throws:
javax.naming.NamingExceptionjava.rmi.RemoteException
-
clone
public ClonableRenderable2DInterface clone(Locatable newSource, SimulatorInterface.TimeDoubleUnit newSimulator) throws javax.naming.NamingException, java.rmi.RemoteExceptionClone the animation object and register it for the new source on the new simulation.- Specified by:
clonein interfaceClonableRenderable2DInterface- Parameters:
newSource- T; the sourcenewSimulator- SimulatorInterface.TimeDoubleUnit; the simulator- Returns:
- the generated clone
- Throws:
javax.naming.NamingException- when animation context cannot be created or retrievedjava.rmi.RemoteException- - when remote context cannot be found
-
toString
public final java.lang.String toString()- Overrides:
toStringin classRenderable2D
-