Record Class FlowBox

java.lang.Object
java.lang.Record
org.moddingx.libx.screen.text.entry.FlowBox
Record Components:
horizontalAlignment - How the elements should be aligned horizontally.
verticalAlignment - How the elements should be aligned vertically.
elements - The elements inside this box.
left - The horizontal padding to the left edge of the screen.
top - The vertical padding to the bottom of the previous component.
All Implemented Interfaces:
TextScreenEntry

public record FlowBox(FlowBox.HorizontalAlignment horizontalAlignment, FlowBox.VerticalAlignment verticalAlignment, List<TextScreenEntry.Direct> elements, int left, int right, int top) extends Record implements TextScreenEntry
A flow box can align elements horizontally inside a TextScreen that align items vertically by default. Elements will be split into multiple rows, where each row is filled with as many elements as possible before they overflow. Note that wrapped components can shrink in width. It is recommended to set a minimum width when using wrapped components inside a flow box. Inside the flow box, left padding will be added to each element and describes the distance to the previous element in the row. The first element in a row won't get left padding, to pad the start of a row, pad the entire flow box. All elements in a row will get the same top padding which is the maximum of the individual top paddings inside that row. Flow boxes can also define right padding which is useful when the flow box uses FlowBox.HorizontalAlignment.RIGHT alignment.
  • Constructor Details

  • Method Details

    • toString

      public final String toString()
      Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • hashCode

      public final int hashCode()
      Returns a hash code value for this object. The value is derived from the hash code of each of the record components.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. Reference components are compared with Objects::equals(Object,Object); primitive components are compared with '=='.
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • horizontalAlignment

      public FlowBox.HorizontalAlignment horizontalAlignment()
      Returns the value of the horizontalAlignment record component.
      Returns:
      the value of the horizontalAlignment record component
    • verticalAlignment

      public FlowBox.VerticalAlignment verticalAlignment()
      Returns the value of the verticalAlignment record component.
      Returns:
      the value of the verticalAlignment record component
    • elements

      public List<TextScreenEntry.Direct> elements()
      Returns the value of the elements record component.
      Returns:
      the value of the elements record component
    • left

      public int left()
      Returns the value of the left record component.
      Specified by:
      left in interface TextScreenEntry
      Returns:
      the value of the left record component
    • right

      public int right()
      Returns the value of the right record component.
      Returns:
      the value of the right record component
    • top

      public int top()
      Returns the value of the top record component.
      Specified by:
      top in interface TextScreenEntry
      Returns:
      the value of the top record component