Class LayoutSettings

java.lang.Object
xyz.gmitch215.socketmc.screen.layout.LayoutSettings
All Implemented Interfaces:
Serializable, Cloneable

public final class LayoutSettings extends Object implements Cloneable, Serializable
Represents settings for a specific layout.
See Also:
  • Method Details

    • getPaddingLeft

      public int getPaddingLeft()
      Gets the padding on the left side of the layout.
      Returns:
      Padding
    • setPaddingLeft

      @NotNull public @NotNull LayoutSettings setPaddingLeft(int paddingLeft)
      Sets the padding on the left side of the layout.
      Parameters:
      paddingLeft - Left Padding
      Returns:
      this class, for chaining
    • getPaddingTop

      public int getPaddingTop()
      Gets the padding on the top side of the layout.
      Returns:
      Padding
    • setPaddingTop

      @NotNull public @NotNull LayoutSettings setPaddingTop(int paddingTop)
      Sets the padding on the top side of the layout.
      Parameters:
      paddingTop - Top Padding
      Returns:
      this class, for chaining
    • getPaddingRight

      public int getPaddingRight()
      Gets the padding on the right side of the layout.
      Returns:
      Right Padding
    • setPaddingRight

      @NotNull public @NotNull LayoutSettings setPaddingRight(int paddingRight)
      Sets the padding on the right side of the layout.
      Parameters:
      paddingRight - Right Padding
      Returns:
      this class, for chaining
    • getPaddingBottom

      public int getPaddingBottom()
      Gets the padding on the bottom side of the layout.
      Returns:
      Bottom Padding
    • setPaddingBottom

      @NotNull public @NotNull LayoutSettings setPaddingBottom(int paddingBottom)
      Sets the padding on the bottom side of the layout.
      Parameters:
      paddingBottom - Bottom Padding
    • setPaddingHorizontal

      @NotNull public @NotNull LayoutSettings setPaddingHorizontal(int horizontal)
      Sets the padding on the horizontal sides of the layout.
      Parameters:
      horizontal - Left and Right Padding
      Returns:
      this class, for chaining
    • setPaddingVertical

      public LayoutSettings setPaddingVertical(int vertical)
      Sets the padding on the vertical sides of the layout.
      Parameters:
      vertical - Top and Bottom Padding
      Returns:
      this class, for chaining
    • setPadding

      @NotNull public @NotNull LayoutSettings setPadding(int horizontal, int vertical)
      Sets the padding on all sides of the layout.
      Parameters:
      horizontal - Left and Right Padding
      vertical - Top and Bottom Padding
      Returns:
      this class, for chaining
    • setPadding

      @NotNull public @NotNull LayoutSettings setPadding(int left, int top, int right, int bottom)
      Sets the padding on all sides of the layout.
      Parameters:
      left - Left Padding
      top - Top Padding
      right - Right Padding
      bottom - Bottom Padding
      Returns:
      this class, for chaining
    • getAlignmentX

      public float getAlignmentX()
      Gets the alignment of the layout on the x-axis.
      Returns:
      X-Axis Alignment Percentage
    • setAlignmentX

      @NotNull public @NotNull LayoutSettings setAlignmentX(float alignmentX) throws IllegalArgumentException
      Sets the alignment of the layout on the x-axis.
      Parameters:
      alignmentX - X-Axis Alignment Percentage, between 0 and 1
      Returns:
      this class, for chaining
      Throws:
      IllegalArgumentException - if alignment is not between 0 and 1
    • alignHorizontallyLeft

      @NotNull public @NotNull LayoutSettings alignHorizontallyLeft()
      Sets the alignment of the layout on the x-axis to the left, 0%.
      Returns:
      this class, for chaining
    • alignHorizontallyCenter

      @NotNull public @NotNull LayoutSettings alignHorizontallyCenter()
      Sets the alignment of the layout on the x-axis to the center, 50%.
      Returns:
      this class, for chaining
    • alignHorizontallyRight

      @NotNull public @NotNull LayoutSettings alignHorizontallyRight()
      Sets the alignment of the layout on the x-axis to the right, 100%.
      Returns:
      this class, for chaining
    • getAlignmentY

      public float getAlignmentY()
      Gets the alignment of the layout on the y-axis.
      Returns:
      Y-Axis Alignment Percentage
    • setAlignmentY

      public LayoutSettings setAlignmentY(float alignmentY) throws IllegalArgumentException
      Sets the alignment of the layout on the y-axis.
      Parameters:
      alignmentY - Y-Axis Alignment Percentage, between 0 and 1
      Returns:
      this class, for chaining
      Throws:
      IllegalArgumentException - if alignment is not between 0 and 1
    • alignVerticallyTop

      @NotNull public @NotNull LayoutSettings alignVerticallyTop()
      Sets the alignment of the layout on the y-axis to the top, 0%.
      Returns:
      this class, for chaining
    • alignVerticallyCenter

      @NotNull public @NotNull LayoutSettings alignVerticallyCenter()
      Sets the alignment of the layout on the y-axis to the center, 50%.
      Returns:
      this class, for chaining
    • alignVerticallyBottom

      @NotNull public @NotNull LayoutSettings alignVerticallyBottom()
      Sets the alignment of the layout on the y-axis to the bottom, 100%.
      Returns:
      this class, for chaining
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • clone

      public LayoutSettings clone()
      Overrides:
      clone in class Object
    • create

      @NotNull public static @NotNull LayoutSettings create()
      Creates new LayoutSettings with empty padding and alignment.
      Returns:
      LayoutSettings
    • create

      @NotNull public static @NotNull LayoutSettings create(int paddingLeft, int paddingTop, int paddingRight, int paddingBottom, float alignmentX, float alignmentY)
      Creates new LayoutSettings with the specified padding and alignment.
      Parameters:
      paddingLeft - Left Padding
      paddingTop - Top Padding
      paddingRight - Right Padding
      paddingBottom - Bottom Padding
      alignmentX - X-Axis Alignment Percentage
      alignmentY - Y-Axis Alignment Percentage
      Returns:
      LayoutSettings
    • create

      @NotNull public static @NotNull LayoutSettings create(int paddingLeft, int paddingTop, int paddingRight, int paddingBottom)
      Creates new LayoutSettings with the specified padding.
      Parameters:
      paddingLeft - Left Padding
      paddingTop - Top Padding
      paddingRight - Right Padding
      paddingBottom - Bottom Padding
      Returns:
      LayoutSettings
    • create

      @NotNull public static @NotNull LayoutSettings create(int padding)
      Creates new LayoutSettings with the specified padding and alignment.
      Parameters:
      padding - Padding
      Returns:
      LayoutSettings
    • create

      @NotNull public static @NotNull LayoutSettings create(int padding, float alignmentX, float alignmentY)
      Creates new LayoutSettings with the specified padding and alignment.
      Parameters:
      padding - Padding
      alignmentX - X-Axis Alignment Percentage
      alignmentY - Y-Axis Alignment Percentage
      Returns:
      LayoutSettings
    • create

      @NotNull public static @NotNull LayoutSettings create(int padding, float alignment)
      Creates new LayoutSettings with the specified padding and alignment.
      Parameters:
      padding - Padding
      alignment - Alignment Percentage
      Returns:
      LayoutSettings
    • create

      @NotNull public static @NotNull LayoutSettings create(float alignmentX, float alignmentY)
      Creates new LayoutSettings with the specified alignment.
      Parameters:
      alignmentX - X-Axis Alignment Percentage
      alignmentY - Y-Axis Alignment Percentage
      Returns:
      LayoutSettings
    • createCentered

      @NotNull public static @NotNull LayoutSettings createCentered()
      Creates new LayoutSettings with both alignments set to the center.
      Returns:
      LayoutSettings
    • createHorizontallyCentered

      @NotNull public static @NotNull LayoutSettings createHorizontallyCentered()
      Creates new LayoutSettings with the horizontal alignment set to the center.
      Returns:
      LayoutSettings
    • createVerticallyCentered

      @NotNull public static @NotNull LayoutSettings createVerticallyCentered()
      Creates new LayoutSettings with the vertical alignment set to the center.
      Returns:
      LayoutSettings