FileDocCategorySizeDatePackage
NativeDisplayControllerPeer.javaAPI DocphoneME MR2 API (J2ME)3801Wed May 02 18:00:04 BST 2007com.sun.midp.main

NativeDisplayControllerPeer

public class NativeDisplayControllerPeer extends MVMDisplayController
This class override the MVM display manager so that requests from its parent midlet will not be given to the MVM display manager.

Fields Summary
Constructors Summary
public NativeDisplayControllerPeer(MIDletProxyList theMIDletProxyList)
Construct a DisplayController with a reference to the ProxyList.

param
theMIDletProxyList reference to the MIDlet proxy list

        // The Java foreground selector is not used by this controller.
        super(theMIDletProxyList, null);
    
Methods Summary
MIDletProxybackgroundRequest(MIDletProxy midlet)
Handles MIDlet background requests.

If the MIDlet is the foreground MIDlet, then forward the request to the native layer to the system can show the native foreground selector to the user.

param
midlet The proxy of the MIDlet that was updated
return
foreground MIDlet so the foreground will not change at this time

        MIDletProxy foreground = midletProxyList.getForegroundMIDlet();

        if (midlet == foreground) {
            /*
             * Normal MVM mode case,
             * Let the user choose the next foreground using the native GUI.
             */
            forwardBackgroundRequest(midlet.getExternalAppId());
        }

        // don't change the foreground
        return foreground;
    
MIDletProxyforegroundMidletChanging(MIDletProxy midlet)
Call to notify that foreground MIDlet is changing and give the display controller a chance to preempt the change. Also the last MIDlet created state will be reset.

If the MIDlet to get the foreground is paused, then activate it.

param
midlet proxy of the MIDlet to be put in the foreground
return
Proxy of the next foreground MIDlet, may be the foreground MIDlet if the foreground should not change

        MIDletProxy nextForeground = super.foregroundMidletChanging(midlet);

        if (nextForeground != null) {
            notifyMidletHasForeground(nextForeground.getExternalAppId());
        }

        return nextForeground;
    
private static native voidforwardBackgroundRequest(int externalAppId)
Forwards MIDlet background requests to the native layer.

param
externalAppId ID assigned by the external application manager

static native voidnotifyMidletHasForeground(int externalAppId)
Notify the native application manager of the MIDlet foreground change.

param
externalAppId ID assigned by the external application manager