Package xyz.gmitch215.socketmc.screen.ui
Class CheckboxButton
java.lang.Object
xyz.gmitch215.socketmc.screen.ui.AbstractWidget
xyz.gmitch215.socketmc.screen.ui.AbstractTextWidget
xyz.gmitch215.socketmc.screen.ui.AbstractButton
xyz.gmitch215.socketmc.screen.ui.CheckboxButton
- All Implemented Interfaces:
Serializable
,LayoutElement
,Positionable
Represents a Checkbox Button.
AbstractWidget.getWidth()
and AbstractWidget.getHeight()
are determined by the client, so their values are set to -1
and are ignored.
- See Also:
-
Field Summary
Modifier and TypeFieldDescriptionstatic final int
Represents the default padding of the checkbox.static final int
Represents the default spacing between checkbox and text.Fields inherited from class xyz.gmitch215.socketmc.screen.ui.AbstractButton
BIG_WIDTH, DEFAULT_HEIGHT, DEFAULT_SPACING, DEFAULT_WIDTH, SMALL_WIDTH
Fields inherited from class xyz.gmitch215.socketmc.screen.ui.AbstractWidget
DEFAULT_PADDING, height, tooltip, width, x, y
-
Constructor Summary
ConstructorDescriptionCheckboxButton
(int x, int y, @NotNull String messageJSON) Constructs a new checkbox.CheckboxButton
(int x, int y, @NotNull Text message) Constructs a new checkbox.CheckboxButton
(@NotNull ElementBounds bounds, @NotNull Text message) Constructs a new checkbox. -
Method Summary
Methods inherited from class xyz.gmitch215.socketmc.screen.ui.AbstractTextWidget
equals, getMessageJSON, setMessage, setMessageJSON
Methods inherited from class xyz.gmitch215.socketmc.screen.ui.AbstractWidget
clearListeners, getHeight, getListeners, getTooltip, getWidth, getX, getY, hashCode, onClick, setHeight, setTooltip, setWidth, setX, setY, toString, visitWidgets
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface xyz.gmitch215.socketmc.screen.layout.LayoutElement
setPosition, setSize, setSize, setSize
Methods inherited from interface xyz.gmitch215.socketmc.screen.Positionable
inSamePosition
-
Field Details
-
SPACING
public static final int SPACINGRepresents the default spacing between checkbox and text.- See Also:
-
BOX_PADDING
public static final int BOX_PADDINGRepresents the default padding of the checkbox.- See Also:
-
-
Constructor Details
-
CheckboxButton
public CheckboxButton(@NotNull @NotNull ElementBounds bounds, @NotNull @NotNull Text message) throws IllegalArgumentException Constructs a new checkbox.- Parameters:
bounds
- the boundsmessage
- the text message- Throws:
IllegalArgumentException
- if coordinates are negative, or message is null
-
CheckboxButton
Constructs a new checkbox.- Parameters:
x
- the x-coordinatey
- the y-coordinatemessage
- the text message- Throws:
IllegalArgumentException
- if coordinates are negative, or message is null
-
CheckboxButton
public CheckboxButton(int x, int y, @NotNull @NotNull String messageJSON) throws IllegalArgumentException Constructs a new checkbox.- Parameters:
x
- the x-coordinatey
- the y-coordinatemessageJSON
- the text message in JSON format- Throws:
IllegalArgumentException
- if coordinates are negative, or message is null
-