public class TextSymbol extends Symbol
Modifier and Type | Class and Description |
---|---|
static class |
TextSymbol.AlignType |
static class |
TextSymbol.DecorationType |
Modifier and Type | Method and Description |
---|---|
static TextSymbol |
create(com.google.gwt.core.client.JavaScriptObject json)
Creates a new TextSymbol object using a JSON object.
|
static TextSymbol |
create(java.lang.String text)
Creates a new TextSymbol object that includes only the text.
|
static TextSymbol |
create(java.lang.String text,
Font font,
Color color)
Creates a new TextSymbol object.
|
TextSymbol.AlignType |
getAlign()
The text alignment in relation to the point.
|
int |
getAngle()
Text angle.
|
TextSymbol.DecorationType |
getDecoration()
The decoration on the text.
|
Font |
getFont()
Font for displaying text.
|
java.lang.String |
getText()
Text string for display in the graphics layer.
|
int |
getXOffset()
The offset on the x-axis in pixels from the point.
|
int |
getYOffset()
The offset on the y-axis in pixels from the point.
|
boolean |
hasKerning()
Determines whether to adjust the spacing between characters in the text string.
|
boolean |
isRotated()
Determines whether every character in the text string is rotated.
|
TextSymbol |
setAlign(TextSymbol.AlignType align)
Sets the alignment of the text.
|
TextSymbol |
setAngle(int angle)
Sets the angle of the text.
|
TextSymbol |
setDecoration(TextSymbol.DecorationType decoration)
Sets the decoration for the text.Many browsers including Internet Explorer 7, Firefox and Opera 9
do not support the decoration properties for text symbols.
|
TextSymbol |
setFont(Font font)
Sets the text font.
|
TextSymbol |
setKerning(boolean kerning)
Sets whether to adjust the spacing between characters in the text string.
|
TextSymbol |
setOffset(int x,
int y)
Sets the x and y offset of the text.
|
TextSymbol |
setRotated(boolean rotated)
Sets whether every character in the text string is rotated.
|
TextSymbol |
setText(java.lang.String text)
Sets the text string.
|
fromJson, getColor, getType, setColor, toJson
public static TextSymbol create(java.lang.String text)
text
- - Text string for display in the graphics layer.public static TextSymbol create(java.lang.String text, Font font, Color color)
text
- - Text string for display in the graphics layer.font
- - Font for displaying text.color
- - Symbol color.public static TextSymbol create(com.google.gwt.core.client.JavaScriptObject json)
json
- - JSON object representing the text symbol.public final TextSymbol.AlignType getAlign()
public final int getAngle()
public final TextSymbol.DecorationType getDecoration()
public final Font getFont()
public final boolean hasKerning()
public final boolean isRotated()
public final java.lang.String getText()
public final int getXOffset()
public final int getYOffset()
public final TextSymbol setAlign(TextSymbol.AlignType align)
align
- - The text alignment.public final TextSymbol setAngle(int angle)
angle
- - Angle value between 0 and 359.public final TextSymbol setDecoration(TextSymbol.DecorationType decoration)
decoration
- - The decoration on the text.public final TextSymbol setFont(Font font)
font
- - Text font.public final TextSymbol setKerning(boolean kerning)
kerning
- - Set to true for kerning.public final TextSymbol setOffset(int x, int y)
x
- - X offset value in pixels.y
- - Y offset value in pixels.public final TextSymbol setRotated(boolean rotated)
rotated
- - Set to true to rotate all characters in the string.public final TextSymbol setText(java.lang.String text)
text
- - The text string.