www.pudn.com > WordTip.zip > About.java


/* 
 * Created on 2005-1-27 
 * 
 * TODO To change the template for this generated file go to 
 * Window - Preferences - Java - Code Style - Code Templates 
 */ 
package net.hyweb.ui; 
 
import net.hyweb.*; 
import javax.microedition.lcdui.*; 
import javax.microedition.lcdui.Item; 
 
/** 
 * @author user 
 * 
 * TODO To change the template for this generated type comment go to 
 * Window - Preferences - Java - Code Style - Code Templates 
 */ 
public class About extends Form implements CommandListener, ItemCommandListener { 
 
	private UIController uicontroller; 
	private Command backCommand; 
	private Command goCommand; 
	private StringItem link; 
	private String author; 
	private WordTipMIDlet myMIDlet; 
	 
	/** 
	 * @param arg0 
	 */ 
	public About(UIController uicontroller) { 
		super("About"); 
		this.uicontroller = uicontroller; 
		 
		backCommand = new Command("Back", Command.BACK, 0); 
		myMIDlet = WordTipMIDlet.getMyMIDlet(); 
		 
		this.addCommand(backCommand); 
		this.setCommandListener(this); 
		 
		author      = EventID.AUTHOR; 
		link        = new StringItem(null, "www.hyweb.net", Item.HYPERLINK); 
		goCommand   = new Command("Go", Command.OK, 1); 
		 
		link.setDefaultCommand(goCommand); 
		link.setItemCommandListener(this); 
		 
		this.append("\n" + "WordTip  version "  
				+ EventID.VERSION + "\n"  
				+ "Author: "  
				+ author + "\n"  
				+ "Please visit: "); 
		 
		this.append(link); 
		this.append("\n" + "MIDlet-Vendor: " + EventID.Perform_Vendor + "\n"); 
		this.append("MIDlet-Description: " + EventID.Perform_Description + "\n"); 
		this.append("JadFile-Version: " + EventID.Perform_JadFileVersion + "\n");  
		this.append("MIDlet-Data-Size: " + EventID.Perform_MIDletDataSize);  
	} 
 
 
	/** 
	 * 扩展CommandListener接口 
	 */ 
	public void commandAction(Command arg0, Displayable arg1) { 
		 
		if(arg0 == backCommand){ 
			uicontroller.EventController(EventID.UI_MAIN); 
		} 
	} 
 
	/** 
	 * 扩展ItemCommandListener接口 
	 */ 
	public void commandAction(Command arg0, Item arg1) { 
		 
		getHomePage(); 
	} 
	 
	private void getHomePage(){ 
		 
	} 
 
}