Class Region
java.lang.Object
io.github.somesourcecode.someguiapi.scene.Node
io.github.somesourcecode.someguiapi.scene.Parent
io.github.somesourcecode.someguiapi.scene.layout.Region
- Direct Known Subclasses:
Pane
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 Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionintReturns the height of the node.Returns the padding of this region.intgetWidth()Returns the width of the node.voidresize(int width, int height) Resizes this region to the specified width and height.voidresizeRelocate(int layoutX, int layoutY, int width, int height) Resizes and relocates this region to the specified layoutX, layoutY, width, and height.voidsetHeight(int height) Sets the height of this region.voidsetPadding(Insets padding) Sets the padding of this region.voidsetWidth(int width) Sets the width of this region.Methods inherited from class io.github.somesourcecode.someguiapi.scene.Parent
getBackground, getChildren, isSceneRoot, layout, layoutChildren, lookup, lookupAll, needsLayout, nodeAt, renderPixelAt, requestLayout, setBackgroundMethods inherited from class io.github.somesourcecode.someguiapi.scene.Node
getId, getLayoutX, getLayoutY, getOnClick, getOnHotBarClick, getOnLeftClick, getOnRightClick, getOnShiftClick, getParent, getScene, getTranslateX, getTranslateY, isClipping, isVisible, lookupAll, relocate, requestParentLayout, setClipping, setId, setLayoutX, setLayoutY, setOnClick, setOnHotBarClick, setOnLeftClick, setOnRightClick, setOnShiftClick, setTranslateX, setTranslateY, setVisible
-
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:NodeReturns 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:NodeReturns 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)andsetHeight(int).- Parameters:
width- the new width of this regionheight- 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)andresize(int, int).- Parameters:
layoutX- the new layoutX of this regionlayoutY- the new layoutY of this regionwidth- the new width of this regionheight- the new height of this region- Since:
- 1.0.0
-
getPadding
Returns the padding of this region.- Returns:
- the padding of this region
- Since:
- 1.0.0
-
setPadding
Sets the padding of this region.- Parameters:
padding- the padding of this region- Since:
- 1.0.0
-