Package org.opentrafficsim.draw.gtu
Class DefaultCarAnimation
java.lang.Object
nl.tudelft.simulation.dsol.animation.D2.Renderable2D<LaneBasedGtu>
org.opentrafficsim.draw.gtu.DefaultCarAnimation
- All Implemented Interfaces:
Serializable
,nl.tudelft.simulation.dsol.animation.D2.Renderable2DInterface<LaneBasedGtu>
public class DefaultCarAnimation
extends nl.tudelft.simulation.dsol.animation.D2.Renderable2D<LaneBasedGtu>
implements nl.tudelft.simulation.dsol.animation.D2.Renderable2DInterface<LaneBasedGtu>, Serializable
Draw a car.
Copyright (c) 2013-2023 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
- See Also:
-
Nested Class Summary
Nested Classes -
Constructor Summary
ConstructorsConstructorDescriptionDefaultCarAnimation
(LaneBasedGtu gtu, org.opentrafficsim.core.dsol.OtsSimulatorInterface simulator) Construct the DefaultCarAnimation for a LaneBasedIndividualCar.DefaultCarAnimation
(LaneBasedGtu gtu, org.opentrafficsim.core.dsol.OtsSimulatorInterface simulator, GtuColorer gtuColorer) Construct the DefaultCarAnimation for a LaneBasedIndividualCar. -
Method Summary
Modifier and TypeMethodDescriptionvoid
destroy
(Contextualized contextProvider) boolean
int
hashCode()
final void
paint
(Graphics2D graphics, ImageObserver observer) final void
setGtuColorer
(GtuColorer newGtuColorer) Replace the GtuColorer.final 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, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface nl.tudelft.simulation.dsol.animation.D2.Renderable2DInterface
contains, getId, getSource, paintComponent
-
Constructor Details
-
DefaultCarAnimation
public DefaultCarAnimation(LaneBasedGtu gtu, org.opentrafficsim.core.dsol.OtsSimulatorInterface simulator) throws NamingException, RemoteException Construct the DefaultCarAnimation for a LaneBasedIndividualCar.- Parameters:
gtu
- LaneBasedGtu; the Car to drawsimulator
- OtsSimulatorInterface; the simulator to schedule on- Throws:
NamingException
- in case of registration failure of the animationRemoteException
- on communication failure
-
DefaultCarAnimation
public DefaultCarAnimation(LaneBasedGtu gtu, org.opentrafficsim.core.dsol.OtsSimulatorInterface simulator, GtuColorer gtuColorer) throws NamingException, RemoteException Construct the DefaultCarAnimation for a LaneBasedIndividualCar.- Parameters:
gtu
- LaneBasedGtu; the Car to drawsimulator
- OtsSimulatorInterface; the simulator to schedule ongtuColorer
- GtuColorer; the GtuColorer that determines what fill color to use- Throws:
NamingException
- in case of registration failure of the animationRemoteException
- on communication failure
-
-
Method Details
-
setGtuColorer
Replace the GtuColorer.- Parameters:
newGtuColorer
- GtuColorer; the GtuColorer to use from now on
-
paint
- Specified by:
paint
in classnl.tudelft.simulation.dsol.animation.D2.Renderable2D<LaneBasedGtu>
-
destroy
- Specified by:
destroy
in interfacenl.tudelft.simulation.dsol.animation.D2.Renderable2DInterface<LaneBasedGtu>
- Overrides:
destroy
in classnl.tudelft.simulation.dsol.animation.D2.Renderable2D<LaneBasedGtu>
-
toString
- Overrides:
toString
in classnl.tudelft.simulation.dsol.animation.D2.Renderable2D<LaneBasedGtu>
-
hashCode
public int hashCode() -
equals
-