Class NodeAnimation
java.lang.Object
nl.tudelft.simulation.dsol.animation.d2.Renderable2d<L>
org.opentrafficsim.animation.OtsRenderable<L>
org.opentrafficsim.animation.OtsRenderableLabeled<NodeAnimation.NodeData,NodeAnimation.Text>
org.opentrafficsim.animation.network.NodeAnimation
- All Implemented Interfaces:
Renderable2dInterface<NodeAnimation.NodeData>
Draws node 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 interfaceNodeData provides the information required to draw a node.static classText animation for the Node.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
ConstructorsConstructorDescriptionNodeAnimation(NodeAnimation.NodeData node, nl.tudelft.simulation.naming.context.Contextualized contextualized) Constructor. -
Method Summary
Modifier and TypeMethodDescriptionprotected NodeAnimation.TextcreateText(NodeAnimation.NodeData source, nl.tudelft.simulation.naming.context.Contextualized contextualized, String prefix) Returns a text object that is co-animated with the object itself.booleanisScaleY()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, isTranslate, paint, paintComponent, setFlip, setRotate, setScale, setScaleObject, setScaleY, setTranslate
-
Constructor Details
-
NodeAnimation
public NodeAnimation(NodeAnimation.NodeData node, nl.tudelft.simulation.naming.context.Contextualized contextualized) Constructor.- Parameters:
node- node datacontextualized- context provider
-
-
Method Details
-
createText
protected NodeAnimation.Text createText(NodeAnimation.NodeData 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<NodeAnimation.NodeData,NodeAnimation.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
-
isScaleY
public boolean isScaleY()- Specified by:
isScaleYin interfaceRenderable2dInterface<NodeAnimation.NodeData>- Overrides:
isScaleYin classRenderable2d<NodeAnimation.NodeData>
-
paint
- Specified by:
paintin classRenderable2d<NodeAnimation.NodeData>
-
toString
- Overrides:
toStringin classRenderable2d<NodeAnimation.NodeData>
-