Package com.luciad.gui
Class TLcdTextIcon
java.lang.Object
com.luciad.gui.TLcdTextIcon
- All Implemented Interfaces:
ILcdIcon
,ILcdCloneable
,Serializable
,Cloneable
Multi-line text icon.
The icon is immutable and uses the builder-pattern: see
The icon is immutable and uses the builder-pattern: see
newBuilder()
to create a new icon and
asBuilder()
to modify an existing one.
See the TLcdTextIcon.Builder.lines(java.util.List<java.lang.String>)
method to change the text.
The rendering can be configured in the following ways:
The dimensions of the icon are automatically determined based on the content and font.- Since:
- 2018.1
- See Also:
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic final class
Builder for creating a text icon. -
Method Summary
Modifier and TypeMethodDescriptionCreates a new builder initialized with all the properties of this text icon.clone()
MakesObject.clone()
public.boolean
getFont()
Returns the font for drawing the text.Returns the color of the text and frame.Returns the alignment of the lines in the icon.int
Returns the fixed height of the icon.int
Returns the fixed width of the icon.getLines()
Returns the content to displayint
Returns the vertical spacing in between the icon's text lines.int
hashCode()
boolean
Returns if anti-aliasing is enabled.static TLcdTextIcon.Builder
Returns a builder for creating a new text icon.void
Draw theILcdIcon
at the specified location.toString()
-
Method Details
-
getLines
Returns the content to display- Returns:
- the list of lines to display
-
paintIcon
Description copied from interface:ILcdIcon
Draw theILcdIcon
at the specified location.ILcdIcon
implementations may use theComponent
argument to get properties useful for painting, e.g. the foreground or background color.- Specified by:
paintIcon
in interfaceILcdIcon
- Parameters:
aComponent
- a Component to retrieve properties from.aGraphics
- the Graphics on which the icon will be painted.aX
- the x position where the icon will be painted. x is the first coordinate of the top left corner point of the icon.aY
- the y position where the icon will be painted. y is the second coordinate of the top left corner point of the icon.
-
getHorizontalAlignment
Returns the alignment of the lines in the icon.- Returns:
- the alignment of the lines in the icon
-
getFont
Returns the font for drawing the text. The default value is plain Dialog of size 13.- Returns:
- the font used to paint text.
-
getForeground
Returns the color of the text and frame.- Returns:
- the foreground color, or null if no color is configured
-
getVerticalSpacing
public int getVerticalSpacing()Returns the vertical spacing in between the icon's text lines.- Returns:
- the vertical spacing used between lines, in pixels.
-
getIconWidth
public int getIconWidth()Description copied from interface:ILcdIcon
Returns the fixed width of the icon.- Specified by:
getIconWidth
in interfaceILcdIcon
- Returns:
- the fixed width of the icon.
-
getIconHeight
public int getIconHeight()Description copied from interface:ILcdIcon
Returns the fixed height of the icon.- Specified by:
getIconHeight
in interfaceILcdIcon
- Returns:
- the fixed height of the icon.
-
clone
Description copied from interface:ILcdCloneable
Makes
When for example extending fromObject.clone()
public.java.lang.Object
, it can be implemented like this:public Object clone() { try { return super.clone(); } catch ( CloneNotSupportedException e ) { // Cannot happen: extends from Object and implements Cloneable (see also Object.clone) throw new RuntimeException( e ); } }
- Specified by:
clone
in interfaceILcdCloneable
- Overrides:
clone
in classObject
- See Also:
-
isAntiAliased
public boolean isAntiAliased()Returns if anti-aliasing is enabled.- Returns:
- if anti-aliasing is enabled.
-
equals
-
hashCode
public int hashCode() -
toString
-
newBuilder
Returns a builder for creating a new text icon.- Returns:
- a new text icon builder
-
asBuilder
Creates a new builder initialized with all the properties of this text icon.- Returns:
- the new builder.
-