Direct Known Subclasses:
Pane

public class Region extends Parent
The Base class for parent nodes whose size can be freely set.

This class handles the size of the node and its children, as well as padding. To create layout panes, you probably want to extend Pane instead.

Since:
1.0.0
  • Constructor Details

    • Region

      public Region()
      Constructs a new region with a width and height of 0.
      Since:
      1.0.0
  • Method Details

    • getWidth

      public int getWidth()
      Description copied from class: Node
      Returns the width of the node.
      Specified by:
      getWidth in class Node
      Returns:
      the width of the node
    • setWidth

      public void setWidth(int width)
      Sets the width of this region.
      Parameters:
      width - the width of this region
      Since:
      1.0.0
    • getHeight

      public int getHeight()
      Description copied from class: Node
      Returns the height of the node.
      Specified by:
      getHeight in class Node
      Returns:
      the height of the node
    • setHeight

      public void setHeight(int height)
      Sets the height of this region.
      Parameters:
      height - the height of this region
      Since:
      1.0.0
    • resize

      public void resize(int width, int height)
      Resizes this region to the specified width and height.

      This is equivalent to calling setWidth(int) and setHeight(int).

      Parameters:
      width - the new width of this region
      height - the new height of this region
      Since:
      1.0.0
    • resizeRelocate

      public void resizeRelocate(int layoutX, int layoutY, int width, int height)
      Resizes and relocates this region to the specified layoutX, layoutY, width, and height.

      This is equivalent to calling Node.relocate(int, int) and resize(int, int).

      Parameters:
      layoutX - the new layoutX of this region
      layoutY - the new layoutY of this region
      width - the new width of this region
      height - the new height of this region
      Since:
      1.0.0
    • getPadding

      public Insets getPadding()
      Returns the padding of this region.
      Returns:
      the padding of this region
      Since:
      1.0.0
    • setPadding

      public void setPadding(Insets padding)
      Sets the padding of this region.
      Parameters:
      padding - the padding of this region
      Since:
      1.0.0