 |
Crossfire JXClient, Trunk
|
Go to the documentation of this file.
23 package com.realtime.crossfire.jxclient.gui.label;
29 import java.awt.Color;
31 import java.awt.Graphics;
32 import java.awt.image.BufferedImage;
33 import javax.swing.ImageIcon;
34 import org.jetbrains.annotations.NotNull;
35 import org.jetbrains.annotations.Nullable;
112 backgroundImage = backgroundPicture ==
null ? null :
new ImageIcon(backgroundPicture);
121 if (!this.text.equals(
text)) {
175 super.paintComponent(g);
181 g.fillRect(0, 0, getWidth(), getHeight());
String getText()
Returns the label text.
final Color textColor
The text color when not highlighted.
final Color backgroundColor
If set, the opaque background color.
void setTextHighlight(final boolean textHighlight)
Sets whether the text should be highlighted.
Abstract base class for GUI elements to be shown in Guis.
Abstract base class for all label classes.
final GUIElementListener elementListener
The GUIElementListener to notify.
void paintComponent(@NotNull final Graphics g)
final Color textHighlightColor
The text color when highlighted.
static final long serialVersionUID
The serial version UID.
AbstractLabel(@NotNull final TooltipManager tooltipManager, @NotNull final GUIElementListener elementListener, @NotNull final String name, @NotNull final String text, @NotNull final Font textFont, @NotNull final Color textColor, @NotNull final Color textHighlightColor, @Nullable final BufferedImage backgroundPicture, @Nullable final Color backgroundColor, @NotNull final GuiFactory guiFactory)
Creates a new instance.
final ImageIcon backgroundImage
The background image.
Color getTextColor()
Returns the text color.
void setText(@NotNull final String text)
Sets the label text.
void textChanged()
Will be called whenever text or getTextColor() has changed.
final GuiFactory guiFactory
The global GuiFactory instance.
Factory for creating Gui instances.
final String name
The name of this element.
boolean textHighlight
Whether the text is currently highlighted.
String text
The label text.
final TooltipManager tooltipManager
The TooltipManager to update.
final Font textFont
The font for rendering the label text.
Listener for GUIElement related events.
Font getTextFont()
Returns the font.