public abstract class TextAnimation extends Object implements Locatable, Serializable
Copyright (c) 2013-2016 Delft University of Technology, PO Box 5, 2600 AA, Delft, the Netherlands. All rights reserved.
BSD-style license. See OpenTrafficSim License.
| Modifier and Type | Class and Description |
|---|---|
protected static class |
TextAnimation.AnimationImpl
The implementation of the text animation.
|
| Modifier and Type | Field and Description |
|---|---|
protected TextAnimation.AnimationImpl |
animationImpl
the animation implementation.
|
protected Color |
color
the color of the text.
|
protected float |
dx
the horizontal movement of the text, in meters.
|
protected float |
dy
the vertical movement of the text, in meters.
|
protected Font |
font
the font.
|
protected float |
fontSize
fontSize the size of the font; default = 2.0 (meters).
|
protected Locatable |
source
the object for which the text is displayed.
|
protected String |
text
the text to display.
|
protected TextAlignment |
textAlignment
whether to center or not.
|
| Constructor and Description |
|---|
TextAnimation(Locatable source,
String text,
float dx,
float dy,
TextAlignment textAlignment,
Color color,
float fontSize,
OTSSimulatorInterface simulator) |
TextAnimation(Locatable source,
String text,
float dx,
float dy,
TextAlignment textAlignment,
Color color,
OTSSimulatorInterface simulator) |
| Modifier and Type | Method and Description |
|---|---|
Bounds |
getBounds() |
DirectedPoint |
getLocation() |
void |
paint(Graphics2D graphics,
ImageObserver observer)
paint() method so it can be overridden or extended.
|
protected final Locatable source
protected final String text
protected final float dx
protected final float dy
protected final TextAlignment textAlignment
protected final Color color
protected final float fontSize
protected final TextAnimation.AnimationImpl animationImpl
protected Font font
public TextAnimation(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(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 DirectedPoint getLocation() throws RemoteException
getLocation in interface LocatableRemoteExceptionpublic final Bounds getBounds() throws RemoteException
getBounds in interface LocatableRemoteExceptionpublic void paint(Graphics2D graphics, ImageObserver observer) throws RemoteException
graphics - the graphics objectobserver - the observerRemoteException - on network exceptionCopyright © 2014–2017 Delft University of Technology. All rights reserved.