Optimize with a SATA RAID Storage Solution
Range of capacities as low as $1250 per TB. Ideal if you currently rely on servers/disks/JBODs
Winamp -- an MP3 player by Nullsoft (see Resources for more info) -- is one application that uses skins. Nullsoft actively encourages skin development for Winamp, and, according to its Website, more than 5,000 skins are currently available. Games such as Quake III Arena use skins to allow players to select the characters who will represent them during play, and create entirely new characters. Skins even help you alter the look of your operating system desktop according to your whims.
Why should you use skins? Well, if you write applets, especially for the Internet, and cannot guarantee that your user base already has JDK 1.2 installed, or has access to broadband, there is significant overhead with downloading Swing. The same argument applies if you write a downloadable application, or one in which the application size may be an issue.
Another advantage to using skins is you can fit a pre-existing library of lightweight components into a dynamic (skin-based) model without too much pain. If you have ever worked with a designer, then you probably spent hours reworking your layouts to make a minor modification to the interface design. Use a skin, and the design can be altered in a few moments without the need to recompile. Better yet, skins allow you to hand over complete control of the interface layout to your designer.
There are also marketing considerations. Winamp might not have been as popular if more than 5,000 designs were not available for download. But skins' big selling point for me is the fact that after I brand an application for one company, I can rebrand it for another company, or for a shrink-wrapped version, quickly and easily.
Note: to download the complete source code for this article as a zip file or in tar.gz format, see Resources.
The specification of a basic customizable interface is relatively simple. You'll need:
ImageLabel(lightweight) component for noninteractive areas of the screen
ImageButton(lightweight) component for interactive areas of the screen
The following code samples define the most basic lightweight components -- the
ImageButton. Those who already have a library of lightweight components should skip ahead to the layout manager definition.
The following code implements the
ImageLabel lightweight component, rendering an image onto a supplied graphics context. Please note that a utility class --
Utils -- is used for loading images: