Package org.opentrafficsim.draw.gtu
Class DefaultCarAnimation.Text
java.lang.Object
org.opentrafficsim.draw.RenderableTextSource<DefaultCarAnimation.GtuData,DefaultCarAnimation.Text>
org.opentrafficsim.draw.gtu.DefaultCarAnimation.Text
- All Implemented Interfaces:
nl.tudelft.simulation.dsol.animation.Locatable,OtsShape
- Enclosing class:
- DefaultCarAnimation
public static class DefaultCarAnimation.Text
extends RenderableTextSource<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
-
Nested Class Summary
Nested classes/interfaces inherited from class org.opentrafficsim.draw.RenderableTextSource
RenderableTextSource.ContrastToBackground, RenderableTextSource.ScaleDependentRendering -
Field Summary
Fields inherited from class org.opentrafficsim.draw.RenderableTextSource
RENDERALWAYS, RENDERWHEN1, RENDERWHEN10, RENDERWHEN100Fields inherited from interface org.opentrafficsim.base.geometry.OtsShape
DEFAULT_POLYGON_SEGMENTS, WORLD_MARGIN_LINE -
Constructor Summary
ConstructorsConstructorDescriptionText(DefaultCarAnimation.GtuData source, Supplier<String> text, float dx, float dy, TextAlignment textAlignment, Color color, nl.tudelft.simulation.naming.context.Contextualized contextualized) Constructor.Text(DefaultCarAnimation.GtuData source, Supplier<String> text, float dx, float dy, TextAlignment textAlignment, Color color, nl.tudelft.simulation.naming.context.Contextualized contextualized, RenderableTextSource.ContrastToBackground background) Constructor. -
Method Summary
Methods inherited from class org.opentrafficsim.draw.RenderableTextSource
destroy, getAbsoluteContour, getColor, getDx, getDy, getFont, getFontSize, getLocation, getRelativeBounds, getRelativeContour, getScaleDependentRendering, getSource, getText, getTextAlignment, getZ, isFlip, isRotate, isScale, isScaleObject, isScaleY, isTranslate, paint, setColor, setDynamic, setFlip, setRotate, setScale, setScaleObject, setScaleY, setText, setTranslate, setXYMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface org.opentrafficsim.base.geometry.OtsShape
contains, contains, getAbsoluteBounds, getAbsoluteContour, getDirZ, signedDistance, signedDistance
-
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) Constructor.- Parameters:
source- the object for which the text is displayedtext- the text to displaydx- the horizontal movement of the text, in metersdy- the vertical movement of the text, in meterstextAlignment- where to place the textcolor- the color of the textcontextualized- context provider
-
Text
public Text(DefaultCarAnimation.GtuData source, Supplier<String> text, float dx, float dy, TextAlignment textAlignment, Color color, nl.tudelft.simulation.naming.context.Contextualized contextualized, RenderableTextSource.ContrastToBackground background) Constructor.- Parameters:
source- the object for which the text is displayedtext- the text to displaydx- the horizontal movement of the text, in metersdy- the vertical movement of the text, in meterstextAlignment- where to place the textcolor- the color of the textcontextualized- context providerbackground- TextAnimation.ContrastToBackground; connection to retrieve the current background color
-
-
Method Details