Class Flow.Builder

Enclosing class:
Flow

public static final class Flow.Builder extends AbstractPanelElement.Builder<Flow, Flow.Builder>
  • Method Details

    • self

      protected Flow.Builder self()
      Description copied from class: AbstractPanelElement.Builder
      Returns this as the concrete builder.
      Specified by:
      self in class AbstractPanelElement.Builder<Flow, Flow.Builder>
    • add

      public Flow.Builder add(PanelElement child)
      Adds a child (or a Flow.spacer()). Declaration order is flow order.
    • addAll

      public Flow.Builder addAll(List<? extends PanelElement> children)
      Adds children, in order.
    • gap

      public Flow.Builder gap(int px)
      The gap between children, both axes. Default 4.
    • gap

      public Flow.Builder gap(int horizontal, int vertical)
      The gap between children in a row and between rows; in a vertical Flow, between columns and between children in a column.
    • vertical

      public Flow.Builder vertical()
      Top to bottom, wrapping into a new column to the right where the frame beside the panel ends. Default: left to right, wrapping into rows. See the class notes.
    • boxed

      public Flow.Builder boxed()
      Draws a card behind the children: they sit Flow.BOX_PADDING inside it, a row Flow fills its width, the height hugs the content. See the class notes.
    • crossAlign

      public Flow.Builder crossAlign(CrossAlign align)
      Where each child sits on its row's line, in a row Flow. The default, CrossAlign.START, top-aligns them; CrossAlign.CENTER centers each on the line (a label level with the middle of its control); CrossAlign.END sets each on the line's bottom. FILL is a Column's and reads as START. The line is the tallest child's first line; see the class notes. A vertical Flow throws at build on anything but START.
    • wrapAfter

      public Flow.Builder wrapAfter(int n)
      At most n shown children in a column (in a row, in a row Flow), whatever room is left. See the class notes.
    • wrapAfter

      public Flow.Builder wrapAfter(IntSupplier n)
      At most as many shown children in a column (a row) as n gives, read every frame; 0 or less for no cap. For a cap that follows the game mode or a setting.
    • keepLast

      public Flow.Builder keepLast()
      In a vertical Flow that wraps, the last children keep the first column and the earliest step out into the next, to its right. Default: the first ones keep it.
    • build

      public Flow build()
      Description copied from class: AbstractPanelElement.Builder
      Builds the element. Throws IllegalStateException when a required setting is missing.
      Specified by:
      build in class AbstractPanelElement.Builder<Flow, Flow.Builder>