public class TextProperties extends Object implements 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 |
---|
TextProperties()
Construct a default set of text properties for animation.
|
TextProperties(TextAlignment textAlignment,
Color color,
float fontSize)
Construct a set of text properties for animation with alignment, color and size.
|
TextProperties(TextAlignment textAlignment,
Color color,
float fontSize,
String font,
Map<TextAttribute,Object> textAttributes)
Construct a set of text properties for animation with alignment, color and size.
|
Modifier and Type | Method and Description |
---|---|
Color |
getColor() |
String |
getFont() |
float |
getFontSize() |
TextAlignment |
getTextAlignment() |
Map<TextAttribute,Object> |
getTextAttributes() |
void |
setBold(boolean bold)
Set the weight to either WEIGHT_REGULAR or WEIGHT_BOLD.
|
void |
setBold(TextWeight weight)
Set the weight to one of multiple weight constants.
|
void |
setItalic(boolean italic)
Set the posture to either POSTURE_REGULAR or POSTURE_OBLIQUE (italic).
|
void |
setStrikethrough(boolean strikethrough)
Set the strikethrough on or off.
|
void |
setUnderline(boolean underline)
Set the underline on or off.
|
void |
setWeightBold(TextWidth width)
Set the width to WIDTH_CONDENSED, WIDTH_REGULAR, or WIDTH_EXTENDED.
|
String |
toString() |
public TextProperties()
public TextProperties(TextAlignment textAlignment, Color color, float fontSize)
textAlignment
- the text alignment (LEFT, CENTER or RIGHT)color
- the color of the textfontSize
- the size of the font (in units of the animation, e.g., meters)public TextProperties(TextAlignment textAlignment, Color color, float fontSize, String font, Map<TextAttribute,Object> textAttributes)
textAlignment
- the text alignment (LEFT, CENTER or RIGHT)color
- the color of the text, e.g., Color.REDfontSize
- the size of the font (in units of the animation, e.g., meters)font
- the name of the font, e.g., specified as Font.SERIFtextAttributes
- a map of text attributes to set, e.g., UNDERLINE or WEIGHTpublic final TextAlignment getTextAlignment()
public final Color getColor()
public final String getFont()
public final Map<TextAttribute,Object> getTextAttributes()
public final float getFontSize()
public final void setBold(boolean bold)
bold
- whether the font is bold or regularpublic final void setBold(TextWeight weight)
weight
- the weight of the font to usepublic final void setItalic(boolean italic)
italic
- whether the font is italic or regularpublic final void setWeightBold(TextWidth width)
width
- the TextWidth to usepublic final void setUnderline(boolean underline)
underline
- whether the font is underlined or regularpublic final void setStrikethrough(boolean strikethrough)
strikethrough
- whether the font is strikethrough or regularCopyright © 2014–2017 Delft University of Technology. All rights reserved.