Package org.opentrafficsim.draw.network
Class NodeAnimation
- java.lang.Object
-
- nl.tudelft.simulation.dsol.animation.D2.Renderable2D<NodeAnimation.ElevatedNode>
-
- org.opentrafficsim.draw.network.NodeAnimation
-
- All Implemented Interfaces:
Serializable
,Renderable2DInterface<NodeAnimation.ElevatedNode>
,ClonableRenderable2DInterface<NodeAnimation.ElevatedNode>
public class NodeAnimation extends Renderable2D<NodeAnimation.ElevatedNode> implements ClonableRenderable2DInterface<NodeAnimation.ElevatedNode>, Serializable
Copyright (c) 2013-2022 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 class
NodeAnimation.ElevatedNode
Class for elevating the node for animation purposes.class
NodeAnimation.Text
Text animation for the Node.
-
Field Summary
Fields Modifier and Type Field Description static double
ZOFFSET
Ensure that node animations are slightly above lane surface.
-
Constructor Summary
Constructors Constructor Description NodeAnimation(org.opentrafficsim.core.network.Node node, org.opentrafficsim.core.dsol.OTSSimulatorInterface simulator)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ClonableRenderable2DInterface<NodeAnimation.ElevatedNode>
clone(NodeAnimation.ElevatedNode newSource, org.opentrafficsim.core.dsol.OTSSimulatorInterface newSimulator)
Clone the animation object and register it for the new source on the new simulation.void
destroy(Contextualized contextProvider)
void
paint(Graphics2D graphics, ImageObserver observer)
String
toString()
-
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
-
-
-
-
Field Detail
-
ZOFFSET
public static final double ZOFFSET
Ensure that node animations are slightly above lane surface.- See Also:
- Constant Field Values
-
-
Constructor Detail
-
NodeAnimation
public NodeAnimation(org.opentrafficsim.core.network.Node node, org.opentrafficsim.core.dsol.OTSSimulatorInterface simulator) throws NamingException, RemoteException
- Parameters:
node
- Node; nsimulator
- OTSSimulatorInterface; s- Throws:
NamingException
- when animation context cannot be found.RemoteException
- on communication failure
-
-
Method Detail
-
paint
public final void paint(Graphics2D graphics, ImageObserver observer)
- Specified by:
paint
in classRenderable2D<NodeAnimation.ElevatedNode>
-
destroy
public void destroy(Contextualized contextProvider)
- Specified by:
destroy
in interfaceRenderable2DInterface<NodeAnimation.ElevatedNode>
- Overrides:
destroy
in classRenderable2D<NodeAnimation.ElevatedNode>
-
clone
public ClonableRenderable2DInterface<NodeAnimation.ElevatedNode> clone(NodeAnimation.ElevatedNode newSource, org.opentrafficsim.core.dsol.OTSSimulatorInterface newSimulator) throws NamingException, RemoteException
Clone the animation object and register it for the new source on the new simulation.- Specified by:
clone
in interfaceClonableRenderable2DInterface<NodeAnimation.ElevatedNode>
- Parameters:
newSource
- T; the sourcenewSimulator
- OTSSimulatorInterface; the simulator- Returns:
- the generated clone
- Throws:
NamingException
- when animation context cannot be created or retrievedRemoteException
- - when remote context cannot be found
-
toString
public final String toString()
- Overrides:
toString
in classRenderable2D<NodeAnimation.ElevatedNode>
-
-