📄 streamingdemo.java
字号:
/*///////////////////////////////////////////////////////////////////////////////
//文档生成日期:2006.3.28
//
//(1)概述:
//类名称:StreamingDemo
//类说明:
// 提供主界面
//所在子系统:StreamingDemo
//
//系统总描述:
用两个Player交替播放从网络上下载的流媒体。
上面的代码可以从
http://www.cnblogs.com/Files/zhengyun_ustc/StreamingDemo.rar
下载;
安装的jar包从
http://www.cnblogs.com/Files/zhengyun_ustc/StreamingDemo-deployed.rar下载。
本文属于讨论稿,提供的仅仅是建议和测试意见。
本文还可以从
http://www.cnblogs.com/zhengyun_ustc/archive/2006/3/28/StreamingDemo.html 得到最新稿。
//(2)历史记录:
//创建人: 郑昀(2006.3.28)
//修改历史:
//联系我: Google Talk >> zhengyun@gmail.com
//Blogs: http://blog.csdn.net/zhengyun_ustc/以及http://www.cnblogs.com/zhengyun_ustc
//(3)版权声明:
//我这个版本j2me客户端代码仅仅允许您借鉴,但不得用于商业用途,除非得到郑昀本人的授权。本人保留所有权利。
////////////////////////////////////////////////////////////////////*/
package com.ultrapower.midlet;
import javax.microedition.lcdui.Alert;
import javax.microedition.lcdui.AlertType;
import javax.microedition.lcdui.Display;
import javax.microedition.lcdui.Displayable;
import javax.microedition.midlet.MIDlet;
import javax.microedition.midlet.MIDletStateChangeException;
import com.ultrapower.control.GUIController;
/**********************************************************
//StreamingDemo
//
//Class Description:
// 实际上应该算作MVC中的View部分,是MIDlet的主界面。
//Author:
// zhengyun@ultrapower 2006.3.28
//
**********************************************************/
public class StreamingDemo extends MIDlet{
private Display display;
public static GUIController controller;
public StreamingDemo() {
super();
display = Display.getDisplay(this);
}
/* (non-Javadoc)
* @see javax.microedition.midlet.MIDlet#startApp()
*/
protected void startApp()
throws MIDletStateChangeException{
try
{
controller = new GUIController(this);
controller.init();
}
catch(Exception exc)
{
setCurrent(
new Alert(
"初始化错误",
"错误原因为:"
+ exc.getMessage() + "/" + exc.getClass(),
null, AlertType.ERROR));
}
}
/* (non-Javadoc)
* @see javax.microedition.midlet.MIDlet#pauseApp()
*/
protected void pauseApp() {
this.notifyPaused();
}
/* (non-Javadoc)
* @see javax.microedition.midlet.MIDlet#destroyApp(boolean)
*/
protected void destroyApp(boolean arg0) throws MIDletStateChangeException {
controller = null;
}
/**********************************************************
// setCurrent()
//
// Description:
// 设置当前显示的界面
//
// Parameters:
// Return Values:
// Author:
// zhengyun@ultrapower
//
**********************************************************/
public void setCurrent(Displayable disp){
display.setCurrent(disp);
}
public void setCurrent(Alert alert, Displayable disp){
display.setCurrent(alert, disp);
}
public Displayable getCurrent(){
return display.getCurrent();
}
/**********************************************************
// getCurrentDisplay()
//
// Description:
// 获取当前的Display,这样可以让其他类能够控制要显示什么
//
// Parameters:
// Return Values:
// Author:
// zhengyun@ultrapower
//
**********************************************************/
public Display getCurrentDisplay(){
return display;
}
public void exit(boolean arg0){
try{
destroyApp(arg0);
notifyDestroyed();
}catch(MIDletStateChangeException e){
//
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -