Methods Summary |
---|
protected void | initialize()Initialize the bounds of this AlertLayer. Overrides
initialize in superclasses. The dimensions of the
specific AlertLayer are specified in AlertSkin.
The X and Y coordinates represent the upper left position
of this CLayer in the physical display's coordinate space.
super.initialize();
setAnchor();
|
public void | setAlert(boolean alertVisible, Alert alert, int height)Sets content to be displayed in the Alert Layer.
This AlertLayer will be made visible if alertVisible
is true and will be hidden - otherwise.
this.alert = alert;
setDirty();
setVisible(alertVisible);
|
public void | setAnchor()Align alert depend on skin
bounds[W] = AlertSkin.WIDTH;
bounds[H] = AlertSkin.HEIGHT;
switch (AlertSkin.ALIGN_X) {
case Graphics.LEFT:
bounds[X] = 0;
break;
case Graphics.RIGHT:
bounds[X] = ScreenSkin.WIDTH - bounds[W];
break;
case Graphics.HCENTER:
default:
bounds[X] = (ScreenSkin.WIDTH - bounds[W]) / 2;
break;
}
switch (AlertSkin.ALIGN_Y) {
case Graphics.TOP:
bounds[Y] = 0;
break;
case Graphics.VCENTER:
bounds[Y] = (ScreenSkin.HEIGHT - SoftButtonSkin.HEIGHT -
bounds[H]) / 2;
if (alert != null && alert.getTicker() != null) {
bounds[Y] -= TickerSkin.HEIGHT;
}
break;
case Graphics.BOTTOM:
default:
bounds[Y] = ScreenSkin.HEIGHT - SoftButtonSkin.HEIGHT -
bounds[H];
if (alert != null && alert.getTicker() != null) {
bounds[Y] -= TickerSkin.HEIGHT;
}
break;
}
|
public void | setVisible(boolean visible)Toggle the visibility state of Alert layer within its containing
window.
super.setVisible(visible);
setSupportsInput(visible);
|
public void | update(com.sun.midp.chameleon.CLayer[] layers)Update bounds of layer
setAnchor();
if (visible) {
addDirtyRegion();
}
if (scrollInd != null) {
scrollInd.update(layers);
if (scrollInd.isVisible()) {
bounds[W] -= scrollInd.bounds[W];
}
}
|