Package com.luciad.view.lightspeed.style
Class TLspTextStyle
java.lang.Object
com.luciad.view.lightspeed.style.ALspStyle
com.luciad.view.lightspeed.style.TLspTextStyle
- All Implemented Interfaces:
ILspWorldElevationStyle
,ILspStyler
Text style used to style text, labels, etc. The layout of the text is as demonstrated in the following image:
The default text style is a plain black sans-serif font with size 14 and a 1-pixel white halo.
Construction of a text style object is performed through the Builder
design pattern mechanism.
Note that this style can not be used to modify the content of the text label. In order to do so, an
ALspLabelTextProviderStyle
can be used, for example TLspDataObjectLabelTextProviderStyle
.
Note that if the text to be painted starts with <html>
,
TLspLabelPainter
uses HTML to
format and paint the text.
- Since:
- 2012.0
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic enum
Defines the text alignment of labels spanning several lines.static class
TLspTextStyle.Builder<B extends TLspTextStyle.Builder<B>>
Builder for text styles.Nested classes/interfaces inherited from interface com.luciad.view.lightspeed.style.ILspWorldElevationStyle
ILspWorldElevationStyle.ElevationMode
-
Constructor Summary
ModifierConstructorDescriptionprotected
TLspTextStyle
(TLspTextStyle.Builder aBuilder) Creates a new text style. -
Method Summary
Modifier and TypeMethodDescriptionCreates a new builder initialized with all the properties of this style.boolean
Specifies how text over multiple lines should be aligned.Returns the elevation mode of this style.getFont()
Gets the text font.Gets the halo color.float
Gets the halo thickness.Gets the text color.int
Specifies the spacing in between multiple lines of textint
hashCode()
boolean
Specifies in which paint phase the text should be painted.static TLspTextStyle.Builder
<?> Creates a new builder with the default values.Methods inherited from class com.luciad.view.lightspeed.style.ALspStyle
addStyleChangeListener, getZOrder, isCompatible, removeStyleChangeListener, style
-
Constructor Details
-
TLspTextStyle
Creates a new text style.- Parameters:
aBuilder
- a builder.
-
-
Method Details
-
newBuilder
Creates a new builder with the default values.- Returns:
- the new builder.
-
asBuilder
Creates a new builder initialized with all the properties of this style. -
getFont
Gets the text font.- Returns:
- the text font
-
getTextColor
Gets the text color.- Returns:
- the text color
-
getHaloColor
Gets the halo color. This property should only be used if the halo is enabled.- Returns:
- the halo color
- See Also:
-
getHaloThickness
public float getHaloThickness()Gets the halo thickness. If zero, no halo should be visible.- Returns:
- the halo thickness in pixels
- See Also:
-
getAlignment
Specifies how text over multiple lines should be aligned.- Returns:
- The desired alignment
-
getVerticalSpacing
public int getVerticalSpacing()Specifies the spacing in between multiple lines of text- Returns:
- the spacing, in pixels
-
isTransparent
public boolean isTransparent()Specifies in which paint phase the text should be painted.- Specified by:
isTransparent
in classALspStyle
- Returns:
- whether the text should be painted as a transparent or as an opaque object
-
getElevationMode
Description copied from interface:ILspWorldElevationStyle
Returns the elevation mode of this style.- Specified by:
getElevationMode
in interfaceILspWorldElevationStyle
- Returns:
- The elevation mode.
-
equals
-
hashCode
public int hashCode()
-