Class Stack

java.lang.Object
limn.scene.Widget
limn.scene.layout.Stack

public class Stack extends Widget
Overlays children on top of each other (later children on top; the base for overlays and modal dialogs). Sizes to the biggest child; each child is placed by this stack's Stack.Alignment.
  • Constructor Details

    • Stack

      public Stack()
  • Method Details

    • alignment

      public Stack alignment(Stack.Alignment newAlignment)
      Where children sit within the stack's box; they all get the full box to measure against.
    • onMeasure

      protected Size onMeasure(Constraints constraints)
      Description copied from class: Widget
      Reports the size this widget wants within constraints. Called once per layout pass, and the result is cached against the constraints and the resolved axes (size step, layout direction, locale), so it must be a pure function of them and of this widget's own state.

      Resolve the ControlSize and the LayoutDirection once each here and thread them down; never read either in a constructor. The locale needs no threading: it is in scope, and I18n.locale() answers it wherever text is resolved.

      Specified by:
      onMeasure in class Widget
    • onLayout

      protected void onLayout()
      Description copied from class: Widget
      Containers position children here (measure + Widget.layoutBox(float, float, float, float) per child).
      Overrides:
      onLayout in class Widget