10.10 New for MIDP 2.0
 | We have marked a number of topics in this chapter as New! with an icon in the book margin. Here is a summary of the most important new high-level user interface features of MIDP 2.0 described in this chapter. |
Classes TextBox and TextField have been improved to better control the display and input behavior by:
adding the ability to set a hint for the initial input character set from an extensible set of Unicode subsets (see the setInitialInputMode method), adding a constraint to restrict the input of decimal numbers, including decimal point fraction digits (see the setConstraints method with the DECIMAL constraint), adding constraint modifiers PASSWORD, SENSITIVE, and NON_PREDICTIVE that restrict how the values are displayed or cached (see the setConstraints method), and adding constraint modifier hints to indicate that the first letter or each word or sentence should be capitalized (see the setConstraints method).
The functionality of the Form and Item classes has been significantly enhanced, as follows:
There are more directives to specify the layout of each Item relative to the previous and successive Item. The options include positioning left, right, center, top, vcenter, and bottom; vertical and horizontal expansion and shrinking; and the control of line breaks (see the getLayout and setLayout methods). Spacer functionality has been added to provide a way to create empty spaces in the Form layout (see the Spacer class). New appearance modes plain, button, or hyperlink are available for StringItems and ImageItems. Commands can be added and removed from individual Items (see the addCommand and removeCommand methods). Interface ItemCommandListener can be used for defining context-sensitive command actions for Items (see the setItemCommandListener method). Default command can be defined for each Item (see the setDefaultCommand method). It is possible for a particular Item in a Form to be made current and brought into view of the user (see the Display.setCurrentItem method). There is an ability to delete all of the Items in a Form using a single method call (see the deleteAll method). Customized, application-specific Item types can be defined using the new class CustomItem.
Strings and StringItems displayed in Forms have been enhanced to allow:
appearance modes for Strings to be plain, button, or hyperlink (see the constructor and getAppearanceMode methods), and the setting and getting of the Font for a String (see the setFont and getFont methods).
Images and ImageItems used in Forms now allow:
appearance modes for Images to be plain, button, or hyperlink (see the constructor and getAppearanceMode methods), and Images used in Forms to be mutable (see the constructor and setImage methods).
The Gauge class has been enhanced with explicit support for busy indicators to support:
continuous visual effects being automatically updated by the system, and incremental visual effects by being updated by the application (see the setValue and setMaxValue methods).
Class ChoiceGroup and interface Choice have been updated with the addition of:
a pop-up mode that is similar to exclusive choice except that the visual presentation shows the selected element and the list pops up only to select another element (see the constructor), the ability to set and get the Font of each element (see the setFont and getFont methods), and the ability to delete all of the elements in the ChoiceGroup with a single method (see the deleteAll method).
 |