"Java mobilePDA programming entry" reading note 2

xiaoxiao2021-03-06  14

LCDUI (LIMITED Configuration Device UI) No AWT / SWING: The mobile device is slow, the memory is small; there is no mouse, just touch the screen and simple buttons; the screen is small, no overlapping window; the message processing mechanism load is too heavy.

The LCDUI advanced API (Screen subclass) has portability, low control of the picture, and the properties of the components are determined by the system. LCDUI Less API (subclass of Canvas and Graphics class) has full control over the screen of the entire phone. Both can be mixed in the same MIDET.

Displayable Abstract Class: Javax.microedition.lcdui.displayable Subclass can be divided into two categories: Canvas and Screen. Canvas belongs to the low-level graphical user interface component, and Screen belongs to the advanced graphical user interface component. At the same time, you can only appear on the screen by a subclass of a single Canvas or Screen class. When setCurrent () is called, the previous screen is replaced, so save the current picture yourself.

Event Processing: In MIDP, as long as the underlying detection has an event, the system will call a specific method (callback function) in the fixed interface, and transmit it to it specific parameters.

And user interface related callback functions: 1 When using the lower API via Abstract Command (Javax.microedition.lcDui.command 2, if the button on the machine is pressed or the touch screen is touched, the corresponding event is called. That is to use the javax.microedition.lcdui.canvas class. 3 When the screen is redrawged, a redraw event is generated. At this point, the Paint () of the Canvas class is called and passed into a reference to a Graphics object. 4 When calling the CallSerially () method of the Display class, it is incorporated into a class that implements the runnable interface, where Run () will be called.

Command class Displayable object defines the constructor of the three parameters of the address () / removecommand () method: Command C1 = New Command ("back_1", command.back, 1); Constructor of the four parameters of the COMMAND class: Command C1 = New Command (short command, long command, type, priority); take the corresponding value: getLabel () getlonglabel () getcommandtype () getPriority () eight types: Back Cancel Exit Help item Ok Screen Stop does not Set to a certain type with the function of "name".

CommandListener: Event Processing Interface Delegation Model SetCommandListener () Registered Event Processing Function. CommandAction () is called, when the registration event is generated.

Ticker class runhouse light. DISPLAYABLE subclasses can join Ticker. SetTicker () / getticker ().

Title settitle () / gettitle ().

转载请注明原文地址:https://www.9cbs.com/read-49341.html

New Post(0)