java.lang.Object
de.placeblock.betterinventories.content.GUISection
de.placeblock.betterinventories.content.pane.GUIPane
All Implemented Interfaces:
Sizeable
Direct Known Subclasses:
BaseSimpleGUIPane, HorizontalSplitGUIPane

public abstract class GUIPane extends GUISection
A GUISection that can contain other GUISections. Renders to a List.
How the own size is updated can be implemented by the different GUIPanes.
  • Constructor Details

    • GUIPane

      public GUIPane(GUI gui, Vector2d minSize, Vector2d maxSize)
      Creates a new GUIPane
      Parameters:
      gui - The GUI
      minSize - The minimum size of the Pane
      maxSize - The maximum size of the Pane
  • Method Details

    • setSize

      public void setSize(Vector2d size)
      Sets the size and calls onSizeChange() if changed.
      Overrides:
      setSize in class GUISection
      Parameters:
      size - The new size
    • setHeight

      public void setHeight(int height)
      Sets the new height by using setSize(Vector2d)
      Parameters:
      height - The new height
    • setWidth

      public void setWidth(int width)
      Sets the new width by using setSize(Vector2d)
      Parameters:
      width - The new width
    • updateSizeRecursive

      public abstract void updateSizeRecursive(Sizeable parent)
      Is called to recursively update the size of all GUIPanes
      Parameters:
      parent - The parent Pane or GUI (Sizeable)
    • updateSize

      public abstract void updateSize(Sizeable parent)
      Recalculates the size of the Pane when implemented
      Parameters:
      parent - The parent Pane or GUI (Sizeable)
    • updateChildrenRecursive

      protected void updateChildrenRecursive(Sizeable parent)
      Updates the size of all children recursive
      Parameters:
      parent - The parent Pane or GUI (Sizeable)
    • onSizeChange

      public void onSizeChange()
      Can be overridden and is only called when the size of this GUIPane really changes.
    • getChildren

      public abstract Set<GUISection> getChildren()
      Implemented by GUIPanes Should return all children sections
      Returns:
      All child sections
    • renderOnList

      protected void renderOnList(GUISection section, Vector2d position, List<org.bukkit.inventory.ItemStack> content)
      Renders a child section at a specific position on a list
      Parameters:
      section - The child section
      position - The child position the child is at
      content - The list on which the section should be rendered. Has to have the size of this GUIPane, otherwise it can lead to exceptions.