Class AbstractLayout.AbstractChildContainer
java.lang.Object
xyz.gmitch215.socketmc.screen.layout.AbstractLayout.AbstractChildContainer
- All Implemented Interfaces:
Serializable
- Direct Known Subclasses:
ChildContainer
,GridLayout.Cell
- Enclosing class:
AbstractLayout
protected abstract static class AbstractLayout.AbstractChildContainer
extends Object
implements Serializable
A utility class to contain various elements inside of a Layout and its settings.
- See Also:
-
Constructor Summary
ModifierConstructorDescriptionprotected
AbstractChildContainer
(@NotNull LayoutElement element, @NotNull LayoutSettings settings) Constructs a new AbstractChildContainer with the specified element and settings. -
Method Summary
Modifier and TypeMethodDescriptionGets the element this container is holding.final int
Gets the height of the element with vertical padding.Gets the settings of this container.final int
getWidth()
Gets the width of the element with horizontal padding.final void
setHorizontalBounds
(int x, int width) Sets the horizontal bounds of the element.final void
setVerticalBounds
(int y, int height) Sets the vertical bounds of the element.
-
Constructor Details
-
AbstractChildContainer
protected AbstractChildContainer(@NotNull @NotNull LayoutElement element, @NotNull @NotNull LayoutSettings settings) Constructs a new AbstractChildContainer with the specified element and settings.- Parameters:
element
- the elementsettings
- the settings
-
-
Method Details
-
getElement
Gets the element this container is holding.- Returns:
- the element
-
getSettings
Gets the settings of this container.- Returns:
- the settings
-
getHeight
public final int getHeight()Gets the height of the element with vertical padding.- Returns:
- the height
-
getWidth
public final int getWidth()Gets the width of the element with horizontal padding.- Returns:
- the width
-
setHorizontalBounds
public final void setHorizontalBounds(int x, int width) Sets the horizontal bounds of the element.- Parameters:
x
- the x-coordinatewidth
- the width
-
setVerticalBounds
public final void setVerticalBounds(int y, int height) Sets the vertical bounds of the element.- Parameters:
y
- the y-coordinateheight
- the height
-