Class LinkAnimation
java.lang.Object
nl.tudelft.simulation.dsol.animation.d2.Renderable2d<L>
org.opentrafficsim.animation.OtsRenderable<L>
org.opentrafficsim.animation.OtsRenderableLabeled<LinkAnimation.LinkData,LinkAnimation.Text>
org.opentrafficsim.animation.network.LinkAnimation
- All Implemented Interfaces:
Renderable2dInterface<LinkAnimation.LinkData>
Draws link data.
Copyright (c) 2013-2026 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
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic interfaceProvides the information required to draw a link.static classText animation for the link.Nested classes/interfaces inherited from class org.opentrafficsim.animation.OtsRenderableLabeled
OtsRenderableLabeled.NoText<L extends OtsShape> -
Field Summary
Fields inherited from interface nl.tudelft.simulation.dsol.animation.d2.Renderable2dInterface
ANIMATION_OBJECT_COUNTER, FLIP_FLAG, ROTATE_FLAG, SCALE_FLAG, SCALE_OBJECT_FLAG, SCALE_Y_FLAG, TRANSLATE_FLAG -
Constructor Summary
ConstructorsConstructorDescriptionLinkAnimation(LinkAnimation.LinkData link, nl.tudelft.simulation.naming.context.Contextualized contextualized, float width) Constructor. -
Method Summary
Modifier and TypeMethodDescriptionprotected LinkAnimation.TextcreateText(LinkAnimation.LinkData source, nl.tudelft.simulation.naming.context.Contextualized contextualized, String prefix) Returns a text object that is co-animated with the object itself.final voidpaint(Graphics2D graphics, ImageObserver observer) final StringtoString()Methods inherited from class org.opentrafficsim.animation.OtsRenderableLabeled
destroy, setDynamicMethods inherited from class org.opentrafficsim.animation.OtsRenderable
contains, contains, isDynamic, resetRendering, setRenderingMethods inherited from class nl.tudelft.simulation.dsol.animation.d2.Renderable2d
bind2Context, contains, getId, getSource, isFlip, isRotate, isScale, isScaleObject, isScaleY, isTranslate, paint, paintComponent, setFlip, setRotate, setScale, setScaleObject, setScaleY, setTranslate
-
Constructor Details
-
LinkAnimation
public LinkAnimation(LinkAnimation.LinkData link, nl.tudelft.simulation.naming.context.Contextualized contextualized, float width) Constructor.- Parameters:
link- link datacontextualized- context providerwidth- width
-
-
Method Details
-
createText
protected LinkAnimation.Text createText(LinkAnimation.LinkData source, nl.tudelft.simulation.naming.context.Contextualized contextualized, String prefix) Description copied from class:OtsRenderableLabeledReturns a text object that is co-animated with the object itself. Sub-classes ofOtsRenderableLabeledtypically define a.Textclass that extendsRenderableTextSourcesuch that a separate class exists that can be toggled on/off. In this way labels of renderables can be show separately from the object itself. Theprefixmay be ignore depending on the sub-class knowing it provided no prefix to this class, its super class.- Specified by:
createTextin classOtsRenderableLabeled<LinkAnimation.LinkData,LinkAnimation.Text> - Parameters:
source- the object for which the text is displayedcontextualized- context providerprefix- prefix for the label- Returns:
- text renderable, may be
nullto omit a label
-
paint
- Specified by:
paintin classRenderable2d<LinkAnimation.LinkData>
-
toString
- Overrides:
toStringin classRenderable2d<LinkAnimation.LinkData>
-