C H A P T E R  4

ROMizing Skin Definitions

The Sun Java Wireless Client software provides AUIT (Chameleon) skin designers with the ability to make changes to an existing skin and then generate a new one, without needing to rebuild the full software product. This is done through the use of the make build target, run_skinromizer, and the resulting binary output file, skin.bin.

The process of generating an initial skin and then updating it occurs in several steps, some of which are automated by the Sun Java Wireless Client build process. To build a skin and then modify, follow these general steps:

1. The skin designer creates graphics for the skin and defines skin property settings in the skin.xml file. For more information, see the Sun Java Wireless Client Skin Author's Guide to Adaptive User Interface Technology.

2. The Sun Java Wireless Client software product is built. During this process, the skin.xml file is merged with other XML configuration files and processed by the Configurator tool. For more information on the Configurator Tool, see the Sun Java Wireless Client Porting Guide.

3. The SkinRomizationTool operates on the output generated by the Configurator Tool, to romize graphic images and create a binary output file of the skin.xml properties file, called skin.bin. The skin.bin file is written to the directory InstallDir/output/midp/lib (where output is the top-level directory you designate for the output of your build.)



Note - Images defined as "ROMized" in the skin.xml file are romized into C files, and the Sun Java Wireless Client software source files are built into a finished Java language binary executable. The only change to the build process from previous versions is output of the skin.bin file, which improves the skinning process.



4. Once the skin.bin file is generated, it exists as a binary file that can be installed onto a device, where it works seamlessly with the existing Java Wireless Client software binary executable.

Before installing skin.bin onto a device, the skin designer is able to modify the properties in the skin.xml file and generate a new binary skin.bin file as many times as needed, without rebuilding the full Java Wireless Client software each time.


SkinRomizationTool

Although not normally run manually from the command line, the parameters of the SkinRomizationTool can be modified in the makefiles to be used during the build process.

InstallDir/midp/src/tool/chameleon/classes/com/sun/midp/skinromization/

During the build process, the SkinRomizationTool is built into the SkinRomizationTool.jar file.

The SkinRomizationTool command-line options are as follows:

localXMLFile is the name of the XML file to be processed by SkinRomizationTool. During the build, it is the name of the merged XML file produced by the Configurator.

skinImagesDirName is the directory containing skin images. SkinRomizationTool looks in this directory for any images it needs to ROMize.

localOutputJavaFile is the name of the output Java programming language file generated by SkinRomizationTool.

localOutputCFile is the name of the output C file generated by SkinRomizationTool.

The -debug option prints some debugging information during the XML file processing.


run_skinromizer Build Target

Once the skin.bin binary file is created, the skin designer is able to make changes to the skin and redisplay it to check those changes. This gives the skin designer increased flexibility by reducing the overhead needed to view changes made to the skin.

Changes made to the graphics files themselves are not picked up by regenerating the skin.bin file if your image files are set to Romized=true in your platform's skin.xml file. If your graphic images are defined in the skin.xml file as Romized=false, a skin designer can easily change the look of a gauge from one with round corners to one with square corners. For example, the skin designer can simply replace the image file called by the gauge property GAUGE_IMAGE_BG and then regenerate the skin.bin file.

However, if graphic images are set to Romized=true, regenerating the skin.bin file will not pick up the change made to those graphic images. The new graphic images are displayed in the skin only after the Sun Java Wireless Client software has been rebuilt.

For more information on changing properties and working with the skin.xml file, and how to work effectively with ROMized and non-ROMized graphic images, see the Sun Java Wireless Client Skin Author's Guide to Adaptive User Interface Technology.

Generating the skin.bin File

To generate the skin.bin file, run the make command on the command line, using run_skinromizer as a target. For example, on a Linux command line in the bash shell, enter the following command:

$ make run_skinromizer

This generates the skin.bin file and writes it to the following directory

InstallDir/output/midp/lib

output is the top-level directory you designate for the output of your software build.



Note - The InstallDir/output directory is named by convention. You can name the output directory for your Java Wireless Client software build anything you choose.



To properly generate a new skin.bin file, your build platform must be properly configured and set up. The make run_skinromizer command also requires the use of additional build variables.

For a complete explanation of how to use the make run_skinromizer command to generate a new skin, see the Sun Java Wireless Client Skin Author's Guide to Adaptive User Interface Technology.