Package xyz.gmitch215.socketmc.screen.ui
Class AbstractButton
java.lang.Object
xyz.gmitch215.socketmc.screen.ui.AbstractWidget
xyz.gmitch215.socketmc.screen.ui.AbstractTextWidget
xyz.gmitch215.socketmc.screen.ui.AbstractButton
- All Implemented Interfaces:
 Serializable,LayoutElement,Positionable
- Direct Known Subclasses:
 CheckboxButton,CustomButton,CycleButton,ImageButton,LockButton,SendInstructionButton,TextButton
Represents a Button on the screen.
- See Also:
 
- 
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intThe default width of a big button.static final intThe default height of a button.static final intThe default width and height spacing between buttons.static final intThe default width of a button.static final intThe default width of a small button.Fields inherited from class xyz.gmitch215.socketmc.screen.ui.AbstractWidget
DEFAULT_PADDING, height, tooltip, width, x, y - 
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedAbstractButton(int x, int y, int width, int height, @NotNull String messageJSON) Constructs a new button.protectedAbstractButton(int x, int y, int width, int height, @NotNull Text message) Constructs a new button.protectedAbstractButton(int x, int y, @NotNull Text message) Constructs a new button using the default dimesions.protectedAbstractButton(@NotNull ElementBounds bounds, @NotNull Text message) Constructs a new button using the specified bounds. - 
Method Summary
Methods inherited from class xyz.gmitch215.socketmc.screen.ui.AbstractTextWidget
equals, getMessageJSON, setMessage, setMessageJSONMethods 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 
- 
Field Details
- 
DEFAULT_WIDTH
public static final int DEFAULT_WIDTHThe default width of a button.- See Also:
 
 - 
SMALL_WIDTH
public static final int SMALL_WIDTHThe default width of a small button.- See Also:
 
 - 
BIG_WIDTH
public static final int BIG_WIDTHThe default width of a big button.- See Also:
 
 - 
DEFAULT_HEIGHT
public static final int DEFAULT_HEIGHTThe default height of a button.- See Also:
 
 - 
DEFAULT_SPACING
public static final int DEFAULT_SPACINGThe default width and height spacing between buttons.- See Also:
 
 
 - 
 - 
Constructor Details
- 
AbstractButton
protected AbstractButton(@NotNull @NotNull ElementBounds bounds, @NotNull @NotNull Text message) throws IllegalArgumentException Constructs a new button using the specified bounds.- Parameters:
 bounds- the boundsmessage- the text message- Throws:
 IllegalArgumentException- if bounds or message is null
 - 
AbstractButton
protected AbstractButton(int x, int y, @NotNull @NotNull Text message) throws IllegalArgumentException Constructs a new button using the default dimesions.- Parameters:
 x- the x-coordinatey- the y-coordinatemessage- the text message- Throws:
 IllegalArgumentException- if coordinates are negative, or message is null
 - 
AbstractButton
protected AbstractButton(int x, int y, int width, int height, @NotNull @NotNull Text message) throws IllegalArgumentException Constructs a new button.- 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
 - 
AbstractButton
protected AbstractButton(int x, int y, int width, int height, @NotNull @NotNull String messageJSON) throws IllegalArgumentException Constructs a new button.- 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
 
 -