Class TLspTextStyle

java.lang.Object
com.luciad.view.lightspeed.style.ALspStyle
com.luciad.view.lightspeed.style.TLspTextStyle
All Implemented Interfaces:
ILspWorldElevationStyle, ILspStyler

public class TLspTextStyle extends ALspStyle implements ILspWorldElevationStyle

Text style used to style text, labels, etc. The layout of the text is as demonstrated in the following image:

text layout

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
  • Constructor Details Link icon

    • TLspTextStyle Link icon

      protected TLspTextStyle(TLspTextStyle.Builder aBuilder)
      Creates a new text style.
      Parameters:
      aBuilder - a builder.
  • Method Details Link icon

    • newBuilder Link icon

      public static TLspTextStyle.Builder<?> newBuilder()
      Creates a new builder with the default values.
      Returns:
      the new builder.
    • asBuilder Link icon

      public TLspTextStyle.Builder<?> asBuilder()
      Creates a new builder initialized with all the properties of this style.
      Specified by:
      asBuilder in class ALspStyle
      Returns:
      the new builder.
    • getFont Link icon

      public Font getFont()
      Gets the text font.
      Returns:
      the text font
    • getTextColor Link icon

      public Color getTextColor()
      Gets the text color.
      Returns:
      the text color
    • getHaloColor Link icon

      public Color getHaloColor()
      Gets the halo color. This property should only be used if the halo is enabled.
      Returns:
      the halo color
      See Also:
    • getHaloThickness Link icon

      public float getHaloThickness()
      Gets the halo thickness. If zero, no halo should be visible.
      Returns:
      the halo thickness in pixels
      See Also:
    • getAlignment Link icon

      public TLspTextStyle.Alignment getAlignment()
      Specifies how text over multiple lines should be aligned.
      Returns:
      The desired alignment
    • getVerticalSpacing Link icon

      public int getVerticalSpacing()
      Specifies the spacing in between multiple lines of text
      Returns:
      the spacing, in pixels
    • isTransparent Link icon

      public boolean isTransparent()
      Specifies in which paint phase the text should be painted.
      Specified by:
      isTransparent in class ALspStyle
      Returns:
      whether the text should be painted as a transparent or as an opaque object
    • getElevationMode Link icon

      public ILspWorldElevationStyle.ElevationMode getElevationMode()
      Description copied from interface: ILspWorldElevationStyle
      Returns the elevation mode of this style.
      Specified by:
      getElevationMode in interface ILspWorldElevationStyle
      Returns:
      The elevation mode.
    • equals Link icon

      public boolean equals(Object o)
      Overrides:
      equals in class ALspStyle
    • hashCode Link icon

      public int hashCode()
      Overrides:
      hashCode in class ALspStyle