Class GUIHTMLLabel

All Implemented Interfaces:
GUIElement, ImageObserver, MenuContainer, Serializable

public class GUIHTMLLabel extends AbstractLabel
Implements an AbstractLabel that displays HTML contents.
See Also:
  • Constructor Details

    • GUIHTMLLabel

      public GUIHTMLLabel(@NotNull @NotNull TooltipManager tooltipManager, @NotNull @NotNull GUIElementListener elementListener, @NotNull @NotNull String name, @Nullable @Nullable BufferedImage backgroundPicture, @NotNull @NotNull Font font, @NotNull @NotNull Color color, @Nullable @Nullable Color backgroundColor, @NotNull @NotNull String text, @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
      backgroundPicture - the optional background picture
      font - the text font
      color - the text color
      backgroundColor - the background color; ignored if background picture is set
      text - the text
      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
    • setAutoResize

      public void setAutoResize(boolean autoResize)
      Enable or disable auto-resizing. If enabled, the gui element's size changes to the displayed text's size.
      Parameters:
      autoResize - If set, enable auto-resizing; if unset, disable auto-resizing.
    • paintComponent

      public void paintComponent(@NotNull @NotNull Graphics g)
      Overrides:
      paintComponent in class AbstractLabel
    • getPreferredSize

      @Nullable public @Nullable Dimension getPreferredSize()
      Overrides:
      getPreferredSize in class JComponent
    • getMinimumSize

      @Nullable public @Nullable Dimension getMinimumSize()
      Overrides:
      getMinimumSize in class JComponent
    • notifyOpen

      public void notifyOpen()
      Description copied from interface: GUIElement
      Called each time the enclosing dialog is opened (or raised).
    • getTooltip

      @Nullable public @Nullable TooltipText getTooltip()
      Description copied from class: AbstractGUIElement
      Returns the current tooltip text.
      Specified by:
      getTooltip in class AbstractGUIElement
      Returns:
      the tooltip text or null to not show a tooltip