Package xyz.gmitch215.socketmc.screen.ui
Class TextWidget
java.lang.Object
xyz.gmitch215.socketmc.screen.ui.AbstractWidget
xyz.gmitch215.socketmc.screen.ui.AbstractTextWidget
xyz.gmitch215.socketmc.screen.ui.TextWidget
- All Implemented Interfaces:
Serializable
,LayoutElement
,Positionable
Represents a text widget that displays a text message.
- See Also:
-
Field Summary
Fields inherited from class xyz.gmitch215.socketmc.screen.ui.AbstractWidget
DEFAULT_PADDING, height, tooltip, width, x, y
-
Constructor Summary
ConstructorDescriptionTextWidget
(int x, int y, int width, int height, @NotNull String messageJSON) Constructs a new text widget.TextWidget
(int x, int y, int width, int height, @NotNull Text message) Constructs a new text widget.TextWidget
(int x, int y, @NotNull Text message) Constructs a new text widget using automatically-determined dimensions.TextWidget
(@NotNull ElementBounds bounds, @NotNull Text message) Constructs a new text widget with the default padding. -
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
-
Constructor Details
-
TextWidget
public TextWidget(@NotNull @NotNull ElementBounds bounds, @NotNull @NotNull Text message) throws IllegalArgumentException Constructs a new text widget with the default padding.- Parameters:
bounds
- the boundsmessage
- the text message- Throws:
IllegalArgumentException
- if message is null
-
TextWidget
Constructs a new text widget using automatically-determined dimensions.- Parameters:
x
- the x-coordinatey
- the y-coordinatemessage
- the text message- Throws:
IllegalArgumentException
- if coordinates or dimensions are negative, or message is null
-
TextWidget
public TextWidget(int x, int y, int width, int height, @NotNull @NotNull Text message) throws IllegalArgumentException Constructs a new text widget.- Parameters:
x
- the x-coordinatey
- the y-coordinatewidth
- the widthheight
- the heightmessage
- the text message- Throws:
IllegalArgumentException
- if coordinates or dimensions are negative, or message is null
-
TextWidget
public TextWidget(int x, int y, int width, int height, @NotNull @NotNull String messageJSON) throws IllegalArgumentException Constructs a new text widget.- Parameters:
x
- the x-coordinatey
- the y-coordinatewidth
- the widthheight
- the heightmessageJSON
- the text message as a JSON string- Throws:
IllegalArgumentException
- if coordinates or dimensions are negative, or message is null
-