public class ImageElement
extends com.softwareag.mobile.runtime.nui.nUIImageElement
ImageElement
is an extension of nUIImageElement
which
encapsulates handling of highlight images. To change the current state of the
underlying image, use:
final ImageElement element = ...; // show the default image element.unhighlight(); // show the highlight image element.highlight();In addition it provides methods to scale both images relative to it's parent's dimensions:
final ImageElement element = ...; element.scaleToMatchParent(); element.scaleToParentWidth(); element.scaleToParentHeight();
Y_IDENTIFIER_PREV_BOTTOM
Constructor and Description |
---|
ImageElement(int nuiid,
javax.microedition.lcdui.Image image)
Creates this
ImageElement with a default image. |
ImageElement(int nuiid,
javax.microedition.lcdui.Image image,
javax.microedition.lcdui.Image highlightImage)
Creates this
ImageElement with a default and highlight
image. |
Modifier and Type | Method and Description |
---|---|
void |
addEventListener(com.softwareag.mobile.runtime.nui.nUIEventListener listener,
boolean exclusive) |
void |
applyDefaultImage(javax.microedition.lcdui.Image image)
Sets and displays the default image.
|
javax.microedition.lcdui.Image |
getHighlightImage()
Returns the highlight image.
|
void |
highlight()
Show's the highlight image if it's not null.
|
void |
removeEventListener(com.softwareag.mobile.runtime.nui.nUIEventListener listener) |
void |
scaleToMatchParent()
Scales both images to match the parent's dimensions.
|
void |
scaleToParentHeight()
Scales both images to match the parent's height.
|
void |
scaleToParentWidth()
Scales both images to match the parent's width.
|
void |
setDefaultImage(javax.microedition.lcdui.Image image)
Sets the default image.
|
void |
setHighlightImage(javax.microedition.lcdui.Image highlightImage)
Sets the highlight image.
|
void |
unhighlight()
Show's the default image.
|
getAlign, getHeight, getImage, getInnerWidth, getInnerX, setAlign, setImage
applyBackground, applyBackground, applyBackground
getBackgroundDrawable, getBgcolor, getBottom, getFocus, getFocusable, getGesturable, getInnerHeight, getInnerY, getLeft, getMaxChildX, getMaxChildY, getRight, getScreenInnerX, getScreenInnerY, getScreenX, getScreenY, getTop, getTopLevelParentView, getTopLevelParentWindow, getTriggerable, getWidth, getX, getY, insertAtInternal, isEnabled, isVisible, onRemoved, remove, setBackgroundDrawable, setBgcolor, setBottom, setChildFocus, setEnabled, setFocus, setFocusable, setGesturable, setHeight, setInnerHeight, setInnerWidth, setInnerX, setInnerY, setLeft, setRight, setTop, setTriggerable, setVisible, setWidth, setX, setY
public ImageElement(int nuiid, javax.microedition.lcdui.Image image)
ImageElement
with a default image.nuiid
- image
- public ImageElement(int nuiid, javax.microedition.lcdui.Image image, javax.microedition.lcdui.Image highlightImage)
ImageElement
with a default and highlight
image.nuiid
- image
- highlightImage
- public javax.microedition.lcdui.Image getHighlightImage()
public void setHighlightImage(javax.microedition.lcdui.Image highlightImage)
highlightImage
- public void setDefaultImage(javax.microedition.lcdui.Image image)
image
- public void applyDefaultImage(javax.microedition.lcdui.Image image)
image
- public void scaleToMatchParent()
public void scaleToParentWidth()
public void scaleToParentHeight()
public void highlight()
public void unhighlight()
public void addEventListener(com.softwareag.mobile.runtime.nui.nUIEventListener listener, boolean exclusive)
addEventListener
in class com.softwareag.mobile.runtime.nui.nUIObject
public void removeEventListener(com.softwareag.mobile.runtime.nui.nUIEventListener listener)
removeEventListener
in class com.softwareag.mobile.runtime.nui.nUIObject