All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class tropo.applet.stars.Starry

java.lang.Object
   |
   +----java.awt.Component
           |
           +----java.awt.Container
                   |
                   +----java.awt.Panel
                           |
                           +----java.applet.Applet
                                   |
                                   +----tropo.applet.TRBufferedApplet
                                           |
                                           +----tropo.applet.stars.Starry

public final class Starry
extends TRBufferedApplet
implements Runnable
Copyright (c) 1997-1998 Tropo. All Rights Reserved.

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.


Constructor Index

 o Starry()

Method Index

 o destroy()
Try to gracefully clean up.
 o draw(Graphics)
Draw the screen.
 o getAppletInfo()
 o getParameterInfo()
Return parameter doc - but how is this exposed to the user?
 o init()
 o mouseDown(Event, int, int)
They clicked.
 o mouseDrag(Event, int, int)
The mouse dragged.
 o mouseEnter(Event, int, int)
The mouse entered
 o mouseExit(Event, int, int)
The mouse leave
 o mouseMove(Event, int, int)
The mouse moved.
 o run()
Thread to do star animation.
 o start()
Start by kicking off bg thread.
 o stop()

Constructors

 o Starry
 public Starry()

Methods

 o init
 public void init()
Overrides:
init in class Applet
 o start
 public void start()
Start by kicking off bg thread.

Overrides:
start in class Applet
 o stop
 public void stop()
Overrides:
stop in class Applet
 o destroy
 public void destroy()
Try to gracefully clean up.

Overrides:
destroy in class Applet
 o getParameterInfo
 public String[][] getParameterInfo()
Return parameter doc - but how is this exposed to the user?

Overrides:
getParameterInfo in class Applet
 o run
 public void run()
Thread to do star animation.

 o getAppletInfo
 public String getAppletInfo()
Overrides:
getAppletInfo in class Applet
 o draw
 protected void draw(Graphics g)
Draw the screen.

Overrides:
draw in class TRBufferedApplet
 o mouseMove
 public boolean mouseMove(Event evt,
                          int x,
                          int y)
The mouse moved.

Overrides:
mouseMove in class Component
 o mouseEnter
 public boolean mouseEnter(Event evt,
                           int x,
                           int y)
The mouse entered

Overrides:
mouseEnter in class Component
 o mouseExit
 public boolean mouseExit(Event evt,
                          int x,
                          int y)
The mouse leave

Overrides:
mouseExit in class Component
 o mouseDrag
 public boolean mouseDrag(Event evt,
                          int x,
                          int y)
The mouse dragged.

Overrides:
mouseDrag in class Component
 o mouseDown
 public boolean mouseDown(Event evt,
                          int x,
                          int y)
They clicked.

Overrides:
mouseDown in class Component

All Packages  Class Hierarchy  This Package  Previous  Next  Index