MultipleStateIconLabel and IconState DTD and XML definitions

The MultipleStateIconLabel has many of the attributes of an IconLabel. It has the following entry in the DTD file:
Table 1. MultipleStateIconLabel definition
Line entry in the DTD file Description
<!ELEMENT MultipleStateIconLabel (IconState+)> A MultipleStateIconLabel contains one or more IconStates
<!ATTLIST MultipleStateIconLabel
    name CDATA #REQUIRED
    width CDATA "11"
    height CDATA "20"
    x CDATA #REQUIRED
    y CDATA #REQUIRED
    onInitialize CDATA #IMPLIED>
Attribute list
Table 2. MultipleStateIconLabel attributes
Attribute Description
name Name used by the Desktop to identify this component (mandatory). Applications can have access to this object at runtime by requesting it by name from the Desktop.
width Width of the label
height Height of the label
x Horizontal coordinate for the location of the label within its parent container (mandatory)
y Vertical coordinate for the location of the label within its parent container (mandatory)
onInitialize Java™ code to be executed when the component is initialized

The IconState has the following entry in the DTD file:

Table 3. IconState definition
Line entry in the DTD file Description
<!ELEMENT IconState EMPTY> An IconState does not contain any sub-elements
<!ATTLIST IconState
    name CDATA #REQUIRED
    icon CDATA #REQUIRED>
Attribute list
Table 4. IconState attributes
Attribute Description
name Status code associated with the icon (mandatory)
icon Name of the file containing the icon that is associated with the status code (mandatory)
The following is an example of an XML definition for a MultipleStateIconLabel with two IconStates:
<MultipleStateIconLabel name="TRAFFIC_LIGHT" 
    width="11" height="20" x="314" y="5">
  <IconState name="ON" icon="/green_traffic_light.gif" />
  <IconState name="OFF" icon="/red_traffic_light.gif"/>
</MultipleStateIconLabel>