morphis logo morphis | wax   
wax manual
wax manual
 

Overview

Architecture

Structure
   Documents
   Navigation
   Forms
   Animation

Devices
   device.xml

DIS
   wax syntax
   text selection
   image selection
   text and image xml

Application
   Configuration
   Servlet
   Filters

DIS Image Selection

In order to match a logical image as defined in <wax:img srcid="logical-image-id"/> to a physical image on disk, a default set of image filename rules are applied to all images on disk. These rules are based on a regular expression which is built during execution.

Keep in mind that images are not required to follow this convention. In order to match a logical image name to a physical name falling outside this naming convention, an entry to the appname.images.xml file should be created. In this case, the framework will apply application specific rules, and if no image is found, apply the default image filenaming convention rules listed below.

DEFAULT RULES: (listed in order of application)

1. LOGICAL-ID RULE
Image filenames matching the default rules MUST START with the logical id. So an image defined in WAX as <wax:img srcid="foo"/> will match images on disk which start with "foo", such as "foo.bmp" and "foo.gif" (see the EXTENSION rule below).
2. GROUP-ID RULE:
Image filenames matching the default rules MAY CONTAIN the device-id or a group-id of a connecting device defined as either the device-id or group-id prepended with "_G". Filenames containing a device-id will take precedence over filenames containing a group-id. Filenames containing either a device-id or group-id will take precedence over images which do not contain either of these elements. In other words, files matching this rule take precedence of files matching ONLY the LOGICAL-ID rule. So, if a device connects to the framework and is identified as a Nokia 7110 (with device-id of nok-7110 and groups of wml, and allow-images), this rule will match "foo_Gnok-7110.wbmp", "foo_Gwml.jpg" and "foo_Gallow-images.gif".
3. LANGUAGE RULE:
Image filenames matching the default rules MAY CONTAIN a language identifier defined as the 2 letter language identifier (as defined in ISO-639) prepended with "_L". This rule will match if the "lang" attribute is set to the same string as the language identifier. It is the application's responsibility to set the "lang" attribute - and there are many ways this can happen (see spec on multi-language support). Filenames matching the LANGUAGE rule will take less precedence over the GROUP-ID rule, but more precedence over filenames matching just the LOGICAL-ID rule. So, images named "foo_Len.bmp" will match this rule ONLY. This rule can be combined with the GROUP-ID rule.
4. CHUNK RULE:
Logical images may match multiple physical images which will be "chunked" together one on top of another when displayed on the target device. Chunked images should have a number prepended with an uderscore. Images which are chunked will always take precendence over images which are not chunked. Therefore, "foo_01.bmp" will take precedence over "foo.bmp".
5. IMAGE EXTENSION RULE:
Each device has a preferred set of extensions in the order of ascending precedence. For example, the Nokia 7110 only allows ".wbmp" extensions, while the Motorola P7389 will accept images ending in ".bmp" and ".wbmp". The IMAGE EXTENSION rule is REQUIRED, and must be at the end of the filename.

morphis SourceForge Logo