Class LayoutSettings
java.lang.Object
xyz.gmitch215.socketmc.screen.layout.LayoutSettings
- All Implemented Interfaces:
Serializable
,Cloneable
Represents settings for a specific layout.
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionSets the alignment of the layout on the x-axis to the center, 50%.Sets the alignment of the layout on the x-axis to the left, 0%.Sets the alignment of the layout on the x-axis to the right, 100%.Sets the alignment of the layout on the y-axis to the bottom, 100%.Sets the alignment of the layout on the y-axis to the center, 50%.Sets the alignment of the layout on the y-axis to the top, 0%.clone()
static @NotNull LayoutSettings
create()
Creates new LayoutSettings with empty padding and alignment.static @NotNull LayoutSettings
create
(float alignmentX, float alignmentY) Creates new LayoutSettings with the specified alignment.static @NotNull LayoutSettings
create
(int padding) Creates new LayoutSettings with the specified padding and alignment.static @NotNull LayoutSettings
create
(int padding, float alignment) Creates new LayoutSettings with the specified padding and alignment.static @NotNull LayoutSettings
create
(int padding, float alignmentX, float alignmentY) Creates new LayoutSettings with the specified padding and alignment.static @NotNull LayoutSettings
create
(int paddingLeft, int paddingTop, int paddingRight, int paddingBottom) Creates new LayoutSettings with the specified padding.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.static @NotNull LayoutSettings
Creates new LayoutSettings with both alignments set to the center.static @NotNull LayoutSettings
Creates new LayoutSettings with the horizontal alignment set to the center.static @NotNull LayoutSettings
Creates new LayoutSettings with the vertical alignment set to the center.boolean
float
Gets the alignment of the layout on the x-axis.float
Gets the alignment of the layout on the y-axis.int
Gets the padding on the bottom side of the layout.int
Gets the padding on the left side of the layout.int
Gets the padding on the right side of the layout.int
Gets the padding on the top side of the layout.int
hashCode()
setAlignmentX
(float alignmentX) Sets the alignment of the layout on the x-axis.setAlignmentY
(float alignmentY) Sets the alignment of the layout on the y-axis.setPadding
(int horizontal, int vertical) Sets the padding on all sides of the layout.setPadding
(int left, int top, int right, int bottom) Sets the padding on all sides of the layout.setPaddingBottom
(int paddingBottom) Sets the padding on the bottom side of the layout.setPaddingHorizontal
(int horizontal) Sets the padding on the horizontal sides of the layout.setPaddingLeft
(int paddingLeft) Sets the padding on the left side of the layout.setPaddingRight
(int paddingRight) Sets the padding on the right side of the layout.setPaddingTop
(int paddingTop) Sets the padding on the top side of the layout.setPaddingVertical
(int vertical) Sets the padding on the vertical sides of the layout.toString()
-
Method Details
-
getPaddingLeft
public int getPaddingLeft()Gets the padding on the left side of the layout.- Returns:
- Padding
-
setPaddingLeft
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
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
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
Sets the padding on the bottom side of the layout.- Parameters:
paddingBottom
- Bottom Padding
-
setPaddingHorizontal
Sets the padding on the horizontal sides of the layout.- Parameters:
horizontal
- Left and Right Padding- Returns:
- this class, for chaining
-
setPaddingVertical
Sets the padding on the vertical sides of the layout.- Parameters:
vertical
- Top and Bottom Padding- Returns:
- this class, for chaining
-
setPadding
Sets the padding on all sides of the layout.- Parameters:
horizontal
- Left and Right Paddingvertical
- Top and Bottom Padding- Returns:
- this class, for chaining
-
setPadding
Sets the padding on all sides of the layout.- Parameters:
left
- Left Paddingtop
- Top Paddingright
- Right Paddingbottom
- 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
Sets the alignment of the layout on the x-axis to the left, 0%.- Returns:
- this class, for chaining
-
alignHorizontallyCenter
Sets the alignment of the layout on the x-axis to the center, 50%.- Returns:
- this class, for chaining
-
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
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
Sets the alignment of the layout on the y-axis to the top, 0%.- Returns:
- this class, for chaining
-
alignVerticallyCenter
Sets the alignment of the layout on the y-axis to the center, 50%.- Returns:
- this class, for chaining
-
alignVerticallyBottom
Sets the alignment of the layout on the y-axis to the bottom, 100%.- Returns:
- this class, for chaining
-
equals
-
hashCode
public int hashCode() -
toString
-
clone
-
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 PaddingpaddingTop
- Top PaddingpaddingRight
- Right PaddingpaddingBottom
- Bottom PaddingalignmentX
- X-Axis Alignment PercentagealignmentY
- 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 PaddingpaddingTop
- Top PaddingpaddingRight
- Right PaddingpaddingBottom
- Bottom Padding- Returns:
- LayoutSettings
-
create
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
- PaddingalignmentX
- X-Axis Alignment PercentagealignmentY
- Y-Axis Alignment Percentage- Returns:
- LayoutSettings
-
create
Creates new LayoutSettings with the specified padding and alignment.- Parameters:
padding
- Paddingalignment
- Alignment Percentage- Returns:
- LayoutSettings
-
create
Creates new LayoutSettings with the specified alignment.- Parameters:
alignmentX
- X-Axis Alignment PercentagealignmentY
- Y-Axis Alignment Percentage- Returns:
- LayoutSettings
-
createCentered
Creates new LayoutSettings with both alignments set to the center.- Returns:
- LayoutSettings
-
createHorizontallyCentered
Creates new LayoutSettings with the horizontal alignment set to the center.- Returns:
- LayoutSettings
-
createVerticallyCentered
Creates new LayoutSettings with the vertical alignment set to the center.- Returns:
- LayoutSettings
-