AntiAliasingApplet - Project Description

Overview
By its nature, this applet makes extensive use of images. Fortunately, Java's Image class is fairly versatile and provides many useful ways of accomplishing things. This functionality, along with the built-in web-oriented classes (like the URL class), avoided much of the pain that would have been involved with writing a similar applet in a different language. Rather than having to devote a lot of time to mundane tasks like writing GIF and JPEG decoding routines, I was able to spend more time developing and testing the applet.

Areas of Interest
Any image can be used as the original image - The applet allows users to specify the URL of any image on the web - it will download and display the user's favorite image. Unfortunately, Java's security sandbox restricts the applet's outgoing connections to the site from which it originated. While the reasoning behind this limitation is sound, it imposes an unnecessarily limited selection of images for this applet. Future browsers will allow such restrictions to be disabled - if yours does, give it a try!
Image download progress is monitored - By making use of the MediaTracker class's ability to "time-out" during a download, the applet is able to provide an upper bound on the length of time an image takes to download. By timing out more frequently, the applet is able to display a count-down timer in the status bar. In addition to avoiding the problems associated with extremely slow web servers, the count-down timer provides a visual indication that the applet is functioning properly.
Zoom in/out takes advantage of the Graphics class's image scaling capabilities - Rather than having to re-scale the images when the user zooms, the applet takes advantage of Graphics.drawImage's ability to scale images at display-time. The capability provided by the drawImage method is very useful and simplifies the developer's job in addition to saving applets from having to carry out additional image manipulation.

Conclusion
Writing this applet in Java saved a great deal of hassle that would have been necessary with many other languages. The primary limitation imposed by the use of Java (other than the reduced execution speed) is the sandbox-based restriction on the types of sites that can be reached. However, in light of the relative ease with which everything else was done, this limitation is a small price to pay (and will not even be an issue with future browsers). I am pleased with the way this applet works and feel that it demonstrates anti-aliasing in an easy-to-understand manner.


The applet is available.
The source code is available for educational purposes.