All Implemented Interfaces:
GUIElement, ImageObserver, MenuContainer, Serializable
Direct Known Subclasses:
GUIMultiLineLabel, GUIOneLineLabel

public abstract class GUILabel extends AbstractLabel
Abstract base class for labels that render text.
See Also:
  • Constructor Details

    • GUILabel

      protected GUILabel(@NotNull @NotNull TooltipManager tooltipManager, @NotNull @NotNull GUIElementListener elementListener, @NotNull @NotNull String name, @Nullable @Nullable BufferedImage picture, @NotNull @NotNull String text, @NotNull @NotNull Font textFont, @NotNull @NotNull Color textColor, @NotNull @NotNull Color textHighlightColor, @Nullable @Nullable Color backgroundColor, @NotNull @NotNull Alignment textAlignment, @NotNull @NotNull GuiFactory guiFactory)
      Creates a new instance.
      Parameters:
      tooltipManager - the tooltip manager to update
      elementListener - the element listener to notify
      name - the name of this element
      picture - the background image; null for no background
      text - the text
      textFont - the font for rendering the label text
      textColor - the text color when not highlighted
      textHighlightColor - the text color when highlighted
      backgroundColor - the background color
      textAlignment - the text alignment
      guiFactory - the global GUI factory instance
  • Method Details

    • textChanged

      protected void textChanged()
      Description copied from class: AbstractLabel
      Will be called whenever AbstractLabel.text or AbstractLabel.getTextColor() has changed.
      Overrides:
      textChanged in class AbstractLabel
    • drawLine

      protected void drawLine(@NotNull @NotNull Graphics2D g, int y0, int h0, @NotNull @NotNull String text)
      Draws one line of text.
      Parameters:
      g - the graphics to paint to
      y0 - the y-coordinate to draw to
      h0 - the line height
      text - the text to draw