Class GUIPane
java.lang.Object
de.placeblock.betterinventories.content.GUISection
de.placeblock.betterinventories.content.pane.GUIPane
- All Implemented Interfaces:
Sizeable
- Direct Known Subclasses:
BaseHorizontalSplitGUIPane,BaseSimpleGUIPane
A
How the own size is updated can be implemented by the different
GUISection that can contain other GUISections.
Renders to a List.
How the own size is updated can be implemented by the different
GUIPanes.-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classGUIPane.AbstractBuilder<B extends GUIPane.AbstractBuilder<B,P>, P extends GUIPane> Builder for creating variousGUIPane -
Field Summary
Fields inherited from class de.placeblock.betterinventories.content.GUISection
maxSize, minSize -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionabstract List<GUISection>Implemented by GUIPanes Should return all children sectionsbooleanCalled when an item is added to an empty slotbooleanonItemAmount(Vector2d position, int amount) Called when the amount of an item in a slot changesvoidonItemClick(ClickData data) Called when a user clicks on an item.abstract voidonItemProvide(org.bukkit.inventory.ItemStack itemStack) Called when an item is provided by an inventory MOVE_TO_OTHER_INVENTORY eventorg.bukkit.inventory.ItemStackonItemRemove(Vector2d position) Called when an item is removed from an empty slotvoidCan be overridden and is only called when the size of this GUIPane really changes.voidprovideItem(org.bukkit.inventory.ItemStack itemStack) Used to provide items recursivelyprotected voidrenderOnList(GUISection section, Vector2d position, List<org.bukkit.inventory.ItemStack> content) Renders a child section at a specific position on a listvoidsetHeight(int height) Sets the new height by usingsetSize(Vector2d)voidSets the size and callsonSizeChange()if changed.voidsetWidth(int width) Sets the new width by usingsetSize(Vector2d)protected voidupdateChildrenRecursive(Sizeable parent) Updates the size of all children recursiveabstract voidupdateSize(Sizeable parent) Recalculates the size of the Pane when implementedabstract voidupdateSizeRecursive(Sizeable parent) Is called to recursively update the size of allGUIPanesMethods inherited from class de.placeblock.betterinventories.content.GUISection
getEmptyContentList, getHeight, getSlots, getWidth, render, search, slotToVector, vectorToSlotMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface de.placeblock.betterinventories.Sizeable
clampSize, getMaxSize, getMinSize, getSize
-
Constructor Details
-
GUIPane
Creates a new GUIPane- Parameters:
gui- The GUIminSize- The minimum size of the PanemaxSize- The maximum size of the Pane
-
-
Method Details
-
setSize
Sets the size and callsonSizeChange()if changed.- Overrides:
setSizein classGUISection- Parameters:
size- The new size
-
setHeight
public void setHeight(int height) Sets the new height by usingsetSize(Vector2d)- Parameters:
height- The new height
-
setWidth
public void setWidth(int width) Sets the new width by usingsetSize(Vector2d)- Parameters:
width- The new width
-
updateSizeRecursive
Is called to recursively update the size of allGUIPanes- Parameters:
parent- The parent Pane or GUI (Sizeable)
-
updateSize
Recalculates the size of the Pane when implemented- Parameters:
parent- The parent Pane or GUI (Sizeable)
-
updateChildrenRecursive
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
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 sectionposition- The child position the child is atcontent- The list on which the section should be rendered. Has to have the size of this GUIPane, otherwise it can lead to exceptions.
-
onItemClick
Description copied from class:GUISectionCalled when a user clicks on an item. Usually after this method one of the add/remove/amount methods is called.- Specified by:
onItemClickin classGUISection- Parameters:
data- The clickdata
-
onItemAdd
Description copied from class:GUISectionCalled when an item is added to an empty slot- Specified by:
onItemAddin classGUISection- Parameters:
position- The relative position of the slotitemStack- The itemstack that was added- Returns:
- Whether this action should be cancelled.
-
onItemRemove
Description copied from class:GUISectionCalled when an item is removed from an empty slot- Specified by:
onItemRemovein classGUISection- Parameters:
position- The relative position of the slot- Returns:
- The removed Item, if any
-
onItemAmount
Description copied from class:GUISectionCalled when the amount of an item in a slot changes- Specified by:
onItemAmountin classGUISection- Parameters:
position- The relative position of the slotamount- The new amount of the item- Returns:
- Whether this action should be cancelled.
-
onItemProvide
public abstract void onItemProvide(org.bukkit.inventory.ItemStack itemStack) Called when an item is provided by an inventory MOVE_TO_OTHER_INVENTORY event- Parameters:
itemStack- The provided item. Method reduces the amount of the item by the number that got accepted.
-
provideItem
public void provideItem(org.bukkit.inventory.ItemStack itemStack) Used to provide items recursively- Parameters:
itemStack- The provided item. Method reduces the amount of the item by the number that got accepted.
-