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
Nested ClassesModifier and TypeClassDescriptionstatic final classBuilder 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.booleangetFont()Returns the font for drawing the text.Returns the color of the text and frame.Returns the alignment of the lines in the icon.intReturns the fixed height of the icon.intReturns the fixed width of the icon.getLines()Returns the content to displayintReturns the vertical spacing in between the icon's text lines.inthashCode()booleanReturns if anti-aliasing is enabled.static TLcdTextIcon.BuilderReturns a builder for creating a new text icon.voidDraw theILcdIconat the specified location.toString()
-
Method Details
-
getLines
Returns the content to display- Returns:
- the list of lines to display
-
paintIcon
Description copied from interface:ILcdIconDraw theILcdIconat the specified location.ILcdIconimplementations may use theComponentargument to get properties useful for painting, e.g. the foreground or background color.- Specified by:
paintIconin 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:ILcdIconReturns the fixed width of the icon.- Specified by:
getIconWidthin interfaceILcdIcon- Returns:
- the fixed width of the icon.
-
getIconHeight
public int getIconHeight()Description copied from interface:ILcdIconReturns the fixed height of the icon.- Specified by:
getIconHeightin interfaceILcdIcon- Returns:
- the fixed height of the icon.
-
clone
Description copied from interface:ILcdCloneableMakes
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:
clonein interfaceILcdCloneable- Overrides:
clonein 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.
-