Category Archive for: The Lavatron Applet A Speirts Arena Display

The Lavatron Applet: ASpeirts Arena Display

The Lavatron Applet: ASpeirts Arena Display Lavatron is a sports arena lightbulb display. Normally, an applet doesn’t have much of a history, but this one does. David Lavallee, the author of the ImagcMenu applet from Chapter 30, wanted to achieve this kind of effect for a long time. The history of Lavatron begins way back in 1974, when…

Read More →

Hot Java

Hot Java This applet is “noth~l small example of the kind.of amazing performance you can squeeze out of Java if you are careful and diligent. David Lavallee uses many tricks to avoid excessive memory allocation and unnecessary calls to AWl’ drawing functions. Creating the lightbulb mask image from a small array of integers rather , than a loaded GIF…

Read More →

IntHash()

IntHash()  As mentioned in the preceding section, Color objects are stored in a hash table rather than creating the same ones over and over. As a further optimization, we created our own version of Java’s Hashtable class, which uses normal ints as keys rather than requiring an Object handle Integer data needs much less room to…

Read More →

update( )

update( ) Lavatron overrides update f ) to do nothing, because we don’t want AWT’s implementation to cause flicker, paint( ) The paint() method is quite simple. The first step calls copyArea( ) to all of the columns to the left by one column’s width, Then a for loop is used to fill the rightmost column with…

Read More →

createBulbs( )

createBulbs( ) The crcatcBulbs( ) method is a helper to init( ). It returns an Image of a stack of bulb images that can be used Lomask out a column of colored squares to make them look like lit lightbulbs. It is a littletricky, but quite elegant. I First, it allocates the right number of ints in an…

Read More →

The APPLET Tag

The APPLET Tag The source code starts with the APPLET lag for Lavatron, there, This applet looks best when the width is an even multiple of the bulb Size and is the bulb size times the source image heiglu. The only parameter is Ior the name of the source image file, named imge. Lavatron java The main…

Read More →

The Source Cod

The Source Cod Lavatron starts by initializing data; which includes loading.the source image and creating the column of bulb images. The last stage of the initialization is painting the offscreen (double buffer) image full of dimmed (black) lightbulbs to start thedisplay with a clean image. Subsequent painting of the offscrecn image begins by using copyAreaf ) to move the…

Read More →

How Lavatron Works

How Lavatron Works Lavatron is able to present an interesting image onscrccn because of a small trick that it employs, and its side effect allows the applct io load very quickly. The reason it loads so quickly is that there isn’t much data transmitted over the Net. The source image is a JPEG image that is 64 times…

Read More →

Back to Top