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
    Modifier and Type
    Class
    Description
    class 
    Text animation for the Car.
  • Constructor Summary

    Constructors
    Constructor
    Description
    DefaultCarAnimation(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 Type
    Method
    Description
    void
    destroy(Contextualized contextProvider)
    boolean
    equals(Object object)
    int
    final void
    paint(Graphics2D graphics, ImageObserver observer)
    final void
    setGtuColorer(GtuColorer newGtuColorer)
    Replace the GtuColorer.
    final String

    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 draw
      simulator - OtsSimulatorInterface; the simulator to schedule on
      Throws:
      NamingException - in case of registration failure of the animation
      RemoteException - 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 draw
      simulator - OtsSimulatorInterface; the simulator to schedule on
      gtuColorer - GtuColorer; the GtuColorer that determines what fill color to use
      Throws:
      NamingException - in case of registration failure of the animation
      RemoteException - on communication failure
  • Method Details

    • setGtuColorer

      public final void setGtuColorer(GtuColorer newGtuColorer)
      Replace the GtuColorer.
      Parameters:
      newGtuColorer - GtuColorer; the GtuColorer to use from now on
    • paint

      public final void paint(Graphics2D graphics, ImageObserver observer)
      Specified by:
      paint in class nl.tudelft.simulation.dsol.animation.D2.Renderable2D<LaneBasedGtu>
    • destroy

      public void destroy(Contextualized contextProvider)
      Specified by:
      destroy in interface nl.tudelft.simulation.dsol.animation.D2.Renderable2DInterface<LaneBasedGtu>
      Overrides:
      destroy in class nl.tudelft.simulation.dsol.animation.D2.Renderable2D<LaneBasedGtu>
    • toString

      public final String toString()
      Overrides:
      toString in class nl.tudelft.simulation.dsol.animation.D2.Renderable2D<LaneBasedGtu>
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • equals

      public boolean equals(Object object)
      Overrides:
      equals in class Object