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 TypeMethodDescriptionint
Gets the height of this object.int
getWidth()
Gets the width of this object.int
getX()
Gets the x-coordinate of this object.int
getY()
Gets the y-coordinate of this object.void
setHeight
(int height) Sets the height of this object.default void
setPosition
(int x, int y) Sets the position of this object.default void
setSize
(int width, int height) Sets the size of this object.default void
setSize
(int x, int y, int width, int height) Sets the position and size of this object.default void
setSize
(@NotNull ElementBounds bounds) Sets the position and size of this object to match aElementBounds
.void
setWidth
(int width) Sets the width of this object.void
setX
(int x) Sets the x-coordinate of this object.void
setY
(int y) Sets the y-coordinate of this object.void
visitWidgets
(@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
-