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.
| Modifier | Constructor and Description |
|---|---|
|
ImageWidget(java.lang.String imagePath)
Creates an image widget with the resource path of the image to display.
|
protected |
ImageWidget(java.lang.String imagePath,
boolean enabled)
Creates an image widget with the resource path of the image to display and its enabled state.
|
| 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, updateStylepublic 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 ImageWidget(java.lang.String imagePath,
boolean enabled)
imagePath - the resource path of the image to display.enabled - true if this image widget is to be enabled, false otherwise.java.lang.IllegalArgumentException - if the image cannot be loaded.ResourceImage.canLoadImage(String)protected void onAttached()
onAttached in class ej.mwt.Widgetprotected void onDetached()
onDetached in class ej.mwt.Widgetpublic 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.Widgetprotected void computeContentOptimalSize(ej.mwt.util.Size size)
computeContentOptimalSize in class ej.mwt.Widget