package org.j4me.ui;
import java.util.*;
import javax.microedition.lcdui.*;
import org.j4me.logging.*;
import com.demo.util.Properties;
/**
* The <code>DeviceScreen</code> class is a base class for any screen that needs complete
* control over how it is painted. It is based on and similar to the MIDP
* <code>Canvas</code> class.
* <p>
* This class removes the following methods from the MIDP <code>Canvas</code> class:
* <ul>
* <li><code>isDoubleBuffered</code> - This class is always double buffered.
* <li><code>hasPointerEvents</code> and <code>hasPointerMotionEvents</code> - There is
* no use for this method. Implement the pointer event methods and
* if the device has no pointer they will be ignored.
* <li> - Same reason as <code>hasPointerEvents</code>.
* <li><code>hasRepeatEvents</code> - This class always has key repeat events.
* <li><code>getKeyName</code> - The application should define the names to make them
* consistent across all devices.
* <li><code>getKeyCode</code> - The key code is passed into the key event methods.
* <li><code>getGameAction</code> - The game action is passed into the key event methods.
* <li><code>sizeChanged</code> - This method is notoriously buggy and applications
* should use <code>getWidth</code> and <code>getHeight</code> instead.
* <li><code>getTicker</code> and <code>setTicker</code> - The ticker functionality has
* not been implemented.
* <li><code>addCommand</code>, <code>removeCommand</code>, and <code>setCommandListener</code> -
* Menu options have been replaced with something that works across all
* MIDP 2.0 devices. There are left and right menu options. See
* <code>setMenuText</code> for details.
* </ul>
*
* @see javax.microedition.lcdui.Canvas
*/
public abstract class DeviceScreen
{
/**
* Constant for the <code>LEFT</code> game action.
*/
public static final int LEFT = -1 * javax.microedition.lcdui.Canvas.LEFT;
/**
* Constant for the <code>RIGHT</code> game action.
*/
public static final int RIGHT = -1 * javax.microedition.lcdui.Canvas.RIGHT;
/**
* Constant for the <code>UP</code> game action.
*/
public static final int UP = -1 * javax.microedition.lcdui.Canvas.UP;
/**
* Constant for the <code>DOWN</code> game action.
*/
public static final int DOWN = -1 * javax.microedition.lcdui.Canvas.DOWN;
/**
* Constant for the <code>FIRE</code> game action.
*/
public static final int FIRE = -1 * javax.microedition.lcdui.Canvas.FIRE;
/**
* Constant for the general purpose "A" game action.
*/
public static final int GAME_A = -1 * javax.microedition.lcdui.Canvas.GAME_A;
/**
* Constant for the general purpose "B" game action.
*/
public static final int GAME_B = -1 * javax.microedition.lcdui.Canvas.GAME_B;
/**
* Constant for the general purpose "C" game action.
*/
public static final int GAME_C = -1 * javax.microedition.lcdui.Canvas.GAME_C;
/**
* Constant for the general purpose "D" game action.
*/
public static final int GAME_D = -1 * javax.microedition.lcdui.Canvas.GAME_D;
/**
* <code>keyCode</code> for ITU-T key 0.
* <p>
* Constant value 48 is set to <code>KEY_NUM0</code>.
*/
public static final int KEY_NUM0 = javax.microedition.lcdui.Canvas.KEY_NUM0;
/**
* <code>keyCode</code> for ITU-T key 1.
* <p>
* Constant value 49 is set to <code>KEY_NUM1</code>.
*/
public static final int KEY_NUM1 = javax.microedition.lcdui.Canvas.KEY_NUM1;
/**
* <code>keyCode</code> for ITU-T key 2.
* <p>
* Constant value 50 is set to <code>KEY_NUM2</code>.
*/
public static final int KEY_NUM2 = javax.microedition.lcdui.Canvas.KEY_NUM2;
/**
* <code>keyCode</code> for ITU-T key 3.
* <p>
* Constant value 51 is set to <code>KEY_NUM3</code>.
*/
public static final int KEY_NUM3 = javax.microedition.lcdui.Canvas.KEY_NUM3;
/**
* <code>keyCode</code> for ITU-T key 4.
* <p>
* Constant value 52 is set to <code>KEY_NUM4</code>.
*/
public static final int KEY_NUM4 = javax.microedition.lcdui.Canvas.KEY_NUM4;
/**
* <code>keyCode</code> for ITU-T key 5.
* <p>
* Constant value 53 is set to <code>KEY_NUM5</code>.
*/
public static final int KEY_NUM5 = javax.microedition.lcdui.Canvas.KEY_NUM5;
/**
* <code>keyCode</code> for ITU-T key 6.
* <p>
* Constant value 54 is set to <code>KEY_NUM6</code>.
*/
public static final int KEY_NUM6 = javax.microedition.lcdui.Canvas.KEY_NUM6;
/**
* <code>keyCode</code> for ITU-T key 7.
* <p>
* Constant value 55 is set to <code>KEY_NUM7</code>.
*/
public static final int KEY_NUM7 = javax.microedition.lcdui.Canvas.KEY_NUM7;
/**
* <code>keyCode</code> for ITU-T key 8.
* <p>
* Constant value 56 is set to <code>KEY_NUM8</code>.
*/
public static final int KEY_NUM8 = javax.microedition.lcdui.Canvas.KEY_NUM8;
/**
* <code>keyCode</code> for ITU-T key 9.
* <p>
* Constant value 57 is set to <code>KEY_NUM9</code>.
*/
public static final int KEY_NUM9 = javax.microedition.lcdui.Canvas.KEY_NUM9;
/**
* <code>keyCode</code> for ITU-T key "pound" (#).
* <p>
* Constant value 35 is set to <code>KEY_POUND</code>.
*/
public static final int KEY_POUND = javax.microedition.lcdui.Canvas.KEY_POUND;
/**
* <code>keyCode</code> for ITU-T key "star" (*).
* <p>
* Constant value 42 is set to <code>KEY_STAR</code>.
*/
public static final int KEY_STAR = javax.microedition.lcdui.Canvas.KEY_STAR;
/**
* Constant for the left soft menu key found on MIDP 2.0 devices.
*/
public static final int MENU_LEFT = Properties.LEFT_CMD_KEYCODE;
/**
* Constant for the right soft menu key found on MIDP 2.0 devices.
*/
public static final int MENU_RIGHT = Properties.RIGHT_CMD_KEYCODE;
/**
* The actual <code>Canvas</code> object that controls the device's screen.
* This object wraps it.
*/
private final CanvasWrapper slave;
/**
* When <code>false</code> this class will paint the menu bar at the bottom
* of the screen. When <code>true</code> it will not.
*/
private boolean fullScreenMode = false;
/**
* What is written as a title bar for this canvas. When this is <code>null</code>
* no title bar will be written. To show the header without any text
* set this to the empty string "".
*/
private String title;
/**
* The text for the left menu button. This is the negative side used
* for canceling and going back to previous screens.
*/
private String leftMenu;
/**
* The text for the right menu button. This is the positive side used
* for accepting input, invoking menus, and moving forward in the
* application's state.
*/
private String rightMenu;
/**
* Implicitly called by derived classes to setup a new J4ME canvas.
*/
public DeviceScreen ()
{
// Create a wrapper around the canvas.
slave = new CanvasWrapper( this );
}
/**
* Returns the LCDUI <code>Canvas</code> wrapped by this screen. This is
* required for some APIs.
*
* @return The <code>javax.microedition.lcdui.Canvas</code> wrapped by this screen.
*/
public Canvas getCanvas ()
{
return slave;
}
/**
* Makes this object take over the device's screen.
* <p>
* The previous screen will have its <code>hideNotify</code> method called.
* Then this screen's <code>showNotify</code> method will be invoked followed
* by the <code>paint</code> method.
*/
public void show ()
{
// Set the wrapped canvas as the current screen.
UIManager.setScreen( this, slave );
}
/**
* Checks if this screen is actually visible on the display. In
* order for a screen to be visible, all of the following must be true:
* the MIDlet must be running in the foreground, the screen must be the
* current one, and the sc
没有合适的资源?快使用搜索试试~ 我知道了~
一个J2ME的手机客户端例子..包括发短信,上传图片,与服务器数据同步等.
共579个文件
class:294个
java:236个
png:24个
4星 · 超过85%的资源 需积分: 3 70 下载量 147 浏览量
2010-08-17
16:50:44
上传
评论 6
收藏 1.41MB RAR 举报
温馨提示
一个J2ME的手机客户端例子.. 包括发短信,上传图片,与服务器数据同步等. 使用J4ME作为界面插件..
资源推荐
资源详情
资源评论
收起资源包目录
一个J2ME的手机客户端例子..包括发短信,上传图片,与服务器数据同步等. (579个子文件)
Connectioner.java.bak 5KB
WebService.java.bak 3KB
Properties.java.bak 1KB
BluetoothGPS.class 14KB
Dialog.class 12KB
BluetoothGPS.class 12KB
Dialog.class 11KB
XmlParser.class 10KB
CanvasWrapper.class 9KB
XmlParser.class 9KB
JSR179LocationProvider.class 9KB
JSR179LocationProvider.class 8KB
Theme.class 8KB
CanvasWrapper.class 8KB
Theme.class 8KB
RmsUtil2.class 8KB
ProductsDialog.class 8KB
GuideProductsDialog.class 8KB
ProductsDialog.class 7KB
ProgressBar.class 7KB
GuideProductsDialog.class 7KB
RmsUtil2.class 7KB
ProgressBar.class 7KB
BluetoothDeviceDiscovery.class 6KB
TextBox.class 6KB
Node.class 6KB
Pedometer.class 6KB
DeviceScreen.class 6KB
Pedometer.class 6KB
Label.class 6KB
BluetoothDeviceDiscovery.class 6KB
DeviceScreen.class 6KB
TextBox.class 6KB
Connectioner.class 6KB
Element.class 6KB
NMEAParser.class 6KB
BluetoothLocationProvider.class 6KB
Node.class 6KB
Component.class 6KB
RadioButton.class 6KB
MenuOption.class 6KB
LoginDialog.class 6KB
Component.class 5KB
Element.class 5KB
Connectioner.class 5KB
SelectDialog.class 5KB
NMEAParser.class 5KB
BluetoothLocationProvider.class 5KB
RadioButton.class 5KB
MenuOption.class 5KB
LoginDialog.class 5KB
SelectDialog.class 5KB
RmsUserUtil.class 5KB
Label.class 5KB
cameraForm.class 5KB
cameraForm.class 5KB
LoginDialog$1.class 5KB
LoginDialog$2.class 4KB
RmsUserUtil.class 4KB
XmlWriter.class 4KB
SelectPTypeDialog.class 4KB
LoginDialog$1.class 4KB
Coordinates.class 4KB
StartTag.class 4KB
ProductCommandDialog.class 4KB
InitializingGPSAlert.class 4KB
LoginDialog$2.class 4KB
SelectPTypeDialog.class 4KB
cameratoForm.class 4KB
Log.class 4KB
cameratoForm.class 4KB
ProductCommandDialog.class 4KB
Coordinates.class 4KB
XmlWriter.class 4KB
InitializingGPSAlert.class 4KB
LogDemoScreen.class 4KB
LogDemoScreen.class 4KB
Log.class 4KB
FindingGPSDevicesAlert.class 4KB
CheckBox.class 4KB
StartTag.class 4KB
FindingGPSDevicesAlert.class 3KB
UIDemoMidlet.class 3KB
UIDemoMidlet.class 3KB
CheckBox.class 3KB
Stopwatch.class 3KB
MockLocationProvider.class 3KB
TreeNode.class 3KB
CriteriaSelectionScreen.class 3KB
Stopwatch.class 3KB
UpdatePwdDialog$1.class 3KB
AbstractXmlWriter.class 3KB
ParseEvent.class 3KB
Picture.class 3KB
CriteriaSelectionScreen.class 3KB
AbstractXmlParser.class 3KB
MockLocationProvider.class 3KB
Menu.class 3KB
LocationProvider.class 3KB
TreeNode.class 3KB
共 579 条
- 1
- 2
- 3
- 4
- 5
- 6
资源评论
- wangtaikun2013-05-08还不错,不过不太明白。有服务端更好
- Maxize2012-06-21为了要弄清楚一个东西。然后下载了。事实上也能帮我解决。
- ionlywantto2013-06-08代码有点简单
- alain732012-11-20谢谢分享,要有服务端的代码就更好
fenglam09
- 粉丝: 5
- 资源: 11
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功