Sun Microsystems, Inc.4159 Network CircleSanta Clara, CA 95054U.S.A. 650-960-1300Basic Customization GuideWireless Toolkit, Version 2.1JavaTM2 Platfor
x Wireless Toolkit Basic Customization Guide • December 2003
xiPrefaceThe Java™2 Platform, Micro Edition, Wireless Toolkit Basic Customization Guidedescribes how to customize the J2ME™Wireless Toolkit by modifyi
xii Wireless Toolkit Basic Customization Guide • December 2003screen properties, button properties, soft button label areas, and icon properties.The t
Preface xiiiTypographic ConventionsShell PromptsRelated DocumentationTypeface Meaning ExamplesAaBbCc123 The names of commands, files,and directories;
xiv Wireless Toolkit Basic Customization Guide • December 2003Accessing Sun Documentation OnlineThe Java Developer ConnectionSMweb site enables you to
1CHAPTER1Customizing the Wireless ToolkitThe JavaTM2 Platform, Micro Edition Wireless Toolkit (J2METMWireless Toolkit)provides an emulation environmen
2 Wireless Toolkit Basic Customization Guide • December 2003Customization StepsYou customize the J2ME Wireless Toolkit for a new device in three simpl
Chapter 1 Customizing the Wireless Toolkit 3For example, suppose the J2ME Wireless Toolkit is installed in the directoryC:\WTK21. Then, the Main Devic
4 Wireless Toolkit Basic Customization Guide • December 2003
5CHAPTER2Creating Device Property FilesThis chapter presents a simple tutorial that walks you through the procedures forcreating a device property fil
PleaseCopyright © 2003 Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, California 95054, U.S.A. All rights reserved.Sun Microsystems, Inc. h
6 Wireless Toolkit Basic Customization Guide • December 2003Note – All directory names in this chapter refer to the installation directory of theJ2ME
Chapter 2 Creating Device Property Files 7pressed_buttons_image = ph1_press.pnghighlighted_image = ph1_highlight.png4. Change the indicator image loca
8 Wireless Toolkit Basic Customization Guide • December 2003Total Screen SizeReferring to the left image in FIGURE 1, you specify the total screen siz
Chapter 2 Creating Device Property Files 9FIGURE 1 Specifying Screen PropertiesDisplay Area in Full Screen ModeThe MIDP 2.0 specification allows appli
10 Wireless Toolkit Basic Customization Guide • December 2003 Bottom right coordinate - the bottom right coordinate of the screen area:(screen.x+scre
Chapter 2 Creating Device Property Files 11FIGURE 2 Specifying a Button Location2. Enter the following measured values for the button properties inNew
12 Wireless Toolkit Basic Customization Guide • December 2003button.7 = 21, 384, 41, 22button.8 = 65, 384, 41, 22button.9 = 111, 384, 41, 22button.POU
Chapter 2 Creating Device Property Files 13FIGURE 3 Soft Button Label Areas on the Emulated Device DisplayA soft button label display is defined by a
14 Wireless Toolkit Basic Customization Guide • December 2003softbutton.0=1,112,40,16, softButton, leftsoftbutton.1=56,112,40,16, softButton, rightObt
Chapter 2 Creating Device Property Files 15icon.<name> = <x_location>,<y_location>,<initial_state>The icon states are defined
Contents iiiContentsPreface xi1. Customizing the Wireless Toolkit 1How to Customize the Wireless Toolkit 1Customization Steps 2Device Property Files a
16 Wireless Toolkit Basic Customization Guide • December 2003Enter Color PropertiesTwo properties are provided to control the color in the Emulator:
17CHAPTER3Examining Device Property FilesThis chapter explains in detail the structure and content of device property files foran emulated device.The
18 Wireless Toolkit Basic Customization Guide • December 2003Device Property FilesThe device property files consist of a set of files that define the
Chapter 3 Examining Device Property Files 19Main Device Property FileThis section describes the device property file that the Default Emulator uses to
20 Wireless Toolkit Basic Customization Guide • December 2003The font definition is according to the format for describing a system font (see“System F
Chapter 3 Examining Device Property Files 21Examplefont.softButton = bitmap_font.propertiesfont.system.bold.medium = bold_font.propertiesA font proper
22 Wireless Toolkit Basic Customization Guide • December 2003..ascii_x-254 = 1149ascii_x-255 = 1154ascii_x-256 = 1160Note – This type of font supports
Chapter 3 Examining Device Property Files 23 An image with all the active buttons pressed—to show a button being pressedwhen the user selects it An
24 Wireless Toolkit Basic Customization Guide • December 2003Screen PropertiesIn this section you specify the properties of the image of the device sc
Chapter 3 Examining Device Property Files 25FIGURE 5 Specifying Screen PropertiesScreen LocationReferring to the left image in FIGURE 5, you specify t
iv Wireless Toolkit Basic Customization Guide • December 20033. Examining Device Property Files 17Device Property Files 18Main Device Property File 19
26 Wireless Toolkit Basic Customization Guide • December 2003screen.x = <horizontal distance in pixels>screen.y = <vertical distance in pixel
Chapter 3 Examining Device Property Files 27Referring to the right image in FIGURE 5, the full screen display area is defined asthe upper left coordin
28 Wireless Toolkit Basic Customization Guide • December 2003Screen Border ColorYou have the option of setting the color of the icon area, the softbut
Chapter 3 Examining Device Property Files 29Device ButtonsThis section describes how to define a button on an emulated device and alsodescribes the as
30 Wireless Toolkit Basic Customization Guide • December 2003 x: The x-coordinate of the left edge of the button image, in pixels relative to theleft
Chapter 3 Examining Device Property Files 31FIGURE 6 Specifying a Button LocationAssigning a PC Keyboard Key to a ButtonYou can assign a key on the PC
32 Wireless Toolkit Basic Customization Guide • December 2003Note – Virtual key codes are defined by the Abstract Window Toolkit in Java 2Standard Edi
Chapter 3 Examining Device Property Files 33There are two ways you can do a button press at the same time as pressing Shift orAlt: Map the buttons to
34 Wireless Toolkit Basic Customization Guide • December 2003The MIDP implementation in the Wireless Toolkit allocates a command issued bythe applicat
Chapter 3 Examining Device Property Files 352. Use the definition command.keys.<command_type> to assign command types topreferred buttons accord
Contents vAssigning Abstract Commands to Buttons 33Displayed Icons 38Defining the Icon Location and States 38Soft Button Label Display 39Color 40Sound
36 Wireless Toolkit Basic Customization Guide • December 2003command.keys.BACK = SOFT1command.keys.EXIT = SOFT1command.keys.CANCEL = SOFT1command.keys
Chapter 3 Examining Device Property Files 37The Abstract Command MenuWhen there are more abstract commands specified by an application than there areb
38 Wireless Toolkit Basic Customization Guide • December 2003Displayed IconsAn icon in the context of the Emulator is any graphic, constant or variabl
Chapter 3 Examining Device Property Files 39icon.reception: 0, 0, onicon.reception.on: reception.gificon.battery: 80, 0, fullicon.battery.full: batt_3
40 Wireless Toolkit Basic Customization Guide • December 2003softbutton.<number> = <x>,<y>,<width>,<height>,<font>
Chapter 3 Examining Device Property Files 41alert.<alert_type>.sound = <sound_file>where the possible values of <alert_type> are as
42 Wireless Toolkit Basic Customization Guide • December 2003LocalesA locale is a geographic or political region or community that shares the samelang
Chapter 3 Examining Device Property Files 43microedition.encoding: UTF-8microedition.encoding.supported: UTF-8, UTF-16, ISO-8859-1,ISO-8859-2, Shift_J
44 Wireless Toolkit Basic Customization Guide • December 2003
45APPENDIXADefault Emulator DeviceProperty FilesThis appendix presents a list of the device property files provided with the DefaultEmulator and infor
vi Wireless Toolkit Basic Customization Guide • December 2003
46 Wireless Toolkit Basic Customization Guide • December 2003DefaultGrayPhone.propertiesdefault_image=..\Share\ph1_neut.pngpressed_buttons_image=..\Sh
Appendix A Default Emulator Device Property Files 47screenPixelRatio.x = 1screenPixelRatio.y = 1# Touchscreen support ###############touch_screen=fals
48 Wireless Toolkit Basic Customization Guide • December 2003button.SELECT = 97, 370, 50, 28button.DOWN = 97, 398, 50, 22button.CLEAR = 92, 426, 58, 3
Appendix A Default Emulator Device Property Files 49# <face> is one of# system, monospace, proportional## <style> is one of# plain, bold,
50 Wireless Toolkit Basic Customization Guide • December 2003font.monospace.italic.large: Monospaced-italic-14font.monospace.bold.italic.small: Monosp
Appendix A Default Emulator Device Property Files 51icon.down.on: ..\Share\down.gificon.left: 78, 194, officon.left.off:icon.left.on: ..\Share\left.gi
52 Wireless Toolkit Basic Customization Guide • December 2003alert.error.sound: ..\Share\mid_err.wavalert.confirmation.sound: ..\Share\mid_confirm.wav
Appendix A Default Emulator Device Property Files 53Device Image FilesFIGURE 8 Images of Device Key Press StatesIcon Image FilesThe following table li
54 Wireless Toolkit Basic Customization Guide • December 2003internet.gifreception.gifright.gifleft.gifsym.gifkana.gifhira.gifABC.gifabc_lower.gif123.
55APPENDIXBSupport for ByteCode ObfuscatorsThe Wireless Toolkit contains a support framework for bytecode obfuscators. It alsoincludes a plug-in for t
viiFiguresFIGURE 1 Specifying Screen Properties 9FIGURE 2 Specifying a Button Location 11FIGURE 3 Soft Button Label Areas on the Emulated Device Displ
56 Wireless Toolkit Basic Customization Guide • December 2003 run(File jarFileObfuscated, String wtkBinDir,String wtkLibDir, String jarFilename, Stri
Appendix B Support for ByteCode Obfuscators 57You can get the proguard.jar file by downloading the .zip file fromhttp://proguard.sourceforge.net/ and
58 Wireless Toolkit Basic Customization Guide • December 2003
59APPENDIXCConnecting to the Wireless Toolkit’sWMA Emulation EnvironmentThe J2ME Wireless Toolkit supports the Wireless Messaging API (WMA), whichenab
60 Wireless Toolkit Basic Customization Guide • December 2003
61IndexAabstract command typesassigning to a button, 35abstract commandsassigning to buttons, 33menu operations, 37table of, 33abstract commands, type
62 Wireless Toolkit Basic Customization Guide • December 2003font_image property, 21Ggame actions, mapping to buttons, 32generated characters, assigni
Index 63device property files, 1WMA messages, customizing, 59
64 Wireless Toolkit Basic Customization Guide • December 2003
viii Wireless Toolkit Basic Customization Guide • December 2003
ixTablesTABLE 1 Example of Device Property Files and DefaultGrayPhone Property File 18TABLE 2 Button Names Available 29TABLE 3 Abstract Command Types
Commentaires sur ces manuels