 |
Crossfire JXClient, Trunk
|
Go to the documentation of this file.
23 package com.realtime.crossfire.jxclient.gui.gauge;
26 import org.jetbrains.annotations.NotNull;
27 import org.jetbrains.annotations.Nullable;
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);
void setValues(final int curValue, final int minValue, final int maxValue, @NotNull final String labelText, @NotNull final String tooltipText)
Updates the gauge values.
int getPercentsToNextLevel(final int level, final long experience)
Returns the experience fraction of the current level.
void setValues(int curValue, int minValue, int maxValue, @NotNull String labelText, @NotNull String tooltipText)
Sets the values to display.
final ExperienceTable experienceTable
The experience table to query.
long getExperienceToNextLevel(final int level, final long experience)
Returns the experience needed to reach next level.
Updates the displayed values in a GUIGauge.
void setHidden(boolean hidden)
Specify whether this item should hide itself, independent of the "visibility" state.
GaugeUpdater(@NotNull final ExperienceTable experienceTable, final boolean hideIfEmpty)
Creates a new instance.
final boolean hideIfEmpty
If true then the gauge should be hidden if all values are 0.
GUIGaugeListener gauge
Set the gauge to update.
void setValues(final int curValue, final int minValue, final int maxValue)
Updates the gauge values.
Interface which is implemented by all listener classes.
abstract void dispose()
Frees allocated resources.
long getExperienceToNextLevel(final int currentLevel, final long currentExp)
Returns the experience needed to reach the next level.
Stores experience <-> level mappings.
void setGauge(@NotNull final GUIGaugeListener gauge)
Sets the gauge to update.
int getPercentsToNextLevel(final int currentLevel, final long currentExp)
Returns the experience fraction of the current level in percents.