22 package com.realtime.crossfire.jxclient.gui.gauge;
25 import org.jetbrains.annotations.NotNull;
26 import org.jetbrains.annotations.Nullable;
70 @SuppressWarnings(
"NullableProblems")
85 protected void setValues(
final int curValue,
final int minValue,
final int maxValue) {
87 final String curValueString = Integer.toString(curValue);
88 final String tooltipText = minValue == 0 ? curValue+
"/"+maxValue : curValueString;
90 gauge.
setValues(curValue, minValue, maxValue, curValueString, tooltipText);
106 protected void setValues(
final int curValue,
final int minValue,
final int maxValue, @NotNull
final String labelText, @NotNull
final String tooltipText) {
108 gauge.
setValues(curValue, minValue, maxValue, labelText, tooltipText);
Interface which is implemented by all listener classes.
int getPercentsToNextLevel(final int level, final long experience)
Returns the experience fraction of the current level.
long getExperienceToNextLevel(final int currentLevel, final long currentExp)
Returns the experience needed to reach the next level.
int getPercentsToNextLevel(final int currentLevel, final long currentExp)
Returns the experience fraction of the current level in percents.
GaugeUpdater(@NotNull final ExperienceTable experienceTable, final boolean hideIfEmpty)
Creates a new instance.
void setValues(final int curValue, final int minValue, final int maxValue, @NotNull final String labelText, @NotNull final String tooltipText)
Updates the gauge values.
GUIGaugeListener gauge
Set the gauge to update.
final ExperienceTable experienceTable
The experience table to query.
Updates the displayed values in a GUIGauge.
Stores experience <-> level mappings.
void setGauge(@NotNull final GUIGaugeListener gauge)
Sets the gauge to update.
long getExperienceToNextLevel(final int level, final long experience)
Returns the experience needed to reach next level.
void setValues(final int curValue, final int minValue, final int maxValue)
Updates the gauge values.
void setValues(int curValue, int minValue, int maxValue, @NotNull String labelText, @NotNull String tooltipText)
Sets the values to display.
final boolean hideIfEmpty
If true then the gauge should be hidden if all values are 0.
void setHidden(boolean hidden)
Specify whether this item should hide itself, independent of the "visibility" state.
abstract void dispose()
Frees allocated resources.