FileDocCategorySizeDatePackage
LCDUIEvent.javaAPI DocphoneME MR2 API (J2ME)4538Wed May 02 18:00:24 BST 2007com.sun.midp.lcdui

LCDUIEvent

public class LCDUIEvent extends com.sun.midp.events.Event
An subclass for "synthetic" LCDUI events. These events are generated by LCDUI for its own purposes, and they include events whose type codes are SCREEN_CHANGE_EVENT, CALL_SERIALLY_EVENT, INVALIDATE_EVENT and ITEM_EVENT. Events generated by the system, such as keystrokes and commands, are not considered to be synthetic events because they represent some actual user action. TBD: Class need to be PUIBLIC only if LCDUIEvent will be needed outside of the package

Fields Summary
javax.microedition.lcdui.Item
changedItem
Item for the item changed event.
javax.microedition.lcdui.Displayable
nextScreen
Next screen.
DisplayEventConsumer
display
Target display of the event.
boolean
hasForeground
True if the display has be put in the foreground.
int
minorCode
The event's minor code. For events of type ITEM_EVENT, the minor code is either ITEM_STATE_CHANGED or ITEM_SIZE_REFRESH.
static final int
ITEM_STATE_CHANGED
Constant specifying that an ITEM_EVENT indicates a state change.
static final int
ITEM_SIZE_REFRESH
Constant specifying that an ITEM_EVENT requests a size refresh.
Constructors Summary
private LCDUIEvent(int type)
Construct an event that has no parameters.

param
type event ID type




                     
       
        super(type);
    
Methods Summary
static com.sun.midp.lcdui.LCDUIEventcreateBasicEvent(DisplayEventConsumer d, int type)
Create a basic LCDUI event.

param
d Target Display
param
type event ID type
return
initialized event

        LCDUIEvent event = new LCDUIEvent(type);

        if (Logging.TRACE_ENABLED) {
            if (d == null) {
                Logging.report(Logging.ERROR, LogChannels.LC_CORE,
                               "Event created with a null display target");
            }
        }

        event.display = d;
        return event;
    
static com.sun.midp.lcdui.LCDUIEventcreateItemEvent(javax.microedition.lcdui.Item src, int minor)
Create an item state changed event.

param
src the Item src to the event
param
minor the minor code
return
initialized event

        LCDUIEvent e = new LCDUIEvent(EventTypes.ITEM_EVENT);
        e.changedItem = src;
        e.minorCode = minor;
        return e;
    
static com.sun.midp.lcdui.LCDUIEventcreateScreenChangeEvent(DisplayEventConsumer parent, javax.microedition.lcdui.Displayable d)
Create a screen change event.

param
parent parent Display of the Displayable
param
d The Displayable to change the current screen to
return
initialized event

        LCDUIEvent e = new LCDUIEvent(EventTypes.SCREEN_CHANGE_EVENT);
        e.display = parent;
        e.nextScreen = d;
        return e;
    
static com.sun.midp.lcdui.LCDUIEventcreateScreenRepaintEvent(DisplayEventConsumer display)
Create a screen repaint event.

param
display parent Display of the Displayable
return
initialized event

        LCDUIEvent e = new LCDUIEvent(EventTypes.SCREEN_REPAINT_EVENT);
        e.display = display;
        return e;