Developers guide

64
/* Abbreviated SkinnedTextField API */
public class SkinnedTextField {
...
public SkinnedTextField() { ... }
public void setSkin(TextSkin newSkin) { ... }
public void setSkinMode(boolean mode) { ... }
public synchronized void setText(String newText) { ... }
public void getText() { ... }
...
}
Figure 8-1 SkinnedTextField API
8.4 TextSkin
The TextSkin Object, used by the SkinnedTextField has a very straightforward API.
SkinnedTextFiled simply asks its current TextSkin object for an image to use to display a certain
character. This is implemented in the getImageIcon(char character) function which is
guaranteed to return a value. Default images are provided by TextSkin, as discussed in more
detail in 8.4.2.
The API for the TextSkin is shown in Figure 8-2.
/* TextSkin API */
public class TextSkin {
...
public static final TextSkin defaultSkin = new TextSkin();
/* return the image to display character */
public ImageIcon getImageIcon(char character) {...}
public static TextSkin loadSkinFromZip(File skinZipFile) {...}
public String toString() {...}
public String getName() {...}
...
}
Figure 8-2 TextSkin API
8.4.1 Skin loading
Skins are loaded using private constructors accessed through loadSkinFromZip(File
skinZipFile). In most cases Skins are statically loaded by the SkinnedTextFieldManager when
it is first referenced.
The majority of images for the skins, obtained from Digit Mania[ 36], unfortunately only provide
images for digits. This is inadequate for the APT as RA and Dec displays require additional
characters such as :’ and ‘+’ to be supported.