Class LinkAnimation

java.lang.Object
nl.tudelft.simulation.dsol.animation.d2.Renderable2d<L>
org.opentrafficsim.base.geometry.OtsRenderable<LinkAnimation.LinkData>
org.opentrafficsim.draw.network.LinkAnimation
All Implemented Interfaces:
Serializable, nl.tudelft.simulation.dsol.animation.d2.Renderable2dInterface<LinkAnimation.LinkData>

public class LinkAnimation extends org.opentrafficsim.base.geometry.OtsRenderable<LinkAnimation.LinkData>
Draws LinkData.

Copyright (c) 2013-2024 Delft University of Technology, PO Box 5, 2600 AA, Delft, the Netherlands. All rights reserved.
BSD-style license. See OpenTrafficSim License.

Author:
Alexander Verbraeck, Wouter Schakel
See Also:
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    static interface 
    LinkData provides the information required to draw a link.
    class 
    Text animation for the Link.
  • Field Summary

    Fields inherited from class org.opentrafficsim.base.geometry.OtsRenderable

    RENDERING_KEYS, RENDERING_VALUES
  • Constructor Summary

    Constructors
    Constructor
    Description
    LinkAnimation(LinkAnimation.LinkData link, nl.tudelft.simulation.naming.context.Contextualized contextualized, float width)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    destroy(nl.tudelft.simulation.naming.context.Contextualized contextProvider)
    final void
    paint(Graphics2D graphics, ImageObserver observer)
    setDynamic(boolean dynamic)
    Sets the animation as dynamic, obtaining geometry at each draw.
    final String

    Methods inherited from class org.opentrafficsim.base.geometry.OtsRenderable

    contains, resetRendering, setRendering, toBoundsTransform

    Methods inherited from class nl.tudelft.simulation.dsol.animation.d2.Renderable2d

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

    Methods inherited from class java.lang.Object

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

    • LinkAnimation

      public LinkAnimation(LinkAnimation.LinkData link, nl.tudelft.simulation.naming.context.Contextualized contextualized, float width) throws NamingException, RemoteException
      Parameters:
      link - LinkData; link data.
      contextualized - Contextualized; context provider.
      width - float; width
      Throws:
      NamingException - for problems with registering in context
      RemoteException - on communication failure
  • Method Details

    • setDynamic

      public LinkAnimation setDynamic(boolean dynamic)
      Sets the animation as dynamic, obtaining geometry at each draw.
      Parameters:
      dynamic - boolean; whether it is dynamic false by default.
      Returns:
      LinkAnimation; for method chaining.
    • paint

      public final void paint(Graphics2D graphics, ImageObserver observer)
      Specified by:
      paint in class nl.tudelft.simulation.dsol.animation.d2.Renderable2d<LinkAnimation.LinkData>
    • destroy

      public void destroy(nl.tudelft.simulation.naming.context.Contextualized contextProvider)
      Specified by:
      destroy in interface nl.tudelft.simulation.dsol.animation.d2.Renderable2dInterface<LinkAnimation.LinkData>
      Overrides:
      destroy in class nl.tudelft.simulation.dsol.animation.d2.Renderable2d<LinkAnimation.LinkData>
    • toString

      public final String toString()
      Overrides:
      toString in class nl.tudelft.simulation.dsol.animation.d2.Renderable2d<LinkAnimation.LinkData>