public class TLcdTextIcon extends Object implements ILcdIcon
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.Modifier and Type | Class and Description |
---|---|
static class |
TLcdTextIcon.Builder
Builder for creating a text icon.
|
Modifier and Type | Method and Description |
---|---|
TLcdTextIcon.Builder |
asBuilder()
Creates a new builder initialized with all the properties of this text icon.
|
Object |
clone()
Makes
Object.clone() public. |
boolean |
equals(Object aO) |
Font |
getFont()
Returns the font for drawing the text.
|
Color |
getForeground()
Returns the color of the text and frame.
|
ELcdHorizontalAlignment |
getHorizontalAlignment()
Returns the alignment of the lines in the icon.
|
int |
getIconHeight()
Returns the fixed height of the icon.
|
int |
getIconWidth()
Returns the fixed width of the icon.
|
List<String> |
getLines()
Returns the content to display
|
int |
getVerticalSpacing()
Returns the vertical spacing in between the icon's text lines.
|
int |
hashCode() |
boolean |
isAntiAliased()
Returns if anti-aliasing is enabled.
|
static TLcdTextIcon.Builder |
newBuilder()
Returns a builder for creating a new text icon.
|
void |
paintIcon(Component aComponent,
Graphics aGraphics,
int aX,
int aY)
Draw the
ILcdIcon at the specified location. |
String |
toString() |
public List<String> getLines()
public void paintIcon(Component aComponent, Graphics aGraphics, int aX, int aY)
ILcdIcon
ILcdIcon
at the specified location. ILcdIcon
implementations
may use the Component
argument to get properties useful for
painting, e.g. the foreground or background color.paintIcon
in interface ILcdIcon
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.public ELcdHorizontalAlignment getHorizontalAlignment()
public Font getFont()
public Color getForeground()
public int getVerticalSpacing()
public int getIconWidth()
ILcdIcon
getIconWidth
in interface ILcdIcon
public int getIconHeight()
ILcdIcon
getIconHeight
in interface ILcdIcon
public Object clone()
ILcdCloneable
Makes Object.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 );
}
}
clone
in interface ILcdCloneable
clone
in class Object
Object.clone()
public boolean isAntiAliased()
public static TLcdTextIcon.Builder newBuilder()
public TLcdTextIcon.Builder asBuilder()