Class NodeAnimation.Text

  • All Implemented Interfaces:
    java.io.Serializable, Locatable
    Enclosing class:
    NodeAnimation

    public class NodeAnimation.Text
    extends TextAnimation
    Text animation for the Node. Separate class to be able to turn it on and off...

    Copyright (c) 2013-2020 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 Dec 11, 2016
    Author:
    Alexander Verbraeck, Peter Knoppers, Wouter Schakel
    See Also:
    Serialized Form
    • Constructor Detail

      • Text

        public Text​(Locatable source,
                    java.lang.String text,
                    float dx,
                    float dy,
                    TextAlignment textPlacement,
                    java.awt.Color color,
                    SimulatorInterface.TimeDoubleUnit simulator,
                    TextAnimation.ScaleDependentRendering scaleDependentRendering)
             throws java.rmi.RemoteException,
                    javax.naming.NamingException
        Parameters:
        source - Locatable; the object for which the text is displayed
        text - String; the text to display
        dx - float; the horizontal movement of the text, in meters
        dy - float; the vertical movement of the text, in meters
        textPlacement - TextAlignment; where to place the text
        color - Color; the color of the text
        simulator - SimulatorInterface.TimeDoubleUnit; the simulator
        scaleDependentRendering - ScaleDependendentRendering; size limiter for text animation
        Throws:
        javax.naming.NamingException - when animation context cannot be created or retrieved
        java.rmi.RemoteException - - when remote context cannot be found
    • Method Detail

      • clone

        public TextAnimation clone​(Locatable newSource,
                                   SimulatorInterface.TimeDoubleUnit newSimulator)
                            throws java.rmi.RemoteException,
                                   javax.naming.NamingException
        Clone the TextAnimation and return a copy for the new source on the new simulator.
        Specified by:
        clone in class TextAnimation
        Parameters:
        newSource - Locatable; the new source to link to the text animation
        newSimulator - SimulatorInterface.TimeDoubleUnit; the new simulator to register the animation on
        Returns:
        TextAnimation; a copy of this TextAnimation
        Throws:
        java.rmi.RemoteException - when remote animation cannot be reached
        javax.naming.NamingException - when animation name cannot be found or bound in the Context
      • toString

        public final java.lang.String toString()
        Overrides:
        toString in class java.lang.Object