Package xyz.gmitch215.socketmc.screen.ui
Class AbstractTextWidget
java.lang.Object
xyz.gmitch215.socketmc.screen.ui.AbstractWidget
xyz.gmitch215.socketmc.screen.ui.AbstractTextWidget
- All Implemented Interfaces:
Serializable,LayoutElement,Positionable
- Direct Known Subclasses:
AbstractButton,CustomWidget,EditTextWidget,FocusedTextWidget,TextWidget
Represents a widget with 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
ConstructorsConstructorDescriptionAbstractTextWidget(int x, int y, int width, int height, @NotNull String messageJSON) Constructs a new text widget.AbstractTextWidget(int x, int y, int width, int height, @NotNull Text message) Constructs a new text widget.AbstractTextWidget(@NotNull ElementBounds bounds, @NotNull Text message) Constructs a new text widget. -
Method Summary
Modifier and TypeMethodDescriptionbooleanGets the message JSON for this widget.voidsetMessage(@NotNull Text message) Gets the message for this widget.voidsetMessageJSON(@NotNull String messageJSON) Sets the message JSON for this widget.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, visitWidgetsMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface xyz.gmitch215.socketmc.screen.layout.LayoutElement
setPosition, setSize, setSize, setSizeMethods inherited from interface xyz.gmitch215.socketmc.screen.Positionable
inSamePosition
-
Constructor Details
-
AbstractTextWidget
public AbstractTextWidget(@NotNull @NotNull ElementBounds bounds, @NotNull @NotNull Text message) throws IllegalArgumentException Constructs a new text widget.- Parameters:
bounds- the boundsmessage- the text message- Throws:
IllegalArgumentException- if message is null
-
AbstractTextWidget
public AbstractTextWidget(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
-
AbstractTextWidget
public AbstractTextWidget(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 in JSON format- Throws:
IllegalArgumentException- if coordinates or dimensions are negative, or message is null
-
-
Method Details
-
getMessageJSON
Gets the message JSON for this widget.- Returns:
- the message in JSON format
-
setMessageJSON
Sets the message JSON for this widget.- Parameters:
messageJSON- the message in JSON format
-
setMessage
Gets the message for this widget.- Parameters:
message- the message
-
equals
- Overrides:
equalsin classAbstractWidget
-