Class GaugeUpdater

java.lang.Object
com.realtime.crossfire.jxclient.gui.gauge.GaugeUpdater
Direct Known Subclasses:
ActiveSkillGaugeUpdater, ActiveSkillGaugeUpdater2, SkillGaugeUpdater, StatGaugeUpdater

public abstract class GaugeUpdater extends Object
Updates the displayed values in a GUIGauge.
  • Constructor Details

    • GaugeUpdater

      protected GaugeUpdater(@NotNull @NotNull ExperienceTable experienceTable, boolean hideIfEmpty)
      Creates a new instance.
      Parameters:
      experienceTable - the experience table to query
      hideIfEmpty - if true the gauge will be hidden if all values are 0
  • Method Details

    • dispose

      public abstract void dispose()
      Frees allocated resources.
    • setGauge

      public void setGauge(@NotNull @NotNull GUIGaugeListener gauge)
      Sets the gauge to update.
      Parameters:
      gauge - the gauge
    • setValues

      protected void setValues(int curValue, int minValue, int maxValue)
      Updates the gauge values.
      Parameters:
      curValue - the current value
      minValue - the minimum value
      maxValue - the maximum value
    • setValues

      protected void setValues(int curValue, int minValue, int maxValue, @NotNull @NotNull String labelText, @NotNull @NotNull String tooltipText)
      Updates the gauge values.
      Parameters:
      curValue - the current value
      minValue - the minimum value
      maxValue - the maximum value
      labelText - the text to draw on the gauge
      tooltipText - the tooltip suffix
    • getPercentsToNextLevel

      protected int getPercentsToNextLevel(int level, long experience)
      Returns the experience fraction of the current level.
      Parameters:
      level - the level
      experience - the experience
      Returns:
      the fraction in percents
    • getExperienceToNextLevel

      protected long getExperienceToNextLevel(int level, long experience)
      Returns the experience needed to reach next level.
      Parameters:
      level - the level
      experience - the experience
      Returns:
      the needed experience