All Packages Class Hierarchy This Package Previous Next Index
java.lang.Object | +----java.awt.Component | +----java.awt.Container | +----java.awt.Panel | +----java.applet.Applet | +----tropo.applet.TRBufferedApplet | +----tropo.applet.stars.Starry
Starry, starry night applet.
The basic idea is that we (typically) load a background image, and then as the mouse moves around little fading stars are drawn near the mouse. When the user clicks the mouse we draw a "starburst" and then go to a specified URL.
These are the configurable parameters that can be specified in the HTML file e.g.
<applet code="tropo.applet.stars.Starry.class" codebase="/techno/java/lib" width=400 height=400>
<param name=bg value="#000000">
<param name=range value="15">
<param name=sleep value="75">
</applet>
Parameter | Description | Default |
---|---|---|
imageName
|
URL of the background image to load. | None. |
bg
|
Background color. Takes an "HTML" format (#RRGGBB in hex) or java hex (0xRRGGBB) specification. | Black. |
starCenter
|
Color of center of the stars. | White. |
starOutside
|
Color of the outside of the stars. | Blueish ( red=0, green=130, blue=255). |
range
|
Random delta for x and y placemement of stars. The higher this is the more the stars spread out. | 6 |
sleep
|
Amount (in ms) to sleep inbetween frames. | 100ms |
twinkle
|
If set to 1 then stars will move around slightly
as they fade to give a slight twinkling effect.
Set to 1/true/on to turn on.
|
off |
spinOff
|
If the mouse is still should stars will appear? Set to 1/true/yes to turn on. | off |
delta
|
Don't let stars appear any more frequently than this when the mouse is moving. | 50ms |
defSize
|
Default star size. | 6 |
maxStars
|
The maximum number of stars there can ever be. | 100 |
starburstSize
|
In a "starburst" (when the user clicks) how many stars appear? | 50 |
starburstTicks
|
How long does a starburst last? | 10 |
extra
|
How many extra stars to generate as the mouse moves. | 5 |
goto
|
The URL to go to when they click. | None. |
public Starry()
public void init()
public void start()
public void stop()
public void destroy()
public String[][] getParameterInfo()
public void run()
public String getAppletInfo()
protected void draw(Graphics g)
public boolean mouseMove(Event evt, int x, int y)
public boolean mouseEnter(Event evt, int x, int y)
public boolean mouseExit(Event evt, int x, int y)
public boolean mouseDrag(Event evt, int x, int y)
public boolean mouseDown(Event evt, int x, int y)
All Packages Class Hierarchy This Package Previous Next Index