All Implemented Interfaces:
GUIElement, GUIScrollable, ImageObserver, MenuContainer, Serializable
Direct Known Subclasses:
GUIItemItem, GUIItemShortcut

public abstract class GUIItem extends ActivatableGUIElement implements GUIScrollable
A GUIElement representing an in-game object.
See Also:
  • Constructor Details

    • GUIItem

      protected GUIItem(@NotNull @NotNull TooltipManager tooltipManager, @NotNull @NotNull GUIElementListener elementListener, @NotNull @NotNull String name, @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
      guiFactory - the global GUI factory instance
  • Method Details

    • mouseClicked

      public void mouseClicked(@NotNull @NotNull MouseEvent e)
      Description copied from interface: GUIElement
      Will be called when the user has clicked (pressed+released) this element. This event will be delivered after GUIElement.mouseReleased(MouseEvent).
      Specified by:
      mouseClicked in interface GUIElement
      Overrides:
      mouseClicked in class AbstractGUIElement
      Parameters:
      e - the mouse event relative to this element
    • execute

      public void execute()
      Description copied from class: ActivatableGUIElement
      Executes the actions associated with this GUI element. Does nothing if this element has no associated actions.
      Specified by:
      execute in class ActivatableGUIElement
    • button1Clicked

      public abstract void button1Clicked(int modifiers)
      Called when the left mouse button was pressed.
      Parameters:
      modifiers - the input event modifiers
    • button2Clicked

      public abstract void button2Clicked(int modifiers)
      Called when the middle mouse button was pressed.
      Parameters:
      modifiers - the input event modifiers
    • button3Clicked

      public abstract void button3Clicked(int modifiers)
      Called when the right mouse button was pressed.
      Parameters:
      modifiers - the input event modifiers
    • activeChanged

      public void activeChanged()
      Description copied from class: ActivatableGUIElement
      Will be called whenever the active state has changed.
      Specified by:
      activeChanged in class ActivatableGUIElement
    • setVisible

      public void setVisible(boolean aFlag)
      Overrides:
      setVisible in class JComponent