com.sas.visuals
Class FireworkIcon

com.sas.visuals.FireworkIcon
All Implemented Interfaces:
AnimationIconInterface, com.sas.visuals.IconInterface, com.sas.visuals.PainterInterface, java.io.Serializable

public class FireworkIcon
implements AnimationIconInterface, java.io.Serializable

FireworkIcon is an implementation of the AnimationIconInterface that allows for incrementing and decrementing the FireworkIcon and painting it in the differing states to show an animation of fireworks.

See Also:
AnimationIconView, Fireworks, Serialized Form

Field Summary
protected  int explosionEnergy
           
protected  int gravity
           
protected  int height
           
protected  int maxRocketExplosionEnergy
           
protected  int maxRocketNumber
           
protected  int maxRocketPatchLength
           
protected  int maxRocketPatchNumber
           
protected  int patchLength
           
protected  int patchNumber
           
protected  boolean reset
           
protected  com.sas.visuals.Rocket[] rocket
           
protected  boolean rocketsCreated
           
protected  int rocketStyleVariability
           
protected  long seed
           
protected  int width
           
 
Constructor Summary
FireworkIcon()
          Default Constructor
 
Method Summary
protected  void createRockets()
          Create the rocket objects to be painted.
 void decrement()
          Change the state of the rockets.
 int getGravity()
          Get the gravity affecting the rockets.
 java.awt.Insets getInsets()
          Return the insets.
 int getMaxRocketExplosionEnergy()
          Get the maximum rocket explosion energy.
 int getMaxRocketNumber()
          Get the maximum number of rockets created.
 int getMaxRocketPatchLength()
          Get the maximum rocket patch length.
 int getMaxRocketPatchNumber()
          Get the maximum rocket patch number.
 java.awt.Dimension getPreferredSize()
          Get the preferredSize that was set on the FireworkIcon
 int getRocketStyleVariability()
          Get the rocket style variability.
 void increment()
          Change the state of the rockets.
 void paint(java.awt.Component comp, java.awt.Graphics g, int x, int y, int width, int height)
          Paint the background of the FireworkIcon.
 void paintAnimation(java.awt.Component comp, java.awt.Graphics g, int x, int y, int width, int height)
          Paint the fireworks animation in the current state.
 void reset()
          Reset the fireworks state.
 void setGravity(int g)
          Set the gravity.
 void setMaxRocketExplosionEnergy(int e)
          Set the maximum rocket explosion energy.
 void setMaxRocketNumber(int n)
          Set the maximum rocket number.
 void setMaxRocketPatchLength(int l)
          Set the maximum rocket patch length.
 void setMaxRocketPatchNumber(int p)
          Set the maximum rocket patch number.
 void setPreferredSize(java.awt.Dimension size)
          Set the preferredSize of the fireworks.
 void setRocketStyleVariability(int var)
          Set the rocket style variability
 

Field Detail

rocketStyleVariability

protected int rocketStyleVariability

maxRocketNumber

protected int maxRocketNumber

maxRocketExplosionEnergy

protected int maxRocketExplosionEnergy

maxRocketPatchNumber

protected int maxRocketPatchNumber

maxRocketPatchLength

protected int maxRocketPatchLength

gravity

protected int gravity

explosionEnergy

protected transient int explosionEnergy

patchNumber

protected transient int patchNumber

patchLength

protected transient int patchLength

seed

protected transient long seed

rocket

protected transient com.sas.visuals.Rocket[] rocket

rocketsCreated

protected transient boolean rocketsCreated

reset

protected transient boolean reset

width

protected int width

height

protected int height
Constructor Detail

FireworkIcon

public FireworkIcon()
Default Constructor

Method Detail

createRockets

protected void createRockets()
Create the rocket objects to be painted. The number of rockets created is equal to the maxRocketNumber.


getGravity

public int getGravity()
Get the gravity affecting the rockets.

See Also:
setGravity(int)

getInsets

public java.awt.Insets getInsets()
Return the insets.

Specified by:
getInsets in interface com.sas.visuals.PainterInterface
Returns:
insets of 0,0,0,0
See Also:
AnimationIconInterface

getMaxRocketNumber

public int getMaxRocketNumber()
Get the maximum number of rockets created.

See Also:
setMaxRocketNumber(int)

getMaxRocketExplosionEnergy

public int getMaxRocketExplosionEnergy()
Get the maximum rocket explosion energy.

See Also:
setMaxRocketExplosionEnergy(int)

getMaxRocketPatchNumber

public int getMaxRocketPatchNumber()
Get the maximum rocket patch number.

See Also:
setMaxRocketPatchNumber(int)

getMaxRocketPatchLength

public int getMaxRocketPatchLength()
Get the maximum rocket patch length.

See Also:
setMaxRocketPatchLength(int)

getPreferredSize

public java.awt.Dimension getPreferredSize()
Get the preferredSize that was set on the FireworkIcon

Specified by:
getPreferredSize in interface com.sas.visuals.IconInterface
See Also:
setPreferredSize(java.awt.Dimension)

getRocketStyleVariability

public int getRocketStyleVariability()
Get the rocket style variability.

See Also:
setRocketStyleVariability(int)

decrement

public void decrement()
Change the state of the rockets.

Specified by:
decrement in interface AnimationIconInterface
See Also:
AnimationIconInterface, increment()

increment

public void increment()
Change the state of the rockets.

Specified by:
increment in interface AnimationIconInterface
See Also:
AnimationIconInterface, decrement()

paint

public void paint(java.awt.Component comp,
                  java.awt.Graphics g,
                  int x,
                  int y,
                  int width,
                  int height)
Paint the background of the FireworkIcon.

Specified by:
paint in interface com.sas.visuals.PainterInterface
See Also:
AnimationIconInterface

paintAnimation

public void paintAnimation(java.awt.Component comp,
                           java.awt.Graphics g,
                           int x,
                           int y,
                           int width,
                           int height)
Paint the fireworks animation in the current state.

Specified by:
paintAnimation in interface AnimationIconInterface
Parameters:
comp - the java.awt.Component to paint on
g - the graphics context to use for painting
x - the x coordinate
y - the y coordinate
width - the width
height - the height
See Also:
AnimationIconInterface

reset

public void reset()
Reset the fireworks state.

Specified by:
reset in interface AnimationIconInterface
See Also:
AnimationIconInterface

setGravity

public void setGravity(int g)
Set the gravity.

See Also:
getGravity()

setMaxRocketNumber

public void setMaxRocketNumber(int n)
Set the maximum rocket number.

See Also:
getMaxRocketNumber()

setMaxRocketExplosionEnergy

public void setMaxRocketExplosionEnergy(int e)
Set the maximum rocket explosion energy.

See Also:
getMaxRocketExplosionEnergy()

setMaxRocketPatchNumber

public void setMaxRocketPatchNumber(int p)
Set the maximum rocket patch number.

See Also:
getMaxRocketPatchNumber()

setMaxRocketPatchLength

public void setMaxRocketPatchLength(int l)
Set the maximum rocket patch length.

See Also:
getMaxRocketPatchLength()

setPreferredSize

public void setPreferredSize(java.awt.Dimension size)
Set the preferredSize of the fireworks.

See Also:
getPreferredSize()

setRocketStyleVariability

public void setRocketStyleVariability(int var)
Set the rocket style variability

See Also:
getRocketStyleVariability()



Copyright © 2009 SAS Institute Inc. All Rights Reserved.