wzqdisplayable.java~2~

来自「j2me源代码」· JAVA~2~ 代码 · 共 56 行

JAVA~2~
56
字号
package wzq;

import javax.microedition.lcdui.*;

/**
 * <p>Title: </p>
 *
 * <p>Description: </p>
 *
 * <p>Copyright: Copyright (c) 2005</p>
 *
 * <p>Company: </p>
 *
 * @author not attributable
 * @version 1.0
 */
public class WzqDisplayable extends Canvas implements CommandListener {

    int nWhiteWidth; //width of the white space
    int nCanvasW, nCanvasH;  //the width and height of the canvas
    int nChessWidth;  //the width of chesses
    int nChessMapLength, nMapGrid, nGridWidth;  //the length of chessmap,number of mapgrid and width of grid
    int nMapX, nMapY;   //the x,y value of the map origin position
    int nSelectX, nSelectY; //the x,y value of the position box
    boolean bIsPlayer1;  //is player1 or not
    Chesses chess[][];
    public WzqDisplayable() {
        try {
            jbInit();
        }
        catch(Exception e) {
            e.printStackTrace();
        }
    }

    private void jbInit() throws Exception {
        // Set up this Displayable to listen to command events
        setCommandListener(this);
        // add the Exit command
        addCommand(new Command("Exit", Command.EXIT, 1));
    }

    public void commandAction(Command command, Displayable displayable) {
        /** @todo Add command handling code */
        if (command.getCommandType() == Command.EXIT) {
            // stop the MIDlet
            WzqMIDlet.quitApp();
        }
    }

    protected void paint(Graphics g) {
        /** @todo Add paint codes */
    }

}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?