Crossfire JXClient, Trunk
|
Public Member Functions | |
Dimension | getMinimumSize () |
Dimension | getPreferredSize () |
TooltipText | getTooltip () |
GUIHTMLLabel (@NotNull final TooltipManager tooltipManager, @NotNull final GUIElementListener elementListener, @NotNull final String name, @Nullable final BufferedImage backgroundPicture, @NotNull final Font font, @NotNull final Color color, @Nullable final Color backgroundColor, @NotNull final String text, @NotNull final GuiFactory guiFactory) | |
void | notifyOpen () |
void | paintComponent (@NotNull final Graphics g) |
void | setAutoResize (final boolean autoResize) |
Public Member Functions inherited from com.realtime.crossfire.jxclient.gui.label.AbstractLabel | |
void | setText (@NotNull final String text) |
void | setTextHighlight (final boolean textHighlight) |
Public Member Functions inherited from com.realtime.crossfire.jxclient.gui.gui.AbstractGUIElement | |
void | dispose () |
int | getDialogBorderBottom () |
int | getDialogBorderLeft () |
int | getDialogBorderRight () |
int | getDialogBorderTop () |
String | getName () |
void | inhibitListeners () |
boolean | isDefault () |
boolean | isIgnore () |
void | mouseClicked (@NotNull final MouseEvent e) |
void | mouseDragged (@NotNull final MouseEvent e) |
void | mouseEntered (@NotNull final MouseEvent e) |
void | mouseExited (@NotNull final MouseEvent e) |
void | mouseMoved (@NotNull final MouseEvent e) |
void | mousePressed (@NotNull final MouseEvent e) |
void | mouseReleased (@NotNull final MouseEvent e) |
void | mouseWheelMoved (final int wheelRotation) |
void | setChanged () |
void | setChangedListener (@Nullable final GUIElementChangedListener changedListener) |
void | setDefault (final boolean isDefault) |
void | setIgnore () |
String | toString () |
Protected Member Functions | |
void | textChanged () |
Protected Member Functions inherited from com.realtime.crossfire.jxclient.gui.label.AbstractLabel | |
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) | |
String | getText () |
Color | getTextColor () |
Font | getTextFont () |
Protected Member Functions inherited from com.realtime.crossfire.jxclient.gui.gui.AbstractGUIElement | |
AbstractGUIElement (@NotNull final TooltipManager tooltipManager, @NotNull final GUIElementListener elementListener, @NotNull final String name, final boolean opaque, @NotNull final GuiFactory guiFactory) | |
TooltipText | newTooltipText (@Nullable final String tooltipText) |
void | tooltipChanged () |
Private Member Functions | |
void | autoResize () |
Private Attributes | |
boolean | autoResize |
Static Private Attributes | |
static final int | AUTO_BORDER_SIZE = 2 |
static final Pattern | PATTERN_LINE_BREAK = Pattern.compile("<br>") |
static final long | serialVersionUID = 1 |
Implements an AbstractLabel that displays HTML contents.
Definition at line 49 of file GUIHTMLLabel.java.
com.realtime.crossfire.jxclient.gui.label.GUIHTMLLabel.GUIHTMLLabel | ( | @NotNull final TooltipManager | tooltipManager, |
@NotNull final GUIElementListener | elementListener, | ||
@NotNull final String | name, | ||
@Nullable final BufferedImage | backgroundPicture, | ||
@NotNull final Font | font, | ||
@NotNull final Color | color, | ||
@Nullable final Color | backgroundColor, | ||
@NotNull final String | text, | ||
@NotNull final GuiFactory | guiFactory | ||
) |
Creates a new instance.
tooltipManager | the tooltip manager to update |
elementListener | the element listener to notify |
name | the name of this element |
backgroundPicture | the optional background picture |
font | the text font |
color | the text color |
backgroundColor | the background color; ignored if background picture is set |
text | the text |
guiFactory | the global GUI factory instance |
Definition at line 85 of file GUIHTMLLabel.java.
References com.realtime.crossfire.jxclient.gui.label.AbstractLabel.backgroundColor, com.realtime.crossfire.jxclient.gui.gui.AbstractGUIElement.elementListener, com.realtime.crossfire.jxclient.gui.gui.AbstractGUIElement.guiFactory, com.realtime.crossfire.jxclient.gui.gui.AbstractGUIElement.name, com.realtime.crossfire.jxclient.gui.label.AbstractLabel.text, and com.realtime.crossfire.jxclient.gui.gui.AbstractGUIElement.tooltipManager.
|
private |
If auto-resizing is enabled, calculate the new width and height.
Definition at line 132 of file GUIHTMLLabel.java.
References com.realtime.crossfire.jxclient.gui.label.GUIHTMLLabel.AUTO_BORDER_SIZE, com.realtime.crossfire.jxclient.gui.label.GUIHTMLLabel.autoResize, com.realtime.crossfire.jxclient.gui.label.AbstractLabel.getText(), com.realtime.crossfire.jxclient.gui.gui.GuiUtils.getTextDimension(), com.realtime.crossfire.jxclient.gui.label.AbstractLabel.getTextFont(), and com.realtime.crossfire.jxclient.gui.label.GUIHTMLLabel.PATTERN_LINE_BREAK.
Dimension com.realtime.crossfire.jxclient.gui.label.GUIHTMLLabel.getMinimumSize | ( | ) |
Definition at line 159 of file GUIHTMLLabel.java.
Dimension com.realtime.crossfire.jxclient.gui.label.GUIHTMLLabel.getPreferredSize | ( | ) |
Definition at line 152 of file GUIHTMLLabel.java.
TooltipText com.realtime.crossfire.jxclient.gui.label.GUIHTMLLabel.getTooltip | ( | ) |
Returns the current tooltip text.
Reimplemented from com.realtime.crossfire.jxclient.gui.gui.AbstractGUIElement.
Definition at line 169 of file GUIHTMLLabel.java.
void com.realtime.crossfire.jxclient.gui.label.GUIHTMLLabel.notifyOpen | ( | ) |
Called each time the enclosing dialog is opened (or raised).
Implements com.realtime.crossfire.jxclient.gui.gui.GUIElement.
Definition at line 164 of file GUIHTMLLabel.java.
void com.realtime.crossfire.jxclient.gui.label.GUIHTMLLabel.paintComponent | ( | @NotNull final Graphics | g | ) |
Reimplemented from com.realtime.crossfire.jxclient.gui.label.AbstractLabel.
Definition at line 110 of file GUIHTMLLabel.java.
References com.realtime.crossfire.jxclient.gui.label.GUIHTMLLabel.AUTO_BORDER_SIZE, com.realtime.crossfire.jxclient.gui.label.GUIHTMLLabel.autoResize, com.realtime.crossfire.jxclient.gui.label.AbstractLabel.getText(), com.realtime.crossfire.jxclient.gui.label.AbstractLabel.getTextColor(), and com.realtime.crossfire.jxclient.gui.label.AbstractLabel.getTextFont().
void com.realtime.crossfire.jxclient.gui.label.GUIHTMLLabel.setAutoResize | ( | final boolean | autoResize | ) |
Enable or disable auto-resizing. If enabled, the gui element's size changes to the displayed text's size.
autoResize | If set, enable auto-resizing; if unset, disable auto-resizing. |
Definition at line 102 of file GUIHTMLLabel.java.
References com.realtime.crossfire.jxclient.gui.label.GUIHTMLLabel.autoResize.
Referenced by com.realtime.crossfire.jxclient.skin.io.JXCSkinLoader.parseTooltip().
|
protected |
Will be called whenever text or getTextColor() has changed.
Reimplemented from com.realtime.crossfire.jxclient.gui.label.AbstractLabel.
Definition at line 90 of file GUIHTMLLabel.java.
References com.realtime.crossfire.jxclient.gui.label.GUIHTMLLabel.autoResize, and com.realtime.crossfire.jxclient.gui.gui.AbstractGUIElement.setChanged().
|
staticprivate |
Size of border around text in auto-resize mode.
Definition at line 59 of file GUIHTMLLabel.java.
Referenced by com.realtime.crossfire.jxclient.gui.label.GUIHTMLLabel.autoResize(), and com.realtime.crossfire.jxclient.gui.label.GUIHTMLLabel.paintComponent().
|
private |
If set, auto-resize this element to the extent of getText().
Definition at line 70 of file GUIHTMLLabel.java.
Referenced by com.realtime.crossfire.jxclient.gui.label.GUIHTMLLabel.autoResize(), com.realtime.crossfire.jxclient.gui.label.GUIHTMLLabel.paintComponent(), com.realtime.crossfire.jxclient.gui.label.GUIHTMLLabel.setAutoResize(), and com.realtime.crossfire.jxclient.gui.label.GUIHTMLLabel.textChanged().
|
staticprivate |
The pattern used to split a string into lines.
Definition at line 65 of file GUIHTMLLabel.java.
Referenced by com.realtime.crossfire.jxclient.gui.label.GUIHTMLLabel.autoResize().
|
staticprivate |
The serial version UID.
Definition at line 54 of file GUIHTMLLabel.java.