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

    • TLspTextStyle

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

    • newBuilder

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

      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

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

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

      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

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

      public TLspTextStyle.Alignment 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 class ALspStyle
      Returns:
      whether the text should be painted as a transparent or as an opaque object
    • getElevationMode

      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

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

      public int hashCode()
      Overrides:
      hashCode in class ALspStyle