Class TLcdTextIcon.Builder

java.lang.Object
com.luciad.gui.TLcdTextIcon.Builder
Enclosing class:
TLcdTextIcon

public static final class TLcdTextIcon.Builder extends Object
Builder for creating a text icon.
Since:
2018.1
  • Method Details

    • build

      public TLcdTextIcon build()
      Creates a new text icon. Requires at least the text content to be set using lines(java.util.List<java.lang.String>) or line(java.lang.String).
      Returns:
      a new text icon
      Throws:
      IllegalStateException - If any of the mandatory properties has not been set.
    • build

      public TLcdTextIcon build(Graphics aGraphics)
      Creates a new text icon, using the given Graphics instance to calculate the dimensions. This method is typically faster than the method without Graphics instance. Requires at least the text content to be set using lines(java.util.List<java.lang.String>) or line(java.lang.String).
      Parameters:
      aGraphics - the graphics used to calculate the icon's dimensions.
      Returns:
      a new text icon
      Throws:
      IllegalStateException - If any of the mandatory properties has not been set.
    • line

      public TLcdTextIcon.Builder line(String aLine)
      Sets a single line to display. The line can contain HTML commands if its content is surrounded by an <html> tag.
      Parameters:
      aLine - the line to display. Can be empty, but never null.
    • lines

      public TLcdTextIcon.Builder lines(List<String> aLines)
      Sets the content to display. A line can contain HTML commands if its content is surrounded by an <html> tag. The list is copied, so modifying it afterwards does not affect this builder or the icons it builds.
      Parameters:
      aLines - the list of lines to display. Can be empty, but never null.
    • horizontalAlignment

      public TLcdTextIcon.Builder horizontalAlignment(ELcdHorizontalAlignment aAlignment)
      Sets the alignment of the lines in the icon.
      Parameters:
      aAlignment - the alignment of the lines in the icon
      See Also:
    • font

      public TLcdTextIcon.Builder font(Font aFont)
      Sets the font for drawing the text.
      Parameters:
      aFont - the font to use to paint the text.
      See Also:
    • foreground

      public TLcdTextIcon.Builder foreground(Color aForegroundColor)
      Sets the color of the text.
      Parameters:
      aForegroundColor - the new color to paint the foreground (text), or null if no color should be set
      See Also:
    • verticalSpacing

      public TLcdTextIcon.Builder verticalSpacing(int aVerticalSpacing)
      Sets the vertical distance in between the text's lines. More specifically, the distance between the tops of two successive lines is this value + the standard height of a line of text in the set font. Negative values are allowed.
      Parameters:
      aVerticalSpacing - the vertical distance to be used between the lines of the icon, in pixels.
      See Also:
    • antiAliased

      public TLcdTextIcon.Builder antiAliased(boolean aAntiAliased)

      Enable or disable anti-aliasing. By default, anti-aliasing is enabled.

      See also ILcdGXYView.isAntiAliased().

      Parameters:
      aAntiAliased - true to enable anti-aliasing
      See Also: