public class ImageWidget
extends ej.mwt.Widget
The widget holds a path to the image. The actual image is allocated only when the widget is attached. It is also closed when the widget is detached.
Constructor and Description |
---|
ImageWidget(java.lang.String imagePath)
Creates an image widget with the resource path of the image to display.
|
Modifier and Type | Method and Description |
---|---|
protected void |
computeContentOptimalSize(ej.mwt.util.Size size) |
protected void |
onAttached() |
protected void |
onDetached() |
protected void |
renderContent(ej.microui.display.GraphicsContext g,
int contentWidth,
int contentHeight) |
void |
setImagePath(java.lang.String imagePath)
Sets the image path.
|
addClassSelector, contains, containsWidget, getAbsoluteX, getAbsoluteY, getContentBounds, getDesktop, getHeight, getParent, getStyle, getWidgetAt, getWidth, getX, getY, handleEvent, hasClassSelector, isAttached, isEnabled, isInState, isShown, isTransparent, onHidden, onLaidOut, onShown, removeAllClassSelectors, removeClassSelector, render, requestLayOut, requestRender, requestRender, setClassSelectors, setEnabled, setPosition, setStyle, updateStyle
public ImageWidget(java.lang.String imagePath)
imagePath
- the resource path of the image to display.java.lang.IllegalArgumentException
- if the image cannot be loaded.ResourceImage.canLoadImage(String)
protected void onAttached()
onAttached
in class ej.mwt.Widget
protected void onDetached()
onDetached
in class ej.mwt.Widget
public void setImagePath(java.lang.String imagePath)
imagePath
- the resource path of the image to display.java.lang.IllegalArgumentException
- if the image cannot be loaded.ResourceImage.canLoadImage(String)
protected void renderContent(ej.microui.display.GraphicsContext g, int contentWidth, int contentHeight)
renderContent
in class ej.mwt.Widget
protected void computeContentOptimalSize(ej.mwt.util.Size size)
computeContentOptimalSize
in class ej.mwt.Widget