Sun Microsystems Computer Accessories Displayed Icons, Defining the Icon Location and States

Page 52

Displayed Icons

An icon in the context of the Emulator is any graphic, constant or variable, that is displayed on the device screen global region (the region that is outside of the drawable area). This includes scrolling indicators, the battery level indicator and any other images of a similar type.

An icon is defined by:

A name. This name must be known to the Java code that uses the icon. For example, the code to implement scrolling indicators looks for icons named “up” and “down”.

A screen location. This is a coordinate pair giving the location of the top left corner of the icon, in pixels relative to the top left corner of the screen area of the device's image.

A default state. The icon is initially in this state.

A mapping of state names to image files. An icon can have any number of named states, as long as it has a line in the property file for each state giving the image associated with that state. If no image file is given for a particular state then no image is displayed when the icon is in that state.

Defining the Icon Location and States

The screen location and initial state of the icon is defined by a line of the form:

icon.<name> = <x location>,<y location>,<initial state>

The icon states are defined by lines of the form:

icon.<name>.<state #1> = <state #1 image_filename>

..

icon.<name>.<state #n> = <state #n image_filename>

If an icon does not have an image for a particular state, only the name of the icon need be given, and the image field can be left blank.

Image files can be in GIF, PNG, or JPEG format.

For example:

icon.up: 44, 110, off icon.up.off: icon.up.on: up.gif

icon.down: 44, 118, off icon.down.off: icon.down.on: down.gif

icon.internet: 64, 0, off icon.internet.off: icon.internet.on: internet.gif

38 Wireless Toolkit Basic Customization Guide • December 2003

Image 52
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 Shell Prompts Typographic ConventionsRelated 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 Run the Emulator for the New Device Enter Color PropertiesScreen Background RGB Color Examining Device Property Files Device Property Files Fonts Main Device Property FileFonts Used by the Midp APIs System Fonts Default FontBitmap 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 Total Screen Size Display Area in Full Screen ModeDisplay Area Screen Pixel Ratio Screen Background ColorTouch Screen Screen Border ColorScreen Buffering Keyboard Handler Device ButtonsDefining 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