Class AbstractLineAnimation<T extends LaneBasedObject>

java.lang.Object
nl.tudelft.simulation.dsol.animation.D2.Renderable2D<T>
org.opentrafficsim.draw.road.AbstractLineAnimation<T>
Type Parameters:
T - the LaneBasedObject class of the source that indicates the location of the Renderable on the screen
All Implemented Interfaces:
Serializable, nl.tudelft.simulation.dsol.animation.D2.Renderable2DInterface<T>
Direct Known Subclasses:
BusStopAnimation, ConflictAnimation, DestinationAnimation, DetectorAnimation, SinkAnimation, TrafficLightAnimation

public abstract class AbstractLineAnimation<T extends LaneBasedObject> extends nl.tudelft.simulation.dsol.animation.D2.Renderable2D<T>
Abstract class for objects that draw a line perpendicular on the lane.

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, Wouter Schakel
See Also:
  • Constructor Summary

    Constructors
    Constructor
    Description
    AbstractLineAnimation(T source, org.opentrafficsim.core.dsol.OtsSimulatorInterface simulator, double length, Length width)
    Construct the line animation.
  • Method Summary

    Modifier and Type
    Method
    Description
    final double
    Returns half the length.
    void
    paint(Graphics2D graphics, ImageObserver observer)

    Methods inherited from class nl.tudelft.simulation.dsol.animation.D2.Renderable2D

    bind2Context, contains, destroy, getId, getSource, isFlip, isRotate, isScale, isScaleObject, isScaleY, isTranslate, paint, paintComponent, setFlip, setRotate, setScale, setScaleObject, setScaleY, setTranslate, toString

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
  • Constructor Details

    • AbstractLineAnimation

      public AbstractLineAnimation(T source, org.opentrafficsim.core.dsol.OtsSimulatorInterface simulator, double length, Length width) throws NamingException, RemoteException
      Construct the line animation.
      Parameters:
      source - T; source
      simulator - OtsSimulatorInterface; the simulator to schedule on
      length - double; length of the line, as fraction of the lane width
      width - Length; line width
      Throws:
      NamingException - in case of registration failure of the animation
      RemoteException - in case of remote registration failure of the animation
  • Method Details

    • getHalfLength

      public final double getHalfLength()
      Returns half the length.
      Returns:
      half the length
    • paint

      public void paint(Graphics2D graphics, ImageObserver observer)
      Specified by:
      paint in class nl.tudelft.simulation.dsol.animation.D2.Renderable2D<T extends LaneBasedObject>