public class Canvas extends StyledComposite
EMPTY_ELEMENT_ARRAY
Constructor and Description |
---|
Canvas()
Creates a canvas.
|
Modifier and Type | Method and Description |
---|---|
void |
add(ej.mwt.Widget widget,
int x,
int y,
int width,
int height)
Adds a widget in this composite.
|
void |
remove(ej.mwt.Widget widget) |
void |
removeAllWidgets() |
protected void |
setBoundsContent(Rectangle bounds)
Sets the bounds of this widget by taking into account the border, margin and padding specified in the style.
|
Rectangle |
validateContent(Style style,
Rectangle bounds)
Gets the content size of the renderable without the border, margin and padding specified in the style.
|
add, addClassSelector, contains, gainFocus, getAttribute, getChild, getChildrenCount, getChildrenElements, getParentElement, getStyle, hasClassSelector, isInState, isTransparent, lostFocus, mergeStyle, removeAllClassSelectors, removeClassSelector, removeInstanceStyle, render, renderContent, setBounds, setClassSelectors, setEnabled, updateStyle, updateStyleOnly, validate
getFocus, getFocusIndex, getNext, getWidget, getWidgetAt, getWidgets, getWidgetsCount, handleEvent, hideNotify, iterator, requestFocus, requestFocus, requestFocusFrom, showNotify
getAbsoluteX, getAbsoluteX, getAbsoluteY, getAbsoluteY, getEventHandler, getHeight, getPanel, getParent, getPreferredHeight, getPreferredWidth, getRelativeX, getRelativeY, getWidth, getX, getY, hasFocus, invalidate, isEnabled, isShown, isValid, isVisible, repaint, repaint, revalidate, revalidateSubTree, setEventHandler, setLocation, setPreferredSize, setSize, setVisible
public void add(ej.mwt.Widget widget, int x, int y, int width, int height) throws java.lang.NullPointerException, java.lang.IllegalArgumentException
If the given width or height is MWT.NONE
, the widget size (width or/and height) is fitted to its
preferred size.
widget
- the widget to add.x
- the x coordinate of the widget.y
- the y coordinate of the widget.width
- the width of the widget.height
- the height of the widget.java.lang.NullPointerException
- if the specified widget is null
.java.lang.IllegalArgumentException
- if the specified widget or one of its children is already connected to a panel.StyledComposite.add(Widget)
public void remove(ej.mwt.Widget widget) throws java.lang.NullPointerException
remove
in class ej.mwt.Composite
java.lang.NullPointerException
public void removeAllWidgets()
removeAllWidgets
in class ej.mwt.Composite
public Rectangle validateContent(Style style, Rectangle bounds)
StyledComposite
Lays out the children of this composite.
validateContent
in interface StyledRenderable
validateContent
in class StyledComposite
style
- the style to use.bounds
- the bounds available for the content. A width or a height equals to MWT.NONE
means no
constraint on this dimension.protected void setBoundsContent(Rectangle bounds)
StyledComposite
setBoundsContent
in class StyledComposite
bounds
- the bounds available for the content.