Motorola的J2ME界面扩展——LWT介绍

MotorolaJ2ME界面扩展——LWT介绍

作者:陈跃峰

出自:http://blog.csdn.net/mailbomb

 

       LWT(Lightweight Window Toolkit)Motorola公司对MIDPjavax.microedition.lcdui界面包的一个扩展,可以在Motorola系列的手机中象使用MIDP界面一样来进行使用,解决了MIDP界面不能通过屏幕层次进行控制,以及无法实现个性化控件的问题(注:MIDP2.0通过使用game API控制屏幕层次,通过CustomItem来实现个性化的控件)

       LWT实现的目标:

l         LWT包实现小于30KB

l         运行高效

l         易扩展

l         MIDP兼容

l         单层次

LWT包中包含的类的继承结构图如下:

<group coordsize="8820,7176" id="_x0000_s1026" coordorigin="1440,6275" editas="canvas" style="WIDTH: 441pt; HEIGHT: 358.8pt; mso-position-horizontal-relative: char; mso-position-vertical-relative: line"><lock v:ext="edit" aspectratio="t"></lock><shapetype o:spt="75" coordsize="21600,21600" filled="f" stroked="f" id="_x0000_t75" path="m@4@5l@4@11@9@11@9@5xe" o:preferrelative="t"><stroke joinstyle="miter"></stroke><formulas><f eqn="if lineDrawn pixelLineWidth 0"></f><f eqn="sum @0 1 0"></f><f eqn="sum 0 0 @1"></f><f eqn="prod @2 1 2"></f><f eqn="prod @3 21600 pixelWidth"></f><f eqn="prod @3 21600 pixelHeight"></f><f eqn="sum @0 0 1"></f><f eqn="prod @6 1 2"></f><f eqn="prod @7 21600 pixelWidth"></f><f eqn="sum @8 21600 0"></f><f eqn="prod @7 21600 pixelHeight"></f><f eqn="sum @10 21600 0"></f></formulas><lock v:ext="edit" aspectratio="t"></lock></shapetype><shape id="_x0000_s1027" type="#_x0000_t75" o:preferrelative="f" style="LEFT: 1440px; WIDTH: 8820px; POSITION: absolute; TOP: 6275px; HEIGHT: 7176px"><fill o:detectmouseclick="t"></fill><lock text="t" v:ext="edit"></lock></shape><group coordsize="8460,6864" id="_x0000_s1028" coordorigin="1620,6275" style="LEFT: 1620px; WIDTH: 8460px; POSITION: absolute; TOP: 6275px; HEIGHT: 6864px"><textbox style="mso-next-textbox: #_x0000_s1029">

Object

</textbox><roundrect filled="f" id="_x0000_s1030" arcsize="10923f" style="LEFT: 1620px; WIDTH: 2160px; POSITION: absolute; TOP: 6587px; HEIGHT: 1093px"><textbox style="mso-next-textbox: #_x0000_s1030">

java.lang

 

</textbox></roundrect><textbox style="mso-next-textbox: #_x0000_s1031">

Graphics

</textbox><textbox style="mso-next-textbox: #_x0000_s1032">

Font

</textbox><textbox style="mso-next-textbox: #_x0000_s1033">

Image

</textbox><textbox style="mso-next-textbox: #_x0000_s1034">

Canvas

</textbox><roundrect filled="f" id="_x0000_s1035" arcsize="10923f" style="LEFT: 1620px; WIDTH: 2340px; POSITION: absolute; TOP: 8303px; HEIGHT: 4836px"><textbox style="mso-next-textbox: #_x0000_s1035">

javax.microedition.lcdui

</textbox></roundrect><textbox style="mso-next-textbox: #_x0000_s1036">

CheckboxGroup

</textbox><textbox style="mso-next-textbox: #_x0000_s1037">

Component

</textbox><textbox style="mso-next-textbox: #_x0000_s1038">

ComponentListener

</textbox><textbox>

TextComponent

</textbox><textbox>

InteractableComponent

</textbox><textbox>

ComponentScreen

</textbox><textbox>

Slider

</textbox><textbox>

TextField

</textbox><textbox>

TextArea

</textbox><textbox>

Checkbox

</textbox><textbox>

ImageLabel

</textbox><textbox>

Button

</textbox><roundrect filled="f" id="_x0000_s1063" arcsize="10923f" style="LEFT: 4320px; WIDTH: 5760px; POSITION: absolute; TOP: 6275px; HEIGHT: 6864px"><textbox>

com.motorola.lwt

</textbox></roundrect></group><wrap type="none"></wrap><anchorlock></anchorlock></group>

       使用LWT编程和一般的Java类类似,下面是一个简单的示例代码:

public class TestScreen extends ComponentScreen {

public DemoScreen() {

Command next = new Command("Next", Command.OK, 1);

Command prev = new Command("Previous", Command.BACK, 1);

addCommand(next);

addCommand(prev);

}

}

你可能感兴趣的:(编程,.net,F#,ext,Motorola)