javauis/tsrc/fute/lcdui/Midp_General_05/src/Midp_General_05.java
branchRCL_3
changeset 83 26b2b12093af
parent 25 9ac0a0a7da70
equal deleted inserted replaced
77:7cee158cb8cd 83:26b2b12093af
       
     1 /*
       
     2 * Copyright (c) 2003-2010 Nokia Corporation and/or its subsidiary(-ies).
       
     3 * All rights reserved.
       
     4 * This component and the accompanying materials are made available
       
     5 * under the terms of "Eclipse Public License v1.0"
       
     6 * which accompanies this distribution, and is available
       
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     8 *
       
     9 * Initial Contributors:
       
    10 * Nokia Corporation - initial contribution.
       
    11 *
       
    12 * Contributors:
       
    13 *
       
    14 * Description:
       
    15 *
       
    16 */
       
    17 
       
    18 /**
       
    19  * import midp classes.
       
    20  */
       
    21 import javax.microedition.midlet.*;
       
    22 import javax.microedition.lcdui.*;
       
    23 
       
    24 /**
       
    25  *
       
    26  */
       
    27 
       
    28 public class Midp_General_05 extends MIDlet
       
    29 {
       
    30 
       
    31     private Canvas canvas;
       
    32     private Display display;
       
    33 
       
    34     public Midp_General_05()
       
    35     {
       
    36         display = Display.getDisplay(this);
       
    37         canvas = new EmptyCanvas();
       
    38     }
       
    39 
       
    40     /**
       
    41      * Signals the MIDlet to start and enter the Active state.
       
    42      */
       
    43     protected void startApp()
       
    44     {
       
    45         display.setCurrent(canvas);
       
    46     }
       
    47 
       
    48     /**
       
    49      *  Signals the MIDlet to terminate and enter the Destroyed state.
       
    50      *
       
    51      */
       
    52     protected void destroyApp(boolean unconditional)
       
    53     {
       
    54     }
       
    55 
       
    56     /**
       
    57      *  Signals the MIDlet to stop and enter the Paused state.
       
    58      */
       
    59     protected void pauseApp()
       
    60     {
       
    61     }
       
    62 }
       
    63 
       
    64 class EmptyCanvas extends Canvas
       
    65 {
       
    66     protected void paint(Graphics g)
       
    67     {
       
    68         g.setColor(0, 0, 0);
       
    69         g.drawString("Empty Canvas", getWidth()/2, getHeight()/2, Graphics.TOP | Graphics.HCENTER);
       
    70     }
       
    71 }
       
    72