⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 backgroundmenu.java

📁 游戏名称:九宫阵 运行平台:j2me 规范:midp 说明:一款很经典的游戏源码
💻 JAVA
字号:
/*
 * Copyright (C) 2005-2006 Leopardo.f
 *
 * This file is part of M-SuDoKu, a J2ME version of SuDoKu.
 *
 * M-SuDoKu is free software; you can redistribute it and/or
 * modify it under the terms of the GNU General Public
 * License as published by the Free Software Foundation; either
 * version 2 of the License, or (at your option) any later version.
 * 
 * M-SuDoKu is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * General Public License for more details.
 * 
 * You should have received a copy of the GNU General Public
 * License along with M-SuDoKu; if not, write to the
 * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
 * Boston, MA  02111-1307, USA.  Or, visit http://www.gnu.org/copyleft/gpl.html
 */

package MSuDoKu;

import javax.microedition.lcdui.*;

/**
 * List subclass implementing the background choice menu
 * @author Leopardo.f
 */
public class BackgroundMenu extends List implements CommandListener {
    
    protected App app;
    protected String[] saStrings, saBackgroundStrings;
//  protected Command cmdSelect, cmdCancel;
    protected Command cmdCancel;
    
    /** Creates a new instance of BackgroundMenu
     * @param app the App class instance that uses this object
     * @param sal the string array containing the background menu items
     * @param sa the string array containing the main menu items
     * @see App
     */
    public BackgroundMenu (App app, String[] sal, String[] sa) {
        super (Utils.sAppName, Choice.IMPLICIT);
        this.app = app;
        saBackgroundStrings = sal;
        saStrings = sa;

        for (byte b = 0; b < saBackgroundStrings.length; b++)
            append (saBackgroundStrings[b], null);
//      cmdSelect = new Command (saStrings[Utils.SELECT], Command.OK, 1);
//      cmdCancel = new Command (saStrings[Utils.CANCEL], Command.CANCEL, 1);
        cmdCancel = new Command (saStrings[Utils.CANCEL], Command.OK, 1);

        addCommand (cmdCancel);
//      addCommand (cmdSelect);
        setCommandListener (this);
    }
    
    public void commandAction (Command c, Displayable d)
    {
        if (c == cmdCancel)
            app.showBoard();
        else
            if (getSelectedIndex() >= 0)
                app.changeBackground (getSelectedIndex());
    }
}

⌨️ 快捷键说明

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