Class GUICharacter

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

public class GUICharacter extends ActivatableGUIElement implements GUIScrollable
A character displaying GUI element.
See Also:
  • Constructor Details

    • GUICharacter

      public GUICharacter(@NotNull @NotNull TooltipManager tooltipManager, @NotNull @NotNull FacesManager facesManager, @NotNull @NotNull GUIElementListener elementListener, @NotNull @NotNull String name, int w, int h, @NotNull @NotNull Font font, int defaultIndex, CharacterModel characterModel, @NotNull @NotNull GuiFactory guiFactory)
      Creates a new instance.
      Parameters:
      tooltipManager - the tooltip manager to update
      facesManager - the faces to use to display
      elementListener - the element listener to notify
      name - the name of this element
      w - the width for drawing this element to screen
      h - the height for drawing this element to screen
      font - the font to use
      defaultIndex - the initial metaserver index
      characterModel - the character model to monitor
      guiFactory - the global GUI factory instance
  • Method Details

    • activeChanged

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

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

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

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

      public boolean canScroll(int distance)
      Description copied from interface: GUIScrollable
      Returns whether scrolling is possible.
      Specified by:
      canScroll in interface GUIScrollable
      Parameters:
      distance - the distance to scroll
      Returns:
      whether scrolling is possible
    • scroll

      public void scroll(int distance)
      Description copied from interface: GUIScrollable
      Scrolls the element.
      Specified by:
      scroll in interface GUIScrollable
      Parameters:
      distance - the distance to scroll
    • resetScroll

      public void resetScroll()
      Description copied from interface: GUIScrollable
      Resets the scroll index to the default value.
      Specified by:
      resetScroll in interface GUIScrollable
    • getIndex

      public int getIndex()
      Returns the index of this element.
      Returns:
      the index
    • setIndex

      public void setIndex(int index)
      Sets the index of this element.
      Parameters:
      index - the index
    • setSelected

      public void setSelected(boolean selected)
      Sets the selected state.
      Parameters:
      selected - whether this element should be drawn as "selected"
    • 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
    • notifyOpen

      public void notifyOpen()
      Description copied from interface: GUIElement
      Called each time the enclosing dialog is opened (or raised).
      Specified by:
      notifyOpen in interface GUIElement
    • 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