Class Parent
java.lang.Object
io.github.somesourcecode.someguiapi.scene.Node
io.github.somesourcecode.someguiapi.scene.Parent
- Direct Known Subclasses:
Region
The base class for all nodes that can have children.
This class handles all hierarchy-related operations, such as adding and removing child nodes, layout and rendering.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionReturns the background of this parent.protected ObservableList<Node>Returns the list of children of this parent.final voidlayout()Recursively applies the layout to all children and itself.protected voidnodeAt(int x, int y) Returns the node at the given coordinates.org.bukkit.inventory.ItemStackpixelAt(int x, int y) Returns anItemStackrepresenting the pixel at the given coordinates.voidsetBackground(Background background) Sets the background of this parent.Methods inherited from class io.github.somesourcecode.someguiapi.scene.Node
getHeight, getLayoutX, getLayoutY, getOnClick, getOnHotBarClick, getOnLeftClick, getOnRightClick, getOnShiftClick, getParent, getTranslateX, getTranslateY, getWidth, isClipping, isVisible, relocate, setClipping, setLayoutX, setLayoutY, setOnClick, setOnHotBarClick, setOnLeftClick, setOnRightClick, setOnShiftClick, setParent, setTranslateX, setTranslateY, setVisible
-
Constructor Details
-
Parent
protected Parent()Constructs a new parent node.
-
-
Method Details
-
getChildren
Returns the list of children of this parent.- Returns:
- the list of children
-
layout
public final void layout()Recursively applies the layout to all children and itself. -
layoutChildren
protected void layoutChildren() -
getBackground
Returns the background of this parent.- Returns:
- the background
-
setBackground
Sets the background of this parent. It will be rendered behind all children.- Parameters:
background- the new background
-
pixelAt
public org.bukkit.inventory.ItemStack pixelAt(int x, int y) Description copied from class:NodeReturns anItemStackrepresenting the pixel at the given coordinates. The coordinates are relative to this parent's bounds. -
nodeAt
Description copied from class:NodeReturns the node at the given coordinates. The coordinates are relative to this parent's bounds.
-