Package org.opentrafficsim.draw.gtu
Class DefaultCarAnimation.Text
java.lang.Object
org.opentrafficsim.draw.TextAnimation<DefaultCarAnimation.GtuData,DefaultCarAnimation.Text>
org.opentrafficsim.draw.gtu.DefaultCarAnimation.Text
- All Implemented Interfaces:
Serializable
,nl.tudelft.simulation.dsol.animation.Locatable
,org.opentrafficsim.base.geometry.OtsLocatable
- Enclosing class:
- DefaultCarAnimation
public class DefaultCarAnimation.Text
extends TextAnimation<DefaultCarAnimation.GtuData,DefaultCarAnimation.Text>
Text animation for the Car. Separate class to be able to turn it on and off...
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, Peter Knoppers, Wouter Schakel
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class org.opentrafficsim.draw.TextAnimation
TextAnimation.ContrastToBackground, TextAnimation.ScaleDependentRendering
-
Field Summary
Fields inherited from class org.opentrafficsim.draw.TextAnimation
RENDERALWAYS, RENDERWHEN1, RENDERWHEN10, RENDERWHEN100
-
Constructor Summary
ConstructorDescriptionText
(DefaultCarAnimation.GtuData source, Supplier<String> text, float dx, float dy, TextAlignment textAlignment, Color color, nl.tudelft.simulation.naming.context.Contextualized contextualized) Text
(DefaultCarAnimation.GtuData source, Supplier<String> text, float dx, float dy, TextAlignment textAlignment, Color color, nl.tudelft.simulation.naming.context.Contextualized contextualized, TextAnimation.ContrastToBackground background) -
Method Summary
Methods inherited from class org.opentrafficsim.draw.TextAnimation
destroy, getBounds, getColor, getDx, getDy, getFont, getFontSize, getLocation, getScaleDependentRendering, getSource, getText, getTextAlignment, getZ, isFlip, isRotate, isScale, isTranslate, paint, setColor, setDynamic, setFlip, setRotate, setScale, setText, setTranslate, setXY
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface nl.tudelft.simulation.dsol.animation.Locatable
getDirZ
-
Constructor Details
-
Text
public Text(DefaultCarAnimation.GtuData source, Supplier<String> text, float dx, float dy, TextAlignment textAlignment, Color color, nl.tudelft.simulation.naming.context.Contextualized contextualized) throws RemoteException, NamingException - Parameters:
source
- GtuData; the object for which the text is displayedtext
- Supplier<String>; the text to displaydx
- float; the horizontal movement of the text, in metersdy
- float; the vertical movement of the text, in meterstextAlignment
- TextAlignment; where to place the textcolor
- Color; the color of the textcontextualized
- Contextualized; context provider- Throws:
NamingException
- when animation context cannot be created or retrievedRemoteException
- - when remote context cannot be found
-
Text
public Text(DefaultCarAnimation.GtuData source, Supplier<String> text, float dx, float dy, TextAlignment textAlignment, Color color, nl.tudelft.simulation.naming.context.Contextualized contextualized, TextAnimation.ContrastToBackground background) throws RemoteException, NamingException - Parameters:
source
- GtuData; the object for which the text is displayedtext
- Supplier<String>; the text to displaydx
- float; the horizontal movement of the text, in metersdy
- float; the vertical movement of the text, in meterstextAlignment
- TextAlignment; where to place the textcolor
- Color; the color of the textcontextualized
- Contextualized; context providerbackground
- TextAnimation.ContrastToBackground; connection to retrieve the current background color- Throws:
NamingException
- when animation context cannot be created or retrievedRemoteException
- - when remote context cannot be found
-
-
Method Details