Class NetworkAnimation
java.lang.Object
nl.tudelft.simulation.event.EventProducer
org.opentrafficsim.core.animation.network.NetworkAnimation
- All Implemented Interfaces:
Serializable,EventListener,EventListenerInterface,EventProducerInterface
public class NetworkAnimation extends EventProducer implements EventListenerInterface
NetworkAnimation stores the relations between drawable objects and their drawing info.
Copyright (c) 2003-2019 Delft University of Technology, Jaffalaan 5, 2628 BX Delft, the Netherlands. All rights reserved. See for project information www.simulation.tudelft.nl. The source code and binary code of this software is proprietary information of Delft University of Technology.
Copyright (c) 2003-2019 Delft University of Technology, Jaffalaan 5, 2628 BX Delft, the Netherlands. All rights reserved. See for project information www.simulation.tudelft.nl. The source code and binary code of this software is proprietary information of Delft University of Technology.
- Author:
- Alexander Verbraeck
- See Also:
- Serialized Form
-
Field Summary
Fields inherited from interface nl.tudelft.simulation.event.EventProducerInterface
FIRST_POSITION, LAST_POSITION -
Constructor Summary
Constructors Constructor Description NetworkAnimation(Network network)Construct this NetworkAnimation object with a connection to the Network. -
Method Summary
Modifier and Type Method Description voidaddDrawingInfoBase(Drawable drawable, DrawingInfo drawingInfo)Add the drawing info for an instance.voidaddDrawingInfoClass(Class<? extends Drawable> drawableClass, DrawingInfo drawingInfo)Add the drawing info for a class.voidaddDrawingInfoDynamic(Drawable drawable, DrawingInfo drawingInfo)Add the dynamic drawing information for an instance.DrawingInfogetDrawingInfo(Drawable drawable)Get the drawing information for a drawable instance.DrawingInfogetDrawingInfoBase(Drawable drawable)Get the static drawing information for a drawable instance.DrawingInfogetDrawingInfoClass(Class<? extends Drawable> drawableClass)Get the static class-based drawing information for a drawable instance.NetworkgetNetwork()voidnotify(EventInterface event)Methods inherited from class nl.tudelft.simulation.event.EventProducer
addListener, addListener, addListener, addListener, fireEvent, fireEvent, fireEvent, fireEvent, fireEvent, fireEvent, fireEvent, fireEvent, fireEvent, fireEvent, fireTimedEvent, fireTimedEvent, fireTimedEvent, fireTimedEvent, fireTimedEvent, fireTimedEvent, fireTimedEvent, removeAllListeners, removeAllListeners, removeListener
-
Constructor Details
-
NetworkAnimation
Construct this NetworkAnimation object with a connection to the Network.- Parameters:
network- Network; the network to which the animation info is connected- Throws:
RemoteException- in case of remote events and network error
-
-
Method Details
-
addDrawingInfoClass
Add the drawing info for a class. Here it can e.g., be specified that all lanes are filled with a light gray color and drawn with a dark gray stroke. The class drawing info can be cached.- Parameters:
drawableClass- Class<? extends Drawable>; the class to set the drawing info fordrawingInfo- DrawingInfo; the default drawing info for the class
-
addDrawingInfoBase
Add the drawing info for an instance. This overrides the drawing info for the class. An example is that a bus lane can be drawn using a black color to make it different from the standard lanes. The base drawing info can be cached.- Parameters:
drawable- Drawable; the object to set the drawing info fordrawingInfo- DrawingInfo; the default drawing info for the drawable
-
addDrawingInfoDynamic
Add the dynamic drawing information for an instance. This overrides the drawing info for the object and the class, and should not be cached. An example is that a lane on a highway that turns red when it is forbidden for traffic to use the lane.- Parameters:
drawable- Drawable; the object to set the drawing info fordrawingInfo- DrawingInfo; the dynamic drawing info for the drawable
-
getDrawingInfo
Get the drawing information for a drawable instance. It first checks the dynamic info, then the base info, and then the class info.- Parameters:
drawable- Drawable; the object to get the drawing info for- Returns:
- DrawingInfo; the drawing info for the instance, or null if no Drawing info could be found
-
getDrawingInfoBase
Get the static drawing information for a drawable instance. It first checks the base info, and then the class info.- Parameters:
drawable- Drawable; the object to get the drawing info for- Returns:
- DrawingInfo; the drawing info for the instance, or null if no Drawing info could be found
-
getDrawingInfoClass
Get the static class-based drawing information for a drawable instance.- Parameters:
drawableClass- Class<? extends Drawable>; the class to get the drawing info for- Returns:
- DrawingInfo; the drawing info for the class, or null if no Drawing info could be found
-
getNetwork
- Returns:
- the network backed by this NetworkAnimation object
-
notify
- Specified by:
notifyin interfaceEventListenerInterface- Throws:
RemoteException
-