testmidletcontrollereventproducer.java
来自「This is a resource based on j2me embedde」· Java 代码 · 共 580 行 · 第 1/2 页
JAVA
580 行
/** * Process a MIDlet active notification * MIDletControllerEventConsumer I/F method. * * TBD: param midletProxy proxy with information about MIDlet * * @param midletSuiteId ID of the MIDlet suite * @param midletClassName Class name of the MIDlet */ public void handleMIDletActiveNotifyEvent( int midletSuiteId, String midletClassName) { assertEquals(SUITE_ID, midletSuiteId); assertEquals(CLASS_NAME, midletClassName); } /** * Process a MIDlet paused notification. * MIDletControllerEventConsumer I/F method. * * TBD: param midletProxy proxy with information about MIDlet * * @param midletSuiteId ID of the MIDlet suite * @param midletClassName Class name of the MIDlet */ public void handleMIDletPauseNotifyEvent( int midletSuiteId, String midletClassName) { assertEquals(SUITE_ID, midletSuiteId); assertEquals(CLASS_NAME, midletClassName); } /** * Process a MIDlet destroyed event. * MIDletControllerEventConsumer I/F method. * * @param midletSuiteId ID of the MIDlet suite * @param midletClassName Class name of the MIDlet */ public void handleMIDletDestroyNotifyEvent( int midletSuiteId, String midletClassName) { assertEquals(SUITE_ID, midletSuiteId); assertEquals(CLASS_NAME, midletClassName); } /** * Processes a MIDLET_RESUME_REQUEST event. * * MIDletControllerEventConsumer I/F method. * * @param midletSuiteId ID of the MIDlet suite * @param midletClassName Class name of the MIDlet */ public void handleMIDletResumeRequestEvent(int midletSuiteId, String midletClassName) { assertEquals(SUITE_ID, midletSuiteId); assertEquals(CLASS_NAME, midletClassName); } /** * Handles notification event of MIDlet resources pause. * MIDletControllerEventConsumer I/F method. * * @param midletSuiteId ID of the MIDlet suite * @param midletClassName Class name of the MIDlet */ public void handleMIDletRsPauseNotifyEvent( int midletSuiteId, String midletClassName) { assertEquals(SUITE_ID, midletSuiteId); assertEquals(CLASS_NAME, midletClassName); } /** * Process a MIDlet destroy request event. * MIDletControllerEventConsumer I/F method. * * @param midletIsolateId isolate ID of the sending Display * @param midletDisplayId ID of the sending Display */ public void handleMIDletDestroyRequestEvent( int midletIsolateId, int midletDisplayId) { assertEquals(currentIsolateId, midletIsolateId); assertEquals(displayId, midletDisplayId); } /** * Process an ACTIVATE_ALL_EVENT. * MIDletControllerEventConsumer I/F method. * */ public void handleActivateAllEvent() { assertTrue(true); } /** * Process a PAUSE_ALL_EVENT. * MIDletControllerEventConsumer I/F method. */ public void handlePauseAllEvent() { assertTrue(true); } /** * Process a SHUTDOWN_ALL_EVENT. * MIDletControllerEventConsumer I/F method. * * It simply calls "shutdown()". In future it shall be merged with * "shutdown()" and substitute it. */ public void handleDestroyAllEvent() { assertTrue(true); } /** * Processes FATAL_ERROR_NOTIFICATION. * * MIDletControllerEventConsumer I/F method. * * @param midletIsolateId isolate ID of the sending isolate * @param midletDisplayId ID of the sending Display */ public void handleFatalErrorNotifyEvent( int midletIsolateId, int midletDisplayId) { assertEquals(currentIsolateId, midletIsolateId); assertEquals(displayId, midletDisplayId); } /** * Process a Display created notification. * MIDletControllerEventConsumer I/F method. * * @param midletIsolateId isolate ID of the sending Display * @param midletDisplayId ID of the sending Display * @param midletClassName Class name of the MIDlet that owns the display */ public void handleDisplayCreateNotifyEvent( int midletIsolateId, int midletDisplayId, String midletClassName) { assertEquals(currentIsolateId, midletIsolateId); assertEquals(displayId, midletDisplayId); assertEquals(CLASS_NAME, midletClassName); } /** * Process a foreground request event. * MIDletControllerEventConsumer I/F method. * * @param midletIsolateId isolate ID of the sending Display * @param midletDisplayId ID of the sending Display * @param isAlert true if the current displayable is an Alert */ public void handleDisplayForegroundRequestEvent( int midletIsolateId, int midletDisplayId, boolean isAlert) { assertEquals(currentIsolateId, midletIsolateId); assertEquals(displayId, midletDisplayId); assertTrue(isAlert); } /** * Process a background request event. * MIDletControllerEventConsumer I/F method. * * * @param midletIsolateId isolate ID of the sending Display * @param midletDisplayId ID of the sending Display */ public void handleDisplayBackgroundRequestEvent( int midletIsolateId, int midletDisplayId) { assertEquals(currentIsolateId, midletIsolateId); assertEquals(displayId, midletDisplayId); } /** * Process a "display preempt start" event. * <p> * Set the foreground to a given display if a certain display * has the foreground. Used to start preempting. * * MIDletControllerEventConsumer I/F method. * * @param midletIsolateId isolate ID of the sending Display * @param midletDisplayId ID of the sending Display */ public void handleDisplayPreemptStartEvent( int midletIsolateId, int midletDisplayId) { assertEquals(currentIsolateId, midletIsolateId); assertEquals(displayId, midletDisplayId); } /** * Process a "display preempt stop" event. * <p> * Set the foreground to a given display if a certain display * has the foreground. Used to end preempting. * * MIDletControllerEventConsumer I/F method. * * @param midletIsolateId isolate ID of the sending Display * @param midletDisplayId ID of the sending Display */ public void handleDisplayPreemptStopEvent( int midletIsolateId, int midletDisplayId) { assertEquals(currentIsolateId, midletIsolateId); assertEquals(displayId2, midletDisplayId); } /** * Process a select foreground event by putting the foreground selector * MIDlet in the foreground. * * MIDletControllerEventConsumer I/F method. * */ public void handleMIDletForegroundSelectEvent(int onlyFromLaunched) { } /** * Process an event to transition the foreground from a current display * to a target MIDlet by ID and classname. If the source display * does not currently own the foreground the request is ignored. * If the target MIDlet is found in the active list then it it set * as the foreground. If not found, then it should be added as * the next display to get the foreground (when it asks). * * MIDletControllerEventConsumer I/F method. * * @param originMIDletSuiteId ID of MIDlet from which * to take forefround ownership away, * @param originMIDletClassName Name of MIDlet from which * to take forefround ownership away * @param targetMIDletSuiteId ID of MIDlet * to give forefround ownership to, * @param targetMIDletClassName Name of MIDlet * to give forefround ownership to */ public void handleMIDletForegroundTransferEvent( int originMIDletSuiteId, String originMIDletClassName, int targetMIDletSuiteId, String targetMIDletClassName) { assertEquals(SUITE_ID, originMIDletSuiteId); assertEquals(CLASS_NAME, originMIDletClassName); assertEquals(TARGET_SUITE_ID, targetMIDletSuiteId); assertEquals(TARGET_CLASS_NAME, targetMIDletClassName); } /** * Processes SET_FOREGROUND_BY_NAME_REQUEST event. * <p> * Set specified MIDlet to foreground. * * @param midletSuiteId MIDlet's suite ID * @param midletClassName MIDlet's class name */ public void handleSetForegroundByNameRequestEvent( int midletSuiteId, String midletClassName) { assertEquals(SUITE_ID, midletSuiteId); assertEquals(CLASS_NAME, midletClassName); }}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?