Package tripleplay.ui

Class SizableGroup

All Implemented Interfaces:
Iterable<Element<?>>

public class SizableGroup extends Group
A group that allows configuring its preferred size. The size is always returned when the size of the group is calculated, but the group may end up being stretched when contained in a layout that does so.
  • Field Details

    • preferredSize

      public final DimensionValue preferredSize
      The preferred size of this widget. Update at will.
  • Constructor Details

    • SizableGroup

      public SizableGroup(Layout layout)
      Creates the sizable group with preferred width and height of 0. Note that this will cause the base layout preferred size to be used, if overridden.
    • SizableGroup

      public SizableGroup(Layout layout, pythagoras.f.IDimension size)
      Creates the sizable group with the given preferred size.
    • SizableGroup

      public SizableGroup(Layout layout, float wid, float hei)
      Creates the sizable group with preferred width and height.
  • Method Details

    • forWidth

      public SizableGroup forWidth(Element.Take fn)
      Sets the way in which widths are combined to calculate the resulting preferred size. For example, new SizeableGroup(...).forWidth(Take.MAX).
    • forHeight

      public SizableGroup forHeight(Element.Take fn)
      Sets the way in which heights are combined to calculate the resulting preferred size. For example, new SizeableGroup(...).forHeight(Take.MAX).