public abstract class TextAnimation extends Object implements nl.tudelft.simulation.dsol.animation.Locatable, Serializable
Copyright (c) 2013-2017 Delft University of Technology, PO Box 5, 2600 AA, Delft, the Netherlands. All rights reserved.
BSD-style license. See OpenTrafficSim License.
Constructor and Description |
---|
TextAnimation(nl.tudelft.simulation.dsol.animation.Locatable source,
String text,
float dx,
float dy,
TextAlignment textAlignment,
Color color,
float fontSize,
OTSSimulatorInterface simulator) |
TextAnimation(nl.tudelft.simulation.dsol.animation.Locatable source,
String text,
float dx,
float dy,
TextAlignment textAlignment,
Color color,
OTSSimulatorInterface simulator) |
Modifier and Type | Method and Description |
---|---|
abstract TextAnimation |
clone(nl.tudelft.simulation.dsol.animation.Locatable newSource,
OTSSimulatorInterface newSimulator)
Clone the TextAnimation and return a copy for the new source on the new simulator.
|
void |
destroy()
Destroy the text animation.
|
javax.media.j3d.Bounds |
getBounds() |
protected Color |
getColor() |
protected float |
getDx() |
protected float |
getDy() |
protected Font |
getFont() |
protected float |
getFontSize() |
nl.tudelft.simulation.language.d3.DirectedPoint |
getLocation() |
protected nl.tudelft.simulation.dsol.animation.Locatable |
getSource() |
protected String |
getText() |
protected TextAlignment |
getTextAlignment() |
boolean |
isFlip() |
boolean |
isRotate() |
boolean |
isScale() |
boolean |
isTranslate() |
void |
paint(Graphics2D graphics,
ImageObserver observer)
paint() method so it can be overridden or extended.
|
protected void |
setColor(Color color) |
void |
setFlip(boolean flip) |
void |
setRotate(boolean rotate) |
void |
setScale(boolean scale) |
protected void |
setText(String text) |
void |
setTranslate(boolean translate) |
public TextAnimation(nl.tudelft.simulation.dsol.animation.Locatable source, String text, float dx, float dy, TextAlignment textAlignment, Color color, float fontSize, OTSSimulatorInterface simulator) throws RemoteException, NamingException
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 textfontSize
- the size of the font; default = 2.0 (meters)simulator
- the simulatorNamingException
- when animation context cannot be created or retrievedRemoteException
- - when remote context cannot be foundpublic TextAnimation(nl.tudelft.simulation.dsol.animation.Locatable source, String text, float dx, float dy, TextAlignment textAlignment, Color color, OTSSimulatorInterface simulator) throws RemoteException, NamingException
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 textsimulator
- the simulatorNamingException
- when animation context cannot be created or retrievedRemoteException
- - when remote context cannot be foundpublic nl.tudelft.simulation.language.d3.DirectedPoint getLocation() throws RemoteException
getLocation
in interface nl.tudelft.simulation.dsol.animation.Locatable
RemoteException
public final javax.media.j3d.Bounds getBounds() throws RemoteException
getBounds
in interface nl.tudelft.simulation.dsol.animation.Locatable
RemoteException
public void paint(Graphics2D graphics, ImageObserver observer) throws RemoteException
graphics
- the graphics objectobserver
- the observerRemoteException
- on network exceptionpublic final void destroy()
public abstract TextAnimation clone(nl.tudelft.simulation.dsol.animation.Locatable newSource, OTSSimulatorInterface newSimulator) throws RemoteException, NamingException
newSource
- the new source to link to the text animationnewSimulator
- the new simulator to register the animation onRemoteException
- when remote animation cannot be reachedNamingException
- when animation name cannot be found or bound in the Contextprotected final nl.tudelft.simulation.dsol.animation.Locatable getSource()
protected final float getDx()
protected final float getDy()
protected final TextAlignment getTextAlignment()
protected final float getFontSize()
protected final Font getFont()
protected final String getText()
protected final void setText(String text)
text
- set new textprotected final Color getColor()
protected final void setColor(Color color)
color
- set new colorpublic final boolean isFlip()
public final void setFlip(boolean flip)
flip
- The flip to set.public final boolean isRotate()
public final void setRotate(boolean rotate)
rotate
- The rotate to set.public final boolean isScale()
public final void setScale(boolean scale)
scale
- The scale to set.public final boolean isTranslate()
public final void setTranslate(boolean translate)
translate
- The translate to set.Copyright © 2014–2017 Delft University of Technology. All rights reserved.