Class OutlinePane
java.lang.Object
com.github.stefvanschie.inventoryframework.pane.Pane
com.github.stefvanschie.inventoryframework.pane.OutlinePane
- All Implemented Interfaces:
Flippable
,Orientable
,Rotatable
- Direct Known Subclasses:
Label
A pane for items that should be outlined
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic enum
An enum containing different alignments that can be used on the outline pane.Nested classes/interfaces inherited from class com.github.stefvanschie.inventoryframework.pane.Pane
Pane.Priority
Nested classes/interfaces inherited from interface com.github.stefvanschie.inventoryframework.pane.Orientable
Orientable.Orientation
-
Field Summary
-
Constructor Summary
ConstructorDescriptionOutlinePane
(int length, int height) OutlinePane
(int x, int y, int length, int height) OutlinePane
(int x, int y, int length, int height, @NotNull Pane.Priority priority) OutlinePane
(@NotNull Slot slot, int length, int height) Creates a new outline paneOutlinePane
(@NotNull Slot slot, int length, int height, @NotNull Pane.Priority priority) Creates a new outline pane -
Method Summary
Modifier and TypeMethodDescriptionvoid
Adds a gui item at the specific spot in the panevoid
align
(@NotNull OutlinePane.Alignment alignment) Aligns the pane in the way specified by the provided alignment.void
Applies a custom mask to this pane.void
clear()
Clears the entire pane of any items/panes.boolean
click
(@NotNull Gui gui, @NotNull InventoryComponent inventoryComponent, @NotNull InventoryClickEvent event, int slot, int paneOffsetX, int paneOffsetY, int maxLength, int maxHeight) Called whenever there is being clicked on this pane@NotNull OutlinePane
copy()
Makes a copy of this pane and returns it.void
display
(@NotNull InventoryComponent inventoryComponent, int paneOffsetX, int paneOffsetY, int maxLength, int maxHeight) Has to set all the items in the right spot inside the inventoryboolean
Gets whether this outline pane repeats itselfvoid
flipHorizontally
(boolean flipHorizontally) Sets whether this pane should flip its items horizontallyvoid
flipVertically
(boolean flipVertically) Sets whether this pane should flip its items vertically@NotNull OutlinePane.Alignment
Gets the alignment set on this pane.int
getGap()
Gets the gap of the panegetItems()
Gets all the items in this pane and all underlying panes.@NotNull Mask
getMask()
Gets the mask applied to this pane.@NotNull Orientable.Orientation
Gets the orientation of this outline pane@NotNull Collection
<Pane> getPanes()
Gets all the panes in this panes, including any child panes from other panes.int
Gets the rotation specified to this pane.void
insertItem
(@NotNull GuiItem item, int index) Adds a gui item in the specified indexboolean
Gets whether this pane's items are flipped horizontallyboolean
Gets whether this pane's items are flipped verticallystatic @NotNull OutlinePane
Deprecated.static @NotNull OutlinePane
Loads an outline pane from a given elementvoid
removeItem
(@NotNull GuiItem item) Removes the specified item from the panevoid
setGap
(int gap) Sets the gap of the panevoid
setHeight
(int height) Set the height of this panevoid
setLength
(int length) Set the length of this panevoid
setOrientation
(@NotNull Orientable.Orientation orientation) Sets the orientation of this outline panevoid
setRepeat
(boolean repeat) Sets whether this pane should repeat itselfvoid
setRotation
(int rotation) Sets the rotation of this pane.Methods inherited from class com.github.stefvanschie.inventoryframework.pane.Pane
callOnClick, createBorder, createBorder, findMatchingItem, getHeight, getLength, getPriority, getSlot, getUUID, getX, getY, isVisible, load, loadItem, loadItem, matchesItem, registerProperty, setOnClick, setPriority, setSlot, setVisible, setX, setY
-
Constructor Details
-
OutlinePane
public OutlinePane(@NotNull @NotNull Slot slot, int length, int height, @NotNull @NotNull Pane.Priority priority) Creates a new outline pane- Parameters:
slot
- the slot of the panelength
- the length of the paneheight
- the height of the panepriority
- the priority of the pane- Since:
- 0.10.8
-
OutlinePane
-
OutlinePane
Creates a new outline pane- Parameters:
slot
- the slot of the panelength
- the length of the paneheight
- the height of the pane- Since:
- 0.10.8
-
OutlinePane
public OutlinePane(int x, int y, int length, int height) -
OutlinePane
public OutlinePane(int length, int height)
-
-
Method Details
-
display
public void display(@NotNull @NotNull InventoryComponent inventoryComponent, int paneOffsetX, int paneOffsetY, int maxLength, int maxHeight) Description copied from class:Pane
Has to set all the items in the right spot inside the inventory- Specified by:
display
in classPane
- Parameters:
inventoryComponent
- the inventory component in which the items should be displayedpaneOffsetX
- the pane's offset on the x axispaneOffsetY
- the pane's offset on the y axismaxLength
- the maximum length of the panemaxHeight
- the maximum height of the pane
-
click
public boolean click(@NotNull @NotNull Gui gui, @NotNull @NotNull InventoryComponent inventoryComponent, @NotNull @NotNull InventoryClickEvent event, int slot, int paneOffsetX, int paneOffsetY, int maxLength, int maxHeight) Description copied from class:Pane
Called whenever there is being clicked on this pane- Specified by:
click
in classPane
- Parameters:
gui
- the gui in which was clickedinventoryComponent
- the inventory component in which this pane residesevent
- the event that occurred while clicking on this itemslot
- the slot that was clicked inpaneOffsetX
- the pane's offset on the x axispaneOffsetY
- the pane's offset on the y axismaxLength
- the maximum length of the panemaxHeight
- the maximum height of the pane- Returns:
- whether the item was found or not
-
copy
Description copied from class:Pane
Makes a copy of this pane and returns it. This makes a deep copy of the pane. This entails that the underlying panes and/or items will be copied as well. The returned pane will never be reference equal to the current pane. -
setRotation
public void setRotation(int rotation) Description copied from interface:Rotatable
Sets the rotation of this pane. The rotation is in degrees and can only be in increments of 90. Anything higher than 360, will be lowered to a value in between [0, 360) while maintaining the same rotational value. E.g. 450 degrees becomes 90 degrees, 1080 degrees becomes 0, etc. This method fails for any pane that has a length and height which are unequal.- Specified by:
setRotation
in interfaceRotatable
- Parameters:
rotation
- the rotation of this pane, must be divisible by 90.
-
insertItem
Adds a gui item in the specified index- Parameters:
item
- the item to addindex
- the item's index
-
addItem
Adds a gui item at the specific spot in the pane- Parameters:
item
- the item to set
-
removeItem
Removes the specified item from the pane- Parameters:
item
- the item to remove- Since:
- 0.5.8
-
clear
public void clear()Description copied from class:Pane
Clears the entire pane of any items/panes. Underlying panes will not be cleared. -
applyMask
Applies a custom mask to this pane. This will throw anIllegalArgumentException
when the mask's dimension differs from this pane's dimension.- Parameters:
mask
- the mask to apply to this pane- Throws:
IllegalArgumentException
- when the mask's dimension is incorrect- Since:
- 0.5.16
-
setLength
public void setLength(int length) Description copied from class:Pane
Set the length of this pane -
setHeight
public void setHeight(int height) Description copied from class:Pane
Set the height of this pane -
align
Aligns the pane in the way specified by the provided alignment.- Parameters:
alignment
- the new alignment- Since:
- 0.10.1
-
flipHorizontally
public void flipHorizontally(boolean flipHorizontally) Description copied from interface:Flippable
Sets whether this pane should flip its items horizontally- Specified by:
flipHorizontally
in interfaceFlippable
- Parameters:
flipHorizontally
- whether the pane should flip items horizontally
-
flipVertically
public void flipVertically(boolean flipVertically) Description copied from interface:Flippable
Sets whether this pane should flip its items vertically- Specified by:
flipVertically
in interfaceFlippable
- Parameters:
flipVertically
- whether the pane should flip items vertically
-
setGap
public void setGap(int gap) Sets the gap of the pane- Parameters:
gap
- the new gap
-
setOrientation
Description copied from interface:Orientable
Sets the orientation of this outline pane- Specified by:
setOrientation
in interfaceOrientable
- Parameters:
orientation
- the new orientation
-
setRepeat
public void setRepeat(boolean repeat) Sets whether this pane should repeat itself- Parameters:
repeat
- whether the pane should repeat
-
getPanes
Description copied from class:Pane
Gets all the panes in this panes, including any child panes from other panes. The returned collection is not guaranteed to be mutable or to be a view of the underlying data. (So changes to the gui are not guaranteed to be visible in the returned value.) -
getAlignment
Gets the alignment set on this pane.- Returns:
- the alignment
- Since:
- 0.10.1
-
doesRepeat
@Contract(pure=true) public boolean doesRepeat()Gets whether this outline pane repeats itself- Returns:
- true if this pane repeats, false otherwise
-
getGap
@Contract(pure=true) public int getGap()Gets the gap of the pane- Returns:
- the gap
-
getItems
Description copied from class:Pane
Gets all the items in this pane and all underlying panes. The returned collection is not guaranteed to be mutable or to be a view of the underlying data. (So changes to the gui are not guaranteed to be visible in the returned value.) -
getMask
Gets the mask applied to this pane.- Returns:
- the mask
- Since:
- 0.6.2
-
getOrientation
Gets the orientation of this outline pane- Specified by:
getOrientation
in interfaceOrientable
- Returns:
- the orientation
-
getRotation
@Contract(pure=true) public int getRotation()Description copied from interface:Rotatable
Gets the rotation specified to this pane. If no rotation has been set, or if this pane is not capable of having a rotation, 0 is returned.- Specified by:
getRotation
in interfaceRotatable
- Returns:
- the rotation for this pane
-
isFlippedHorizontally
@Contract(pure=true) public boolean isFlippedHorizontally()Description copied from interface:Flippable
Gets whether this pane's items are flipped horizontally- Specified by:
isFlippedHorizontally
in interfaceFlippable
- Returns:
- true if the items are flipped horizontally, false otherwise
-
isFlippedVertically
@Contract(pure=true) public boolean isFlippedVertically()Description copied from interface:Flippable
Gets whether this pane's items are flipped vertically- Specified by:
isFlippedVertically
in interfaceFlippable
- Returns:
- true if the items are flipped vertically, false otherwise
-
load
@NotNull public static @NotNull OutlinePane load(@NotNull @NotNull Object instance, @NotNull @NotNull Element element, @NotNull @NotNull Plugin plugin) Loads an outline pane from a given element- Parameters:
instance
- the instance classelement
- the elementplugin
- the plugin that will be the owner of the created items- Returns:
- the outline pane
- Since:
- 0.10.8
-
load
@NotNull @Deprecated public static @NotNull OutlinePane load(@NotNull @NotNull Object instance, @NotNull @NotNull Element element) Deprecated.this method is no longer used internally and has been superseded byload(Object, Element, Plugin)
Loads an outline pane from a given element- Parameters:
instance
- the instance classelement
- the element- Returns:
- the outline pane
-
load(Object, Element, Plugin)