Class TableLayout

java.lang.Object
tripleplay.ui.Layout
tripleplay.ui.layout.TableLayout

public class TableLayout extends Layout
Lays out elements in a simple tabular form, where each row has uniform height. Frills are kept to a minimum.
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    static class 
    Defines a colspan constraint.
    static class 
    A configurator for a table column.

    Nested classes/interfaces inherited from class tripleplay.ui.Layout

    Layout.Constraint
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final TableLayout.Column
    The default column configuration.
  • Constructor Summary

    Constructors
    Constructor
    Description
    TableLayout(int columns)
    Creates a table layout with the specified number of columns, each with the default configuration.
    Creates a table layout with the specified columns.
  • Method Summary

    Modifier and Type
    Method
    Description
    Configures the vertical alignment of cells to the bottom of their row.
    Configures the vertical alignment of cells to the top of their row.
    static <T extends Element<?>>
    T
    colspan(T elem, int colspan)
    Configures a colspan constraint on elem.
    int
    Returns the number of columns configured for this table.
    columns(int count)
    Creates an array of columns columns, each with default configuration.
    pythagoras.f.Dimension
    computeSize(Container<?> elems, float hintX, float hintY)
    Computes and returns the size needed to arrange children of the supplied container according to their preferred size, given the specified x and y size hints.
    Configures cells to be stretched vertically to take up the entire height of their row.
    gaps(int rowgap, int colgap)
    Configures the gap between successive rows and successive columns.
    void
    layout(Container<?> elems, float left, float top, float width, float height)
    Lays out the supplied elements into a region of the specified dimensions.
    minRowHeight(float minRowHeight)
    Configures the minimum row height.

    Methods inherited from class java.lang.Object

    equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

  • Constructor Details

    • TableLayout

      public TableLayout(int columns)
      Creates a table layout with the specified number of columns, each with the default configuration.
    • TableLayout

      public TableLayout(TableLayout.Column... columns)
      Creates a table layout with the specified columns.
  • Method Details

    • columns

      public static TableLayout.Column[] columns(int count)
      Creates an array of columns columns, each with default configuration.
    • colspan

      public static <T extends Element<?>> T colspan(T elem, int colspan)
      Configures a colspan constraint on elem.
    • gaps

      public TableLayout gaps(int rowgap, int colgap)
      Configures the gap between successive rows and successive columns. The default gap is zero.
    • alignTop

      public TableLayout alignTop()
      Configures the vertical alignment of cells to the top of their row.
    • alignBottom

      public TableLayout alignBottom()
      Configures the vertical alignment of cells to the bottom of their row.
    • fillHeight

      public TableLayout fillHeight()
      Configures cells to be stretched vertically to take up the entire height of their row.
    • minRowHeight

      public TableLayout minRowHeight(float minRowHeight)
      Configures the minimum row height.
      Parameters:
      minRowHeight - Minimum row heigh.
    • columns

      public int columns()
      Returns the number of columns configured for this table.
    • computeSize

      public pythagoras.f.Dimension computeSize(Container<?> elems, float hintX, float hintY)
      Description copied from class: Layout
      Computes and returns the size needed to arrange children of the supplied container according to their preferred size, given the specified x and y size hints.
      Specified by:
      computeSize in class Layout
    • layout

      public void layout(Container<?> elems, float left, float top, float width, float height)
      Description copied from class: Layout
      Lays out the supplied elements into a region of the specified dimensions.
      Specified by:
      layout in class Layout