Dialog.java
上传用户:sygbg6
上传日期:2020-12-29
资源大小:4884k
文件大小:1k
- package cn.com.imageanalyze.customform.dialog;
- import javax.microedition.lcdui.Command;
- import javax.microedition.lcdui.CommandListener;
- import javax.microedition.lcdui.Displayable;
- import cn.com.imageanalyze.customform.CustomForm;
- import cn.com.imageanalyze.customform.Parent;
- /**
- * dialog抽象类,所有dialog 的父类~
- * @author Administrator
- *
- */
- public abstract class Dialog extends CustomForm implements CommandListener{
- public Dialog(String arg0, Parent Parent) {
- super(arg0, Parent);
- // TODO Auto-generated constructor stub
- }
- Command c1;
- protected String content;
- public boolean confirm = true;
- public String getContent() {
- return content;
- }
- public void setContent(String content) {
- this.content = content;
- }
- public void commandAction(Command arg0, Displayable arg1) {
- // TODO Auto-generated method stub
- this.append("s1");
- if(arg0 == c1){
- try{
- this.append("s2");
- this.removeCommand(c1);
- clickConfirm();
- parent.show();
- }catch(Exception e){
- this.append(e.getMessage() + e.getClass().getName());
- }
- }
- }
- public void paintSelf() {
- // TODO Auto-generated method stub
- if(content != null)
- this.append(this.content);
- if(confirm){
- c1 = new Command("确定", Command.OK, 1);
- this.addCommand(c1);
- }
- this.setCommandListener(this);
- }
- public abstract void clickConfirm();
- }