Class GUIItemFloor

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

public class GUIItemFloor extends GUIItemItem
A GUIElement representing an in-game object in the ground view.
See Also:
  • Constructor Details

    • GUIItemFloor

      public GUIItemFloor(@NotNull @NotNull TooltipManager tooltipManager, @NotNull @NotNull GUIElementListener elementListener, @NotNull @NotNull CommandQueue commandQueue, @NotNull @NotNull String name, @NotNull @NotNull ItemPainter itemPainter, int index, @NotNull @NotNull CrossfireServerConnection crossfireServerConnection, @NotNull @NotNull ItemView floorView, @NotNull @NotNull ItemSet itemSet, @NotNull @NotNull FacesManager facesManager, @NotNull @NotNull Image nextGroupFace, @NotNull @NotNull Image prevGroupFace, int size, @NotNull @NotNull GuiFactory guiFactory)
      Creates a new instance.
      Parameters:
      tooltipManager - the tooltip manager to update
      elementListener - the element listener to notify
      commandQueue - the command queue for sending commands
      name - the name of this element
      itemPainter - the item painter for painting the icon
      index - the initial scroll index
      crossfireServerConnection - the connection instance
      floorView - the floor view to use
      itemSet - the item set to use
      facesManager - the faces manager instance to use
      nextGroupFace - the image for "prev group of items"
      prevGroupFace - the image for "next group of items"
      size - the size of the component or 0 for undefined
      guiFactory - the global GUI factory instance
  • Method Details

    • dispose

      public void dispose()
      Description copied from interface: GUIElement
      Releases all allocated resources.
      Specified by:
      dispose in interface GUIElement
      Overrides:
      dispose in class GUIItemItem
    • notifyOpen

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

      public boolean canScroll(int distance)
      Description copied from interface: GUIScrollable
      Returns whether scrolling is possible.
      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.
      Parameters:
      distance - the distance to scroll
    • resetScroll

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

      public void button1Clicked(int modifiers)
      Description copied from class: GUIItem
      Called when the left mouse button was pressed.
      Specified by:
      button1Clicked in class GUIItem
      Parameters:
      modifiers - the input event modifiers
    • button2Clicked

      public void button2Clicked(int modifiers)
      Description copied from class: GUIItem
      Called when the middle mouse button was pressed.
      Specified by:
      button2Clicked in class GUIItem
      Parameters:
      modifiers - the input event modifiers
    • button3Clicked

      public void button3Clicked(int modifiers)
      Description copied from class: GUIItem
      Called when the right mouse button was pressed.
      Specified by:
      button3Clicked in class GUIItem
      Parameters:
      modifiers - the input event modifiers
    • getIndex

      public int getIndex()
      Description copied from class: GUIItemItem
      Returns the slot index.
      Specified by:
      getIndex in class GUIItemItem
      Returns:
      the slot index
    • setIndexNoListeners

      public void setIndexNoListeners(int index)
      Description copied from class: GUIItemItem
      Sets the slot index to display without registering listeners for updates.
      Specified by:
      setIndexNoListeners in class GUIItemItem
      Parameters:
      index - the slot index
    • getFace

      @NotNull protected @NotNull Image getFace(@NotNull @NotNull CfItem item)
      Description copied from class: GUIItemItem
      Returns the face for a CfItem instance.
      Specified by:
      getFace in class GUIItemItem
      Parameters:
      item - the item instance
      Returns:
      the face
    • setSelected

      public void setSelected(boolean selected)
      Description copied from class: GUIItemItem
      Sets the selected state.
      Specified by:
      setSelected in class GUIItemItem
      Parameters:
      selected - whether this element should be drawn as "selected"
    • isSelected

      protected boolean isSelected()
      Description copied from class: GUIItemItem
      Returns whether this element should be drawn as "selected".
      Specified by:
      isSelected in class GUIItemItem
      Returns:
      whether this element is selected