java.lang.Object com.realtime.crossfire.jxclient.gui.gauge.GaugeUpdater
public abstract class GaugeUpdater
Updates the displayed values in a GUIGauge
.
Field Summary | |
---|---|
private ExperienceTable |
experienceTable
The experience table to query. |
private GUIGaugeListener |
gauge
Set the gauge to update. |
Constructor Summary | |
---|---|
protected |
GaugeUpdater(ExperienceTable experienceTable)
Creates a new instance. |
Method Summary | |
---|---|
abstract void |
dispose()
Frees allocated resources. |
protected long |
getExperienceToNextLevel(int level,
long experience)
Returns the experience needed to reach next level. |
protected int |
getPercentsToNextLevel(int level,
long experience)
Returns the experience fraction of the current level. |
void |
setGauge(GUIGaugeListener gauge)
Sets the gauge to update. |
protected void |
setValues(int curValue,
int minValue,
int maxValue)
Updates the gauge values. |
protected void |
setValues(int curValue,
int minValue,
int maxValue,
java.lang.String labelText,
java.lang.String tooltipText)
Updates the gauge values. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
@NotNull private final ExperienceTable experienceTable
@Nullable private GUIGaugeListener gauge
Constructor Detail |
---|
protected GaugeUpdater(@NotNull ExperienceTable experienceTable)
experienceTable
- the experience table to queryMethod Detail |
---|
public abstract void dispose()
protected long getExperienceToNextLevel(int level, long experience)
level
- the levelexperience
- the experience
protected int getPercentsToNextLevel(int level, long experience)
level
- the levelexperience
- the experience
public void setGauge(@NotNull GUIGaugeListener gauge)
gauge
- the gaugeprotected void setValues(int curValue, int minValue, int maxValue)
curValue
- the current valueminValue
- the minimum valuemaxValue
- the maximum valueprotected void setValues(int curValue, int minValue, int maxValue, @NotNull java.lang.String labelText, @NotNull java.lang.String tooltipText)
curValue
- the current valueminValue
- the minimum valuemaxValue
- the maximum valuelabelText
- the text to draw on the gaugetooltipText
- the tooltip suffix