Package org.opentrafficsim.draw.object
Class StaticObjectAnimation
java.lang.Object
nl.tudelft.simulation.dsol.animation.d2.Renderable2d<L>
org.opentrafficsim.draw.OtsRenderable<StaticObjectAnimation.StaticObjectData>
org.opentrafficsim.draw.object.StaticObjectAnimation
- All Implemented Interfaces:
nl.tudelft.simulation.dsol.animation.d2.Renderable2dInterface<StaticObjectAnimation.StaticObjectData>
Generic animation of a static object.
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, Wouter Schakel
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic interfaceStaticObjectData provides the information required to draw a static object. -
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
ConstructorsConstructorDescriptionStaticObjectAnimation(StaticObjectAnimation.StaticObjectData source, nl.tudelft.simulation.naming.context.Contextualized contextualized, float width, Color color, boolean fill) Constructor. -
Method Summary
Modifier and TypeMethodDescriptionfinal ColorgetColor()Returns color.final floatgetWidth()Returns width.final booleanisFill()Returns whether to fill.final voidpaint(Graphics2D graphics, ImageObserver observer) final voidSets color.final voidsetFill(boolean fill) Sets whether to fill.final voidsetWidth(float width) Sets width.final StringtoString()Methods inherited from class org.opentrafficsim.draw.OtsRenderable
contains, contains, resetRendering, setRenderingMethods inherited from class nl.tudelft.simulation.dsol.animation.d2.Renderable2d
bind2Context, contains, destroy, getId, getSource, isFlip, isRotate, isScale, isScaleObject, isScaleY, isTranslate, paint, paintComponent, setFlip, setRotate, setScale, setScaleObject, setScaleY, setTranslate
-
Constructor Details
-
StaticObjectAnimation
public StaticObjectAnimation(StaticObjectAnimation.StaticObjectData source, nl.tudelft.simulation.naming.context.Contextualized contextualized, float width, Color color, boolean fill) throws NamingException, RemoteException Constructor.- Parameters:
source- Static Objectcontextualized- context providerwidth- width of the contour line to drawcolor- color of the contour line / fillfill- fill internal or not- Throws:
NamingException- for problems with registering in contextRemoteException- on communication failure
-
-
Method Details
-
paint
- Specified by:
paintin classnl.tudelft.simulation.dsol.animation.d2.Renderable2d<StaticObjectAnimation.StaticObjectData>
-
getWidth
public final float getWidth()Returns width.- Returns:
- width
-
setWidth
public final void setWidth(float width) Sets width.- Parameters:
width- set width
-
getColor
Returns color.- Returns:
- color
-
setColor
Sets color.- Parameters:
color- set color
-
isFill
public final boolean isFill()Returns whether to fill.- Returns:
- fill
-
setFill
public final void setFill(boolean fill) Sets whether to fill.- Parameters:
fill- set fill
-
toString
- Overrides:
toStringin classnl.tudelft.simulation.dsol.animation.d2.Renderable2d<StaticObjectAnimation.StaticObjectData>
-