Sun Microsystems Computer Accessories manual Emulating Abstract Command Button Assignments

Page 48

TABLE 3 Abstract Command Types in Order of Precedence

Command Type

Description

 

 

OK

Standard positive answer to a dialog implemented by current

 

screen

SCREEN

Specifies an application-defined command that pertains to the

 

current screen, for example, "Load" and "Save"

ITEM

The command is specific to a particular item on the screen

HELP

Request for on-line help

 

 

The MIDP implementation in the Wireless Toolkit allocates a command issued by the application to a device button based on the following considerations:

1.The first consideration is the natural correspondence between the command’s type and a input signal such as a button press. For example, if the BACK command type is usually associated with the left soft button, then the implementation first tries to assign it there. If there is no such preferred button for a command type, this consideration is not relevant.

2.The secondary consideration is assignment of the remaining commands that could not be assigned to their preferred buttons. The command precedence and the command priority are used to assign these commands to alternate buttons or to a command menu.

The J2ME Wireless Toolkit allows a variety of abstract command mapping policies to be implemented. An emulated device can use a combination of soft buttons and dedicated command buttons to implement abstract commands, or it can have none of these and just present all abstract commands to the user in an on-screen menu. The J2ME Wireless Toolkit includes examples of different configurations (see the Wireless Toolkit User’s Guide).

Note – The mapping policy for abstract commands can vary across actual devices. For example, command type precedence may differ.

Emulating Abstract Command Button Assignments

The Emulator provides the device property file definitions

command.keys.<command_type> and command.menu.<action> to emulate the way a MIDP implementation on the corresponding real device assigns abstract commands to buttons and menus.

You specify the button assignments following the considerations specified at the end of the previous section:

1.Use the definitions command.menu.activate and command.menu.<action> to assign the menu operations to buttons. See “The Abstract Command Menu” on page 37.

34 Wireless Toolkit Basic Customization Guide • December 2003

Image 48
Contents Basic Customization Guide Please Contents Examining Device Property Files Default Emulator Device Property Files Vi Wireless Toolkit Basic Customization Guide December Figures Viii Wireless Toolkit Basic Customization Guide December Tables Wireless Toolkit Basic Customization Guide December Who Should Use This Book How This Book Is OrganizedUsing Operating System Commands Typographic Conventions Shell PromptsRelated Documentation Accessing Sun Documentation Online Sun Welcomes Your CommentsCustomizing the Wireless Toolkit How to Customize the Wireless ToolkitDevice Property Files and the Default Emulator Customization StepsCustomizing the Wireless Toolkit Wireless Toolkit Basic Customization Guide December Creating Device Property Files Make a Copy of an Existing Main Device Property FileObtain and Enter Image Files Obtain and Enter the Screen Properties Screen LocationTotal Screen Size Display AreaDisplay Area in Full Screen Mode Specifying Screen PropertiesObtain and Enter the Button Properties By measuring the image file, obtain the button propertiesHeight Width Obtain and Enter Soft Button Label Areas Soft button label display is defined by a line of the form Obtain and Enter Icon Properties Defining the Icon Location and StatesEnter the following measured values for the icons properties Enter Color Properties Run the Emulator for the New DeviceScreen Background RGB Color Examining Device Property Files Device Property Files Main Device Property File FontsFonts Used by the Midp APIs Default Font System FontsBitmap Fonts Ascii character Distance to character Font Underlining Device ImageImage without Buttons Pressed Image with Buttons PressedImage with Buttons Highlighted and Backlight On ScalingScreen Properties Screen Location Display Area in Full Screen Mode Total Screen SizeDisplay Area Screen Pixel Ratio Screen Background ColorScreen Border Color Touch ScreenScreen Buffering Device Buttons Keyboard HandlerDefining a Device Button Button.LEFT = 13, 197, 20 Assigning a PC Keyboard Key to a Button Assigning a Game Action to a Button Specifying the Characters Generated by a Button PressAssigning Abstract Commands to Buttons Abstract Command Types in Order of PrecedenceEmulating Abstract Command Button Assignments Precedence of Assigning Commands to a Button Secondary Button Assignments Abstract Command Menu Displayed Icons Defining the Icon Location and StatesSoft Button Label Display Soft Button Labels on the Emulated Device DisplayColor Sound AlertsDevice Software Capabilities Alert Type ValuesLocales Character EncodingsEnableAlphaChannel false Transparent ImagesWireless Toolkit Basic Customization Guide December Default Emulator Device Property Files Property FilesDefaultGrayPhone.properties Appendix a Default Emulator Device Property Files Wireless Toolkit Basic Customization Guide December Appendix a Default Emulator Device Property Files Wireless Toolkit Basic Customization Guide December # alert.alerttype.sound soundfile Wireless Toolkit Basic Customization Guide December Device Image Files Icon Image FilesIcon Image Files Support for ByteCode Obfuscators Adding a ByteCode ObfuscatorExample Appendix B Support for ByteCode Obfuscators Wireless Toolkit Basic Customization Guide December P E N D I X C Wireless Toolkit Basic Customization Guide December Index Keyboard.handler property Device property files, 1 WMA messages, customizing Wireless Toolkit Basic Customization Guide December