Developers guide

65
In order to support skins downloaded from [ 36], as well as those I have extended to include
additional characters, Skins are loaded by matching only those that are discovered in the zip file.
8.4.2 TextSkin zip format
TextSkins can be loaded from any zip file containing a collection of gif images complying with
the naming conventions detailed below:
All files must be in the root path of the zip file.
Zip files must be named using <SkinName>.zip
Each image in the zip file must be of the form
<IdentStr><SkinName>.gif
where icon<IdentStr> is variable name within TextSkin.java
These <IdentStr> are NOT case sensitive, this is a weakness due to
Java's ZipFile implementation not distinguishing case.
As each file within the zip file is processed, it's name is identified and it is then matched to a
variable within the TextSkin object using the Java Reflection API.
This allows TextSkin zip files to support any number of characters. As a minimum, a TextSkin should
provide a default<SkinName>.gif which will be returned by getImageIcon(char
character) when the correct image is not supplied. If default<SkinName>.gif is not
supplied, a global default image will be returned. As the global default image is likely to be of a
different size and appearance to the current skin, it is likely to produce a non uniform output.
A sample listing of a <SkinName>.zip file is shown in Appendix F.4.1.
8.5 SkinnedTextFieldDemo
This is a simple application designed both to test the features of the SkinnedTextField framework
and provide example code to guide other developers wishing to include SkinnedTextField in their
applications.
It contains two SkinnedTextFields, the first displays the text from the JTextField above it, while the
second shows the currentTimeMillis()
i
updated approximately every 100ms.
i
This is the number of miliseconds since 12am, Jan 1 1970