Class WidgetContainer

    • Constructor Detail

      • WidgetContainer

        public WidgetContainer()
        Default constructor
      • WidgetContainer

        public WidgetContainer​(int x,
                               int y,
                               int width,
                               int height)
        Constructor
        Parameters:
        x - x position
        y - y position
        width - width of the layout
        height - height of the layout
      • WidgetContainer

        public WidgetContainer​(int width,
                               int height)
        Constructor
        Parameters:
        width - width of the layout
        height - height of the layout
    • Method Detail

      • add

        public void add​(ConstraintWidget widget)
        Add a child widget
        Parameters:
        widget - to add
      • add

        public void add​(ConstraintWidget... widgets)
        Add multiple child widgets.
        Parameters:
        widgets - to add
      • remove

        public void remove​(ConstraintWidget widget)
        Remove a child widget
        Parameters:
        widget - to remove
      • getChildren

        public java.util.ArrayList<ConstraintWidget> getChildren()
        Access the children
        Returns:
        the array of children
      • getRootConstraintContainer

        public ConstraintWidgetContainer getRootConstraintContainer()
        Return the top-level ConstraintWidgetContainer
        Returns:
        top-level ConstraintWidgetContainer
      • setOffset

        public void setOffset​(int x,
                              int y)
        Set the offset of this widget relative to the root widget. We then set the offset of our children as well.
        Overrides:
        setOffset in class ConstraintWidget
        Parameters:
        x - horizontal offset
        y - vertical offset
      • layout

        public void layout()
        Function implemented by ConstraintWidgetContainer
      • removeAllChildren

        public void removeAllChildren()