Class AbstractWidget

java.lang.Object
xyz.gmitch215.socketmc.screen.ui.AbstractWidget
All Implemented Interfaces:
Serializable, LayoutElement, Positionable
Direct Known Subclasses:
AbstractTextWidget, ImageWidget

public abstract class AbstractWidget extends Object implements Positionable
Represents a Widget on the screen. This class is not legal for implementation!
See Also:
  • Field Details

    • DEFAULT_PADDING

      public static final int DEFAULT_PADDING
      The default padding around text elements.
      See Also:
    • x

      protected int x
      The x-coordinate of this widget.
    • y

      protected int y
      The y-coordinate of this widget.
    • width

      protected int width
      The width of this widget.
    • height

      protected int height
      The height of this widget.
    • tooltip

      @Nullable protected @Nullable Tooltip tooltip
      The tooltip for this widget.
  • Constructor Details

    • AbstractWidget

      protected AbstractWidget(@NotNull @NotNull ElementBounds bounds)
      Constructs a new widget.
      Parameters:
      bounds - the bounds
    • AbstractWidget

      protected AbstractWidget(int x, int y, int width, int height) throws IllegalArgumentException
      Constructs a new widget.
      Parameters:
      x - the x-coordinate
      y - the y-coordinate
      width - the width
      height - the height
      Throws:
      IllegalArgumentException - if coordinates or dimensions are negative
  • Method Details