All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class symantec.itools.multimedia.Firework

java.lang.Object
   |
   +----java.awt.Component
           |
           +----java.awt.Canvas
                   |
                   +----symantec.itools.multimedia.Firework

public class Firework
extends Canvas
implements Runnable
Firework component. Creates an animated fireworks image.


Variable Index

 o AnimationSpeed
Speed at which animation occurs.
 o Gravity
Controls gravity of the firework simulation.
 o MaxRocketExplosionEnergy
Controls "energy" of firwork explosion.
 o MaxRocketNumber
Maximum number of rockets.
 o MaxRocketPatchLength
Controls the radius of the firework burst.
 o MaxRocketPatchNumber
Controls the density of the firework burst.
 o RocketStyleVariability
Chance of different rocket style.

Constructor Index

 o Firework()
Construct the defalut firework.

Method Index

 o addNotify()
Tells this component that it has been added to a container.
 o freezeRockets()
Suspend the firework animation.
 o hide()
Makes this component invisible.
 o paint(Graphics)
Paints a black background for this firework.
 o removeNotify()
Tells this component that it is being removed from a container.
 o reshape(int, int, int, int)
Moves and/or resizes this component.
 o run()
Firework thread body.
 o show()
Makes this component visible.
 o unfreezeRockets()
Resume the firework animation.

Variables

 o AnimationSpeed
  public int AnimationSpeed
Speed at which animation occurs. Delay time = 100 / AnimationSpeed. Default value 10.

 o RocketStyleVariability
  public int RocketStyleVariability
Chance of different rocket style. Rocket sytle changes if Math.random() * 100 < RocketStyleVariability. Default Value 10.

 o MaxRocketNumber
  public int MaxRocketNumber
Maximum number of rockets.

 o MaxRocketExplosionEnergy
  public int MaxRocketExplosionEnergy
Controls "energy" of firwork explosion. Default value 850.

 o MaxRocketPatchNumber
  public int MaxRocketPatchNumber
Controls the density of the firework burst. Larger numbers give higher density. Default value 90.

 o MaxRocketPatchLength
  public int MaxRocketPatchLength
Controls the radius of the firework burst. Larger numbers give larger radius. Default value 68.

 o Gravity
  public int Gravity
Controls gravity of the firework simulation. Default value 400.

Constructors

 o Firework
  public Firework()
Construct the defalut firework.

Methods

 o addNotify
  public void addNotify()
Tells this component that it has been added to a container. This is a standard Java AWT method which gets called by the AWT when this component is added to a container. Typically, it is used to create this component's peer. It has been overridden here to start the launcher thread.

Overrides:
addNotify in class Canvas
See Also:
removeNotify
 o removeNotify
  public synchronized void removeNotify()
Tells this component that it is being removed from a container. This is a standard Java AWT method which gets called by the AWT when this component is removed from a container. Typically, it is used to destroy the peers of this component and all its subcomponents. It has been overridden here to stop the launcher thread.

Overrides:
removeNotify in class Component
See Also:
addNotify
 o show
  public synchronized void show()
Makes this component visible. This is a standard Java AWT method which gets called to show this component. If this component was invisible due to a previous hide() call it make this component visible again.

Overrides:
show in class Component
See Also:
hide
 o hide
  public synchronized void hide()
Makes this component invisible. This is a standard Java AWT method which gets called to hide this component. A hidden component cannot be seen by the user nor does it take up space in its container, but it does continue to exist.

Overrides:
hide in class Component
See Also:
show
 o reshape
  public synchronized void reshape(int x,
                                   int y,
                                   int width,
                                   int height)
Moves and/or resizes this component. This is a standard Java AWT method which gets called to move and/or resize this component. Components that are in containers with layout managers should not call this method, but rely on the layout manager instead.

Parameters:
x - horizontal position in the parent's coordinate space
y - vertical position in the parent's coordinate space
width - the new width
height - the new height
Overrides:
reshape in class Component
 o run
  public void run()
Firework thread body. This method is called by the Java virtual machine is response to the program's call to the start method of this thread.

 o freezeRockets
  public void freezeRockets()
Suspend the firework animation.

 o unfreezeRockets
  public void unfreezeRockets()
Resume the firework animation.

 o paint
  public void paint(Graphics g)
Paints a black background for this firework. This is a standard Java AWT method which typically gets called by the AWT to handle painting this component. It paints this component using the given graphics context. The graphics context clipping region is set to the bounding rectangle of this component and its <0,0> coordinate is this component's top-left corner.

Parameters:
g - the graphics context used for painting
Overrides:
paint in class Canvas
See Also:
repaint, update

All Packages  Class Hierarchy  This Package  Previous  Next  Index