public class Canvas
extends ej.mwt.Container
Each child is laid out at the position it has been given.
In a canvas, each child will have the size it has been given, or if desired, its optimal size.
Constructor and Description |
---|
Canvas()
Creates a canvas.
|
Modifier and Type | Method and Description |
---|---|
void |
addChild(ej.mwt.Widget child,
int x,
int y,
int width,
int height)
Adds the specified widget to this canvas.
|
void |
changeChildIndex(ej.mwt.Widget child,
int index) |
protected void |
computeContentOptimalSize(ej.mwt.util.Size size) |
protected void |
layOutChildren(int contentWidth,
int contentHeight) |
void |
removeAllChildren() |
void |
removeChild(ej.mwt.Widget child) |
addChild, computeChildOptimalSize, getChild, getChildIndex, getChildren, getChildrenCount, getContentBounds, getContentHeight, getContentWidth, getContentX, getContentY, getWidgetAt, insertChild, layOutChild, 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 void addChild(ej.mwt.Widget child, int x, int y, int width, int height)
If the given width or height is Widget.NO_CONSTRAINT
, the widget is fitted to its optimal width/height.
child
- the widget to add.x
- the x coordinate of the widget.y
- the y coordinate of the widget.width
- the width of the widget, or Widget.NO_CONSTRAINT
to use the widget optimal width.height
- the height of the widget, or Widget.NO_CONSTRAINT
to use the widget optimal height.java.lang.NullPointerException
- if the specified widget is null
.java.lang.IllegalArgumentException
- if the specified widget is already in a hierarchy (already contained in a container or desktop).Container.addChild(Widget)
public void removeChild(ej.mwt.Widget child)
removeChild
in class ej.mwt.Container
public void removeAllChildren()
removeAllChildren
in class ej.mwt.Container
public void changeChildIndex(ej.mwt.Widget child, int index)
changeChildIndex
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