 |
Crossfire JXClient, Trunk
|
Go to the documentation of this file.
23 package com.realtime.crossfire.jxclient.gui.label;
32 import java.awt.Color;
34 import org.jetbrains.annotations.NotNull;
35 import org.jetbrains.annotations.Nullable;
68 public void resetBefore() {
73 public void resetAfter() {
78 public void statChanged(
final int statNo,
final int value) {
105 if (
stat == statNo) {
106 setText(String.valueOf(value));
113 public void simpleWeaponSpeedChanged(
final boolean simpleWeaponSpeed) {
118 public void titleChanged(@NotNull
final String title) {
125 public void godNameChanged(@NotNull
final String godName) {
132 public void rangeChanged(@NotNull
final String range) {
138 if (range.startsWith(
"Range: spell ")) {
139 text = range.substring(13);
140 }
else if (range.startsWith(
"Range: ") || range.startsWith(
"Skill: ")) {
141 text = range.substring(7);
149 public void activeSkillChanged(@NotNull
final String activeSkill) {
156 public void experienceChanged(
final long exp) {
163 public void experienceNextLevelChanged(
final long expNextLevel) {
165 setText(String.valueOf(expNextLevel));
185 public GUILabelStats(@NotNull
final TooltipManager tooltipManager, @NotNull
final GUIElementListener elementListener, @NotNull
final String
name, @NotNull
final Font
textFont, @NotNull
final Color
textColor, @NotNull
final Color
textHighlightColor, @Nullable
final Color
backgroundColor,
final int stat, @NotNull
final Alignment alignment, @NotNull
final Stats stats, @NotNull
final GuiFactory guiFactory) {
186 super(
tooltipManager,
elementListener,
name,
null,
textFont,
textColor,
textHighlightColor,
backgroundColor, alignment,
"",
guiFactory);
210 return super.getTooltip();
final Color textColor
The text color when not highlighted.
void tooltipChanged()
Must be called whenever the tooltip may have changed.
static final int CS_STAT_WEAP_SP
The Weapon Speed stat.
final Color backgroundColor
If set, the opaque background color.
void setTextHighlight(final boolean textHighlight)
Sets whether the text should be highlighted.
static final int CS_STAT_OVERLOAD
Indicates how much the character is overloaded: 0=not overloaded, 1=overloaded.
static final int CS_STAT_TITLE
The Title stat.
final StatsListener statsListener
The StatsListener registered to be notified about stat changes.
final GUIElementListener elementListener
The GUIElementListener to notify.
boolean isOverloaded()
Returns whether the character is currently overloaded.
final Stats stats
The Stats instance to use.
final Color textHighlightColor
The text color when highlighted.
static final int CS_STAT_RANGE
The Range stat - this is what is currently readied by the player to fire.
static final int C_STAT_CURRENT_SKILL
The name of the current skill.
GUILabelStats(@NotNull final TooltipManager tooltipManager, @NotNull final GUIElementListener elementListener, @NotNull final String name, @NotNull final Font textFont, @NotNull final Color textColor, @NotNull final Color textHighlightColor, @Nullable final Color backgroundColor, final int stat, @NotNull final Alignment alignment, @NotNull final Stats stats, @NotNull final GuiFactory guiFactory)
Creates a new instance.
void removeCrossfireStatsListener(@NotNull final StatsListener statsListener)
Removes a StatsListener to be notified about stat changes.
final int stat
The stat to display.
double getFloatStat(final int statNo)
Returns the numerical value of the given statistic.
static final int CS_STAT_GOD_NAME
The character's god or NO_GOD_NAME if he has none.
static final int CS_STAT_EXP64
The Global Experience (64bit encoding) stat.
double getWeaponSpeed()
Returns the weapon speed stat.
static final long serialVersionUID
The serial version UID.
static final int C_STAT_EXP_NEXT_LEVEL
The global experience needed to reach next level stat.
static final int CS_STAT_WEIGHT_LIM
The Weight Limit stat.
void setText(@NotNull final String text)
Sets the label text.
This is the representation of all the statistics of a player, like its speed or its experience.
final GuiFactory guiFactory
The global GuiFactory instance.
TooltipText newTooltipText(@Nullable final String tooltipText)
Creates a TooltipText instance relative to this instance.
Information for displaying tooltips.
Factory for creating Gui instances.
final String name
The name of this element.
String text
The label text.
TooltipText getTooltip()
Returns the current tooltip text.
static final int CS_STAT_SPEED
The Speed stat.
final TooltipManager tooltipManager
The TooltipManager to update.
static final int CS_STAT_CHARACTER_FLAGS
Flags the character's current state.
int getStat(final int statNo)
Returns the numerical value of the given statistic.
static final int C_STAT_WEIGHT
The character's weight.
A AbstractLabel that renders the text as a plain string.
Interface for listeners interested in changes of Stats instances.
static final int CS_STAT_EXP
The Global Experience (32bit encoding) stat.
void dispose()
Releases all allocated resources.
final Font textFont
The font for rendering the label text.
A GUILabel that displays a value of the last received "stats" command.
Listener for GUIElement related events.