Sun Microsystems Computer Accessories manual Obtain and Enter Image Files

Page 20

Note – All directory names in this chapter refer to the installation directory of the J2ME Wireless Toolkit. (If you chose the default option at installation, the directory is C:\WTK21.)

1.Copy the directory wtklib\devices\DefaultColorPhone and its contents as wtklib\devices\NewPhone.

2.Rename the main device property file wtklib\devices\NewPhone\DefaultColorPhone.properties to wtklib\devices\NewPhone\NewPhone.properties.

Obtain and Enter Image Files

You need to provide image files for the new device. These image files should differ only in their representation of the active buttons. (Active buttons are those buttons used in the emulation of the device in the J2ME Wireless Toolkit.)

The image files are:

a default image file showing the active buttons in normal unpressed position

an image file showing the active buttons in a pressed position

an image file showing the active buttons highlighted and an indicator light to indicate that backlighting is turned on the device

an image of the network indicator icon in the enabled state

These images are used by the Emulator to show visual effects when the user moves the pointer over, or clicks on, a device button. The device backlight is turned when a MIDP API is being called or when communication over the network is taking place. An image file can be in JPEG, GIF, or PNG format.

1.Create the image files such that the size of the device's screen in each image is the same as the pixel size of the display on the real device.

For example, if the device has a screen of 96 pixels horizontally by 128 vertically, your images should have the same size as the screen.

2.Insert the new image files in the NewPhone directory in place of the following files, respectively:

wtklib\devices\NewPhone\ph1_neut.png wtklib\devices\NewPhone\ph1_press.png wtklib\devices\NewPhone\ph1_highlight.png wtklib\devices\NewPhone\indicator.png

3.Change the image file names in the following lines in NewPhone.properties, if they are different from the names already present.

default_image = ph1_neut.png

6 Wireless Toolkit Basic Customization Guide • December 2003

Image 20
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 Related Documentation Typographic ConventionsShell Prompts 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 Screen Background RGB Color Enter Color PropertiesRun the Emulator for the New Device Examining Device Property Files Device Property Files Fonts Used by the Midp APIs Main Device Property FileFonts Bitmap Fonts Default FontSystem 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 Display Area in Full Screen ModeTotal Screen Size Screen Pixel Ratio Screen Background ColorScreen Buffering Screen Border ColorTouch Screen Defining a Device Button Device ButtonsKeyboard Handler 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