Class SlotGrid

All Implemented Interfaces:
ContentChangeListener, Inspectable, ImageObserver, MenuContainer, Serializable

public class SlotGrid extends JComponent implements ContentChangeListener, Inspectable
A view of an RPSlot in a grid of ItemPanels.
See Also:
Serialized Form
  • Constructor Details

    • SlotGrid

      public SlotGrid(int width, int height)
  • Method Details

    • setSlotsLayout

      public void setSlotsLayout(int width, int height)
    • setAcceptedTypes

      @SafeVarargs public final void setAcceptedTypes(Class<? extends IEntity>... types)
      Set the types the panels can accept.
      Parameters:
      types - accepted types
    • setSlot

      public void setSlot(IEntity parent, String slot)
      Sets the parent entity of the window.
      Parameters:
      parent - entity owning the slot represented by the grid
      slot - the slot represented by the grid
    • getSlotName

      public String getSlotName()
      Get the name of the slot this grid represents.
      Returns:
      name of the slot
    • setInspector

      public void setInspector(Inspector inspector)
      Set the inspector the contained entities should use.
      Specified by:
      setInspector in interface Inspectable
      Parameters:
      inspector - used inspector
    • contentAdded

      public void contentAdded(RPSlot added)
      Description copied from interface: ContentChangeListener
      Called when entities are added in slots, or the attributes of the entities are changed.
      Specified by:
      contentAdded in interface ContentChangeListener
      Parameters:
      added - object changes
    • contentRemoved

      public void contentRemoved(RPSlot removed)
      Description copied from interface: ContentChangeListener
      Called when entities are removed from slots, of attributes of the entities are removed.
      Specified by:
      contentRemoved in interface ContentChangeListener
      Parameters:
      removed - object changes