public static final class TLcdTextIcon.Builder extends Object
Modifier and Type | Method and Description |
---|---|
TLcdTextIcon.Builder |
antiAliased(boolean aAntiAliased)
Enable or disable anti-aliasing.
|
TLcdTextIcon |
build()
Creates a new text icon.
|
TLcdTextIcon |
build(Graphics aGraphics)
Creates a new text icon, using the given
Graphics instance to calculate the dimensions. |
TLcdTextIcon.Builder |
font(Font aFont)
Sets the font for drawing the text.
|
TLcdTextIcon.Builder |
foreground(Color aForegroundColor)
Sets the color of the text.
|
TLcdTextIcon.Builder |
horizontalAlignment(ELcdHorizontalAlignment aAlignment)
Sets the alignment of the lines in the icon.
|
TLcdTextIcon.Builder |
line(String aLine)
Sets a single line to display.
|
TLcdTextIcon.Builder |
lines(List<String> aLines)
Sets the content to display.
|
TLcdTextIcon.Builder |
verticalSpacing(int aVerticalSpacing)
Sets the vertical distance in between the text's lines.
|
public TLcdTextIcon build()
lines(java.util.List<java.lang.String>)
or line(java.lang.String)
.IllegalStateException
- If any of the mandatory properties has not been set.public TLcdTextIcon build(Graphics aGraphics)
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)
.aGraphics
- the graphics used to calculate the icon's dimensions.IllegalStateException
- If any of the mandatory properties has not been set.public TLcdTextIcon.Builder line(String aLine)
<html>
tag.aLine
- the line to display. Can be empty, but never null
.public TLcdTextIcon.Builder lines(List<String> aLines)
<html>
tag.aLines
- the list of lines to display. Can be empty, but never null
.public TLcdTextIcon.Builder horizontalAlignment(ELcdHorizontalAlignment aAlignment)
aAlignment
- the alignment of the lines in the iconTLcdTextIcon.getHorizontalAlignment()
public TLcdTextIcon.Builder font(Font aFont)
aFont
- the font to use to paint the text.TLcdTextIcon.getFont()
public TLcdTextIcon.Builder foreground(Color aForegroundColor)
aForegroundColor
- the new color to paint the foreground (text), or null if no color should be setTLcdTextIcon.getForeground()
public TLcdTextIcon.Builder verticalSpacing(int aVerticalSpacing)
aVerticalSpacing
- the vertical distance to be used between the lines of the icon, in pixels.TLcdTextIcon.getVerticalSpacing()
public TLcdTextIcon.Builder antiAliased(boolean aAntiAliased)
Enable or disable anti-aliasing. By default, anti-aliasing is enabled.
See also ILcdGXYView.isAntiAliased()
.
aAntiAliased
- true to enable anti-aliasingTLcdTextIcon.isAntiAliased()