public class FixedGrid
extends ej.mwt.Container
All the children are laid out in a grid, which has a fixed number of columns and rows.
In a grid, all children have the same width and the same height, regardless of their optimal size.
Constructor and Description |
---|
FixedGrid(int columns,
int rows)
Creates a grid specifying its number of columns and rows.
|
Modifier and Type | Method and Description |
---|---|
void |
addChild(ej.mwt.Widget child,
int column,
int row)
Adds a widget at the specified column and row.
|
protected void |
computeContentOptimalSize(ej.mwt.util.Size size) |
ej.mwt.Widget |
getCellChild(int column,
int row)
Gets the widget at the specified column and row.
|
int |
getColumns()
Gets the number of columns.
|
int |
getRows()
Gets the number of rows.
|
protected void |
layOutChildren(int contentWidth,
int contentHeight) |
void |
removeAllChildren() |
void |
removeChild(int column,
int row)
Removes the widget at the specified column and row.
|
addChild, changeChildIndex, computeChildOptimalSize, getChild, getChildIndex, getChildren, getChildrenCount, getContentBounds, getContentHeight, getContentWidth, getContentX, getContentY, getWidgetAt, insertChild, layOutChild, removeChild, renderChild, renderContent, replaceChild, 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 FixedGrid(int columns, int rows)
columns
- the number of columnsrows
- the number of rowsjava.lang.IllegalArgumentException
- if one of the parameters is negative or zeropublic int getColumns()
public int getRows()
@Nullable public ej.mwt.Widget getCellChild(int column, int row)
column
- the column of the widget to returnrow
- the row of the widget to returnjava.lang.IndexOutOfBoundsException
- if the cell referenced by the given coordinates is out of rangepublic void addChild(ej.mwt.Widget child, int column, int row)
child
- the child to addcolumn
- the column of the widgetrow
- the row of the widgetjava.lang.IndexOutOfBoundsException
- if the cell referenced by the given coordinates is out of rangepublic void removeChild(int column, int row)
column
- the column of the widgetrow
- the row of the widgetjava.lang.IndexOutOfBoundsException
- if the cell referenced by the given coordinates is out of rangepublic 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