public class Flow
extends ej.mwt.Container
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:
Vertical:
Constructor and Description |
---|
Flow(boolean orientation)
Creates a flow specifying its orientation.
|
Modifier and Type | Method and 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.
|
changeChildIndex, computeChildOptimalSize, getChild, getChildIndex, getChildren, getChildrenCount, getContentBounds, getContentHeight, getContentWidth, getContentX, getContentY, getWidgetAt, layOutChild, renderChild, renderContent, setHiddenChild, setHiddenChildren, setShownChild, setShownChildren, updateStyle
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
public Flow(boolean orientation)
orientation
- the orientation of the flow (see LayoutOrientation
).public void setOrientation(boolean orientation)
orientation
- the orientation to set (see LayoutOrientation
).public boolean getOrientation()
LayoutOrientation
).public void addChild(ej.mwt.Widget child)
addChild
in class ej.mwt.Container
public void removeChild(ej.mwt.Widget child)
removeChild
in class ej.mwt.Container
public void insertChild(ej.mwt.Widget child, int index)
insertChild
in class ej.mwt.Container
public void replaceChild(int index, ej.mwt.Widget child)
replaceChild
in class ej.mwt.Container
public void removeAllChildren()
removeAllChildren
in class ej.mwt.Container
protected void computeContentOptimalSize(ej.mwt.util.Size size)
computeContentOptimalSize
in class ej.mwt.Widget
protected void layOutChildren(int contentWidth, int contentHeight)
layOutChildren
in class ej.mwt.Container