java.lang.Object
io.github.somesourcecode.someguiapi.scene.Node
io.github.somesourcecode.someguiapi.scene.Parent
Direct Known Subclasses:
Region

public abstract class Parent extends Node
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 Details

    • Parent

      protected Parent()
      Constructs a new parent node.
  • Method Details

    • getChildren

      protected ObservableList<Node> 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

      public Background getBackground()
      Returns the background of this parent.
      Returns:
      the background
    • setBackground

      public void setBackground(Background background)
      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: Node
      Returns an ItemStack representing the pixel at the given coordinates. The coordinates are relative to this parent's bounds.
      Specified by:
      pixelAt in class Node
      Parameters:
      x - the x coordinate
      y - the y coordinate
      Returns:
      the ItemStack at the given coordinates, or null if there is no pixel at the given coordinates
    • nodeAt

      public Node nodeAt(int x, int y)
      Description copied from class: Node
      Returns the node at the given coordinates. The coordinates are relative to this parent's bounds.
      Specified by:
      nodeAt in class Node
      Parameters:
      x - the x coordinate
      y - the y coordinate
      Returns:
      the node at the given coordinates, or null if there is no node at the given coordinates