Class Flow


  • public class Flow
    extends ej.mwt.Container
    Lays out any number of children horizontally or vertically, using multiple rows if necessary.

    As many children as possible will be laid out on the first row. If the next remaining child does not fit on the row, a new row is created in order to lay out the remaining children. This process is repeated until all children are laid out. To know how many children can be laid out in a single row, the optimal size of the children is used.

    In a horizontal flow, all the widgets of the same row will have the same height. In a vertical flow, all the widgets of the same row will have the same width.

    Horizontal:

    Horizontal flow.

    Vertical:

    Vertical flow.

    • Field Summary

      • Fields inherited from class ej.mwt.Widget

        NO_CONSTRAINT
    • Constructor Summary

      Constructors 
      Constructor Description
      Flow​(boolean orientation)
      Creates a flow specifying its orientation.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void addChild​(ej.mwt.Widget child)  
      protected void computeContentOptimalSize​(ej.mwt.util.Size size)  
      boolean getOrientation()
      Gets the orientation of this flow.
      void insertChild​(ej.mwt.Widget child, int index)  
      protected void layOutChildren​(int contentWidth, int contentHeight)  
      void removeAllChildren()  
      void removeChild​(ej.mwt.Widget child)  
      void replaceChild​(int index, ej.mwt.Widget child)  
      void setOrientation​(boolean orientation)
      Sets the orientation of this flow.
      • Methods inherited from class ej.mwt.Container

        changeChildIndex, computeChildOptimalSize, getChild, getChildIndex, getChildren, getChildrenCount, getContentBounds, getContentHeight, getContentWidth, getContentX, getContentY, getWidgetAt, layOutAlignedChild, layOutChild, renderChild, renderContent, setHiddenChild, setHiddenChildren, setShownChild, setShownChildren, updateStyle
      • Methods inherited from class ej.mwt.Widget

        addClassSelector, contains, containsWidget, getAbsoluteX, getAbsoluteY, getDesktop, getHeight, getParent, getStyle, getWidth, getX, getY, handleEvent, hasClassSelector, isAttached, isEnabled, isInState, isShown, isTransparent, onAttached, onDetached, onHidden, onLaidOut, onShown, removeAllClassSelectors, removeClassSelector, render, requestLayOut, requestRender, requestRender, setClassSelectors, setEnabled, setPosition, setStyle
      • Methods inherited from class java.lang.Object

        clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • Flow

        public Flow​(boolean orientation)
        Creates a flow specifying its orientation.
        Parameters:
        orientation - the orientation of the flow (see LayoutOrientation).
    • Method Detail

      • setOrientation

        public void setOrientation​(boolean orientation)
        Sets the orientation of this flow.
        Parameters:
        orientation - the orientation to set (see LayoutOrientation).
      • getOrientation

        public boolean getOrientation()
        Gets the orientation of this flow.
        Returns:
        the orientation of this flow (see LayoutOrientation).
      • addChild

        public void addChild​(ej.mwt.Widget child)
        Overrides:
        addChild in class ej.mwt.Container
      • removeChild

        public void removeChild​(ej.mwt.Widget child)
        Overrides:
        removeChild in class ej.mwt.Container
      • insertChild

        public void insertChild​(ej.mwt.Widget child,
                                int index)
        Overrides:
        insertChild in class ej.mwt.Container
      • replaceChild

        public void replaceChild​(int index,
                                 ej.mwt.Widget child)
        Overrides:
        replaceChild in class ej.mwt.Container
      • removeAllChildren

        public void removeAllChildren()
        Overrides:
        removeAllChildren in class ej.mwt.Container
      • computeContentOptimalSize

        protected void computeContentOptimalSize​(ej.mwt.util.Size size)
        Specified by:
        computeContentOptimalSize in class ej.mwt.Widget
      • layOutChildren

        protected void layOutChildren​(int contentWidth,
                                      int contentHeight)
        Specified by:
        layOutChildren in class ej.mwt.Container