Class GUITextGauge

All Implemented Interfaces:
GUIGaugeListener, GUIElement, ImageObserver, MenuContainer, Serializable

public class GUITextGauge extends GUIGauge
A GUIGauge which displays the current value as a text string on top of the gauge.
See Also:
  • Constructor Details

    • GUITextGauge

      public GUITextGauge(@NotNull @NotNull TooltipManager tooltipManager, @NotNull @NotNull GUIElementListener elementListener, @NotNull @NotNull String name, @NotNull @NotNull Image pictureFull, @NotNull @NotNull Image pictureLow, @Nullable @Nullable Image pictureNegative, @NotNull @NotNull Image pictureEmpty, @NotNull @NotNull Orientation orientation, @Nullable @Nullable String tooltipFormat, @NotNull @NotNull Color color, @NotNull @NotNull Font font, float alpha, @Nullable @Nullable CommandList commandList, @NotNull @NotNull GuiFactory guiFactory, @NotNull @NotNull Stats stats)
      Creates a new instance.
      Parameters:
      tooltipManager - the tooltip manager to update
      elementListener - the element listener to notify
      name - the name of this element
      pictureFull - the image for positive values
      pictureLow - the image for low (<30%) values
      pictureNegative - the image for negative values
      pictureEmpty - the image for an empty gauge
      orientation - the gauge's orientation
      tooltipFormat - the format for displaying tooltips; if set to null no tooltips are shown
      color - the text color
      font - the text font
      alpha - transparency to draw with
      commandList - the command list that is executed on button 2
      guiFactory - the global GUI factory instance
      stats - the stats instance to use
  • Method Details

    • paintComponent

      public void paintComponent(@NotNull @NotNull Graphics g)
      Overrides:
      paintComponent in class GUIGauge
    • setValues

      public void setValues(int curValue, int minValue, int maxValue, @NotNull @NotNull String labelText, @NotNull @NotNull String tooltipText)
      Description copied from interface: GUIGaugeListener
      Sets the values to display.
      Specified by:
      setValues in interface GUIGaugeListener
      Overrides:
      setValues in class GUIGauge
      Parameters:
      curValue - the values to display
      minValue - the minimum possible value
      maxValue - the maximum possible value
      labelText - the label text
      tooltipText - the tooltip suffix