 |
Crossfire JXClient, Trunk
|
Go to the documentation of this file.
23 package com.realtime.crossfire.jxclient.gui.label;
30 import java.awt.Color;
31 import java.awt.Dimension;
33 import java.awt.Graphics;
34 import java.awt.Graphics2D;
35 import java.awt.image.BufferedImage;
36 import org.jetbrains.annotations.NotNull;
37 import org.jetbrains.annotations.Nullable;
64 public GUIOneLineLabel(@NotNull
final TooltipManager tooltipManager, @NotNull
final GUIElementListener elementListener, @NotNull
final String
name, @Nullable
final BufferedImage picture, @NotNull
final Font
textFont, @NotNull
final Color
textColor, @NotNull
final Color
textHighlightColor, @Nullable
final Color
backgroundColor, @NotNull
final Alignment alignment, @NotNull
final String
text, @NotNull
final GuiFactory guiFactory) {
65 super(
tooltipManager,
elementListener,
name, picture,
text,
textFont,
textColor,
textHighlightColor,
backgroundColor, alignment,
guiFactory);
70 super.paintComponent(g);
76 @SuppressWarnings(
"MethodDoesntCallSuperMethod")
83 @SuppressWarnings(
"MethodDoesntCallSuperMethod")
90 @SuppressWarnings(
"MethodDoesntCallSuperMethod")
93 result.width = Integer.MAX_VALUE;
String getText()
Returns the label text.
final Color textColor
The text color when not highlighted.
final Color backgroundColor
If set, the opaque background color.
Dimension getMinimumSize()
Dimension getMinimumSizeInt()
Returns the minimal size needed to display this component.
void drawLine(@NotNull final Graphics2D g, final int y0, final int h0, @NotNull final String text)
Draws one line of text.
static Dimension getTextDimension(@NotNull final String text, @NotNull final FontMetrics fontMetrics)
Returns the extents of a string when rendered in a given Font on this component.
final GUIElementListener elementListener
The GUIElementListener to notify.
final Color textHighlightColor
The text color when highlighted.
void paintComponent(@NotNull final Graphics g)
GUIOneLineLabel(@NotNull final TooltipManager tooltipManager, @NotNull final GUIElementListener elementListener, @NotNull final String name, @Nullable final BufferedImage picture, @NotNull final Font textFont, @NotNull final Color textColor, @NotNull final Color textHighlightColor, @Nullable final Color backgroundColor, @NotNull final Alignment alignment, @NotNull final String text, @NotNull final GuiFactory guiFactory)
Creates a new instance.
Dimension getPreferredSize()
Utility class for Gui related functions.
Dimension getMaximumSize()
Abstract base class for labels that render text.
final GuiFactory guiFactory
The global GuiFactory instance.
Information for displaying tooltips.
Factory for creating Gui instances.
final String name
The name of this element.
static final long serialVersionUID
The serial version UID.
String text
The label text.
TooltipText getTooltip()
Returns the current tooltip text.
void notifyOpen()
Called each time the enclosing dialog is opened (or raised).
final TooltipManager tooltipManager
The TooltipManager to update.
A AbstractLabel that renders the text as a plain string.
final Font textFont
The font for rendering the label text.
Listener for GUIElement related events.
Font getTextFont()
Returns the font.