Class LinkAnimation

java.lang.Object
nl.tudelft.simulation.dsol.animation.D2.Renderable2D<Link>
org.opentrafficsim.draw.network.LinkAnimation
All Implemented Interfaces:
java.io.Serializable, Renderable2DInterface<Link>, ClonableRenderable2DInterface<Link>

public class LinkAnimation
extends Renderable2D<Link>
implements ClonableRenderable2DInterface<Link>, java.io.Serializable
Draws a Link.

Copyright (c) 2013-2019 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 Sep 13, 2014

Author:
Alexander Verbraeck
See Also:
Serialized Form
  • Constructor Details

    • LinkAnimation

      public LinkAnimation​(Link link, SimulatorInterface.TimeDoubleUnit simulator, float width) throws javax.naming.NamingException, java.rmi.RemoteException
      Parameters:
      link - Link; Link
      simulator - SimulatorInterface.TimeDoubleUnit; simulator
      width - float; width
      Throws:
      javax.naming.NamingException - for problems with registering in context
      java.rmi.RemoteException - on communication failure
  • Method Details

    • paint

      public final void paint​(java.awt.Graphics2D graphics, java.awt.image.ImageObserver observer) throws java.rmi.RemoteException
      Specified by:
      paint in class Renderable2D<Link>
      Throws:
      java.rmi.RemoteException
    • destroy

      public final void destroy() throws javax.naming.NamingException
      Specified by:
      destroy in interface Renderable2DInterface<Link>
      Overrides:
      destroy in class Renderable2D<Link>
      Throws:
      javax.naming.NamingException
    • clone

      public ClonableRenderable2DInterface<Link> clone​(Link newSource, SimulatorInterface.TimeDoubleUnit newSimulator) throws javax.naming.NamingException, java.rmi.RemoteException
      Clone the animation object and register it for the new source on the new simulation.
      Specified by:
      clone in interface ClonableRenderable2DInterface<Link>
      Parameters:
      newSource - T; the source
      newSimulator - SimulatorInterface.TimeDoubleUnit; the simulator
      Returns:
      the generated clone
      Throws:
      javax.naming.NamingException - when animation context cannot be created or retrieved
      java.rmi.RemoteException - - when remote context cannot be found
    • toString

      public final java.lang.String toString()
      Overrides:
      toString in class Renderable2D<Link>