Crossfire JXClient, Trunk
Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes | Static Private Attributes | List of all members
com.realtime.crossfire.jxclient.gui.label.GUIHTMLLabel Class Reference
Inheritance diagram for com.realtime.crossfire.jxclient.gui.label.GUIHTMLLabel:
Inheritance graph
Collaboration diagram for com.realtime.crossfire.jxclient.gui.label.GUIHTMLLabel:
Collaboration graph

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
 

Detailed Description

Implements an AbstractLabel that displays HTML contents.

Author
Lauwenmark

Definition at line 49 of file GUIHTMLLabel.java.

Constructor & Destructor Documentation

◆ GUIHTMLLabel()

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.

Parameters
tooltipManagerthe tooltip manager to update
elementListenerthe element listener to notify
namethe name of this element
backgroundPicturethe optional background picture
fontthe text font
colorthe text color
backgroundColorthe background color; ignored if background picture is set
textthe text
guiFactorythe 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.

Member Function Documentation

◆ autoResize()

void com.realtime.crossfire.jxclient.gui.label.GUIHTMLLabel.autoResize ( )
private

◆ getMinimumSize()

Dimension com.realtime.crossfire.jxclient.gui.label.GUIHTMLLabel.getMinimumSize ( )

Definition at line 159 of file GUIHTMLLabel.java.

◆ getPreferredSize()

Dimension com.realtime.crossfire.jxclient.gui.label.GUIHTMLLabel.getPreferredSize ( )

Definition at line 152 of file GUIHTMLLabel.java.

◆ getTooltip()

TooltipText com.realtime.crossfire.jxclient.gui.label.GUIHTMLLabel.getTooltip ( )

Returns the current tooltip text.

Returns
the tooltip text or
null
to not show a tooltip

Reimplemented from com.realtime.crossfire.jxclient.gui.gui.AbstractGUIElement.

Definition at line 169 of file GUIHTMLLabel.java.

◆ notifyOpen()

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.

◆ paintComponent()

void com.realtime.crossfire.jxclient.gui.label.GUIHTMLLabel.paintComponent ( @NotNull final Graphics  g)

◆ setAutoResize()

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.

Parameters
autoResizeIf 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().

Here is the caller graph for this function:

◆ textChanged()

void com.realtime.crossfire.jxclient.gui.label.GUIHTMLLabel.textChanged ( )
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().

Here is the call graph for this function:

Member Data Documentation

◆ AUTO_BORDER_SIZE

final int com.realtime.crossfire.jxclient.gui.label.GUIHTMLLabel.AUTO_BORDER_SIZE = 2
staticprivate

◆ autoResize

boolean com.realtime.crossfire.jxclient.gui.label.GUIHTMLLabel.autoResize
private

◆ PATTERN_LINE_BREAK

final Pattern com.realtime.crossfire.jxclient.gui.label.GUIHTMLLabel.PATTERN_LINE_BREAK = Pattern.compile("<br>")
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().

◆ serialVersionUID

final long com.realtime.crossfire.jxclient.gui.label.GUIHTMLLabel.serialVersionUID = 1
staticprivate

The serial version UID.

Definition at line 54 of file GUIHTMLLabel.java.


The documentation for this class was generated from the following file: