Package tripleplay.ui

Class SizableWidget<T extends SizableWidget<T>>

java.lang.Object
tripleplay.ui.Element<T>
tripleplay.ui.Widget<T>
tripleplay.ui.SizableWidget<T>
Direct Known Subclasses:
GlyphWidget, Shim

public abstract class SizableWidget<T extends SizableWidget<T>> extends Widget<T>
A widget that allows configuring its preferred size. The size is always returned when the size of the widget is calculated, but the widget 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

    • SizableWidget

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

      public SizableWidget(pythagoras.f.IDimension size)
      Creates the sizable widget with the given preferred size.
    • SizableWidget

      public SizableWidget(float width, float height)
      Creates the sizable widget with preferred width and height.