Interface LayoutElement
- All Known Subinterfaces:
Layout,Positionable
- All Known Implementing Classes:
AbstractButton,AbstractLayout,AbstractTextWidget,AbstractWidget,CheckboxButton,CustomButton,CustomWidget,CycleButton,EditTextWidget,EqualSpacingLayout,FocusedTextWidget,FrameLayout,GridLayout,ImageButton,ImageWidget,LinearLayout,LockButton,PageLayout,SendInstructionButton,TextButton,TextWidget
public interface LayoutElement
Represents an element that can be added to a layout.
-
Method Summary
Modifier and TypeMethodDescriptionintGets the height of this object.intgetWidth()Gets the width of this object.intgetX()Gets the x-coordinate of this object.intgetY()Gets the y-coordinate of this object.voidsetHeight(int height) Sets the height of this object.default voidsetPosition(int x, int y) Sets the position of this object.default voidsetSize(int width, int height) Sets the size of this object.default voidsetSize(int x, int y, int width, int height) Sets the position and size of this object.default voidsetSize(@NotNull ElementBounds bounds) Sets the position and size of this object to match aElementBounds.voidsetWidth(int width) Sets the width of this object.voidsetX(int x) Sets the x-coordinate of this object.voidsetY(int y) Sets the y-coordinate of this object.voidvisitWidgets(@Nullable Consumer<AbstractWidget> visitor) Visits this object, applying a function to it.
-
Method Details
-
getX
int getX()Gets the x-coordinate of this object.- Returns:
- the x-coordinate
-
setX
void setX(int x) Sets the x-coordinate of this object.- Parameters:
x- the x-coordinate
-
getY
int getY()Gets the y-coordinate of this object.- Returns:
- the y-coordinate
-
setY
void setY(int y) Sets the y-coordinate of this object.- Parameters:
y- the y-coordinate
-
setPosition
default void setPosition(int x, int y) Sets the position of this object.- Parameters:
x- the x-coordinatey- the y-coordinate
-
getWidth
int getWidth()Gets the width of this object.- Returns:
- the width
-
setWidth
void setWidth(int width) Sets the width of this object.- Parameters:
width- the width
-
getHeight
int getHeight()Gets the height of this object.- Returns:
- the height
-
setHeight
void setHeight(int height) Sets the height of this object.- Parameters:
height- the height
-
setSize
default void setSize(int width, int height) Sets the size of this object.- Parameters:
width- the widthheight- the height
-
setSize
Sets the position and size of this object to match aElementBounds.- Parameters:
bounds- the bounds to use
-
setSize
default void setSize(int x, int y, int width, int height) Sets the position and size of this object.- Parameters:
x- the x-coordinatey- the y-coordinatewidth- the widthheight- the height
-
visitWidgets
Visits this object, applying a function to it.- Parameters:
visitor- the visitor
-