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

📄 setshowpropertyscreen.java

📁 一個手機程序(電子詞典),一個不可多得的源碼程序,是學習J2ME的好東東.
💻 JAVA
字号:
package org.zblog.zenghelper.screen.sub;

import javax.microedition.lcdui.Form;
import javax.microedition.lcdui.ChoiceGroup;
import javax.microedition.lcdui.Choice;
import javax.microedition.lcdui.Command;
import javax.microedition.lcdui.CommandListener;
import javax.microedition.lcdui.Displayable;
import org.zblog.zenghelper.util.Navigator;
import org.zblog.zenghelper.screen.SenWordScreen;
import org.zblog.zenghelper.dbtool.SystemInfo;

/**
 * <br><strong>Z英语学习助手-SenWordScreen-设置生词卡片显示属性</strong><br>
 * <br>该屏幕是隶属于SenWordScreen下的子屏幕,用于设置生词卡片显示属性,包括:卡片第一次
 * 显示的内容(单词,音标,解释),显示顺序(随机,顺序)
 *
 * @author <a href="mailto:zcw@zblog.org">朱传伟</a><br>
 * <a href="http://www.zblog.org">www.zblog.org</a></p>
 * @version <strong>ZEnHelper</strong> Ver 1.0
 */

public class SetShowPropertyScreen extends Form implements CommandListener{
    public SenWordScreen dis=null;
    public ChoiceGroup firstShow=null;
    public ChoiceGroup randomShow=null;


    public SetShowPropertyScreen(SenWordScreen d,SystemInfo si) {
        super("设置显示属性");
        dis=d;
        firstShow=new ChoiceGroup("初始内容:",Choice.MULTIPLE);
        firstShow.append("En单词",null);
        firstShow.append("En音标",null);
        firstShow.append("Cn解释",null);
        firstShow.setSelectedIndex(0,si.isEnShow);
        firstShow.setSelectedIndex(1,si.isYbShow);
        firstShow.setSelectedIndex(2,si.isCnShow);
        randomShow=new ChoiceGroup("显示顺序:",Choice.EXCLUSIVE);
        randomShow.append("随机显示",null);
        randomShow.append("顺序显示",null);
        randomShow.setSelectedIndex(0,si.isRandom);
        randomShow.setSelectedIndex(1,!si.isRandom);
        this.append(firstShow);
        this.append(randomShow);
        Command ok=new Command("确定",Command.OK,1);
        Command cancel=new Command("取消",Command.CANCEL,1);
        addCommand(ok);
        addCommand(cancel);
        setCommandListener(this);
    }

    public void commandAction(Command command, Displayable displayable) {
        String lstr=command.getLabel();
        if(lstr.equals("确定")){
            SystemInfo si=dis.sinfo;
            si.isEnShow=firstShow.isSelected(0);
            si.isYbShow=firstShow.isSelected(1);
            si.isCnShow=firstShow.isSelected(2);
            si.isRandom=randomShow.isSelected(0);
            si.store();
            dis.init();
            Navigator.show(dis);
        }
        else if(lstr.equals("取消")){
            Navigator.show(dis);
        }
    }

}

⌨️ 快捷键说明

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