All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class com.sun.wizards.panels.AnimationVisual

java.lang.Object
   |
   +----java.awt.Component
           |
           +----java.awt.Container
                   |
                   +----java.awt.Panel
                           |
                           +----com.sun.wizards.panels.ProgressVisual
                                   |
                                   +----com.sun.wizards.panels.AnimationVisual

public class AnimationVisual
extends ProgressVisual
implements ImageObserver, Runnable
This classes is used to provide animcations within a Wizard panel. The images are stored into the WizardResources, and retrieved at runtime when this panel is displayed. The images composing the animation are updated in a separate thread.


Constructor Index

 o AnimationVisual(String[], int)
Constructor used by the builder.
 o AnimationVisual(String[], int, boolean)
Constructor used by the builder with looping.
 o AnimationVisual(WizardTreeManager, Route)
Constructor to create new Panel with no images

Method Index

 o addRuntimeResources(Vector)
Get the runtime classes required by this visual.
 o deserialize(DataInput)
Deserialize this ProgressVisual from the specified input stream.
 o getMinimumSize()
The minimum size of this panel.
 o getPreferredSize()
The preferred size of this panel.
 o imageUpdate(Image, int, int, int, int, int)
Sets allImagesLoaded, if they have indeed been loaded.
 o paint(Graphics)
Paints the current frame pointed to by currentFrame.
 o run()
Begins the movie from the beginning and plays once.
 o serialize(DataOutput)
Serialize this ProgressVisual to the specified output stream.
 o start()
This method is called when all images are loaded and ready to be displayed.
 o stop()
This method is called when the movie thread should be stopped to be displayed.

Constructors

 o AnimationVisual
 public AnimationVisual(WizardTreeManager wizardManager,
                        Route route)
Constructor to create new Panel with no images

Parameters:
wizardManager - The WizardTreeManager that will manage this panel
route - The desired route to the component
 o AnimationVisual
 public AnimationVisual(String imageNames[],
                        int fps)
Constructor used by the builder.

Parameters:
imageNames - The names of the images stored in the WizardState that make up the animation
fps - Frames Per Seconds, the number of frames of animcation to show per second.
 o AnimationVisual
 public AnimationVisual(String imageNames[],
                        int fps,
                        boolean loop)
Constructor used by the builder with looping.

Parameters:
imageNames - The names of the images stored in the WizardState that make up the animation
fps - Frames Per Seconds, the number of frames of animcation to show per second.
loop - If set to true, the animation will loop forever.

Methods

 o getMinimumSize
 public Dimension getMinimumSize()
The minimum size of this panel. Usually the same as the image size.

Returns:
The minimum size of this panel.
Overrides:
getMinimumSize in class Container
 o getPreferredSize
 public Dimension getPreferredSize()
The preferred size of this panel. Usually the same as the minimum size.

Returns:
The preferred size of this panel.
Overrides:
getPreferredSize in class Container
 o stop
 public void stop()
This method is called when the movie thread should be stopped to be displayed.

Overrides:
stop in class ProgressVisual
 o start
 public void start()
This method is called when all images are loaded and ready to be displayed.

Overrides:
start in class ProgressVisual
 o run
 public void run()
Begins the movie from the beginning and plays once.

 o paint
 public void paint(Graphics g)
Paints the current frame pointed to by currentFrame. Waits until each picture is fully loaded before painting.

Parameters:
g - The Graphics context for this panel. Use getGraphics() to obtain.
Overrides:
paint in class Container
 o imageUpdate
 public boolean imageUpdate(Image image,
                            int infoFlags,
                            int x,
                            int y,
                            int width,
                            int height)
Sets allImagesLoaded, if they have indeed been loaded. Returns result.

Parameters:
image - The image in question
infoFlags - Flags determining what information is available about the image
x - Not used
y - Not used
width - The image's width, if it can be determined
height - The image's height, if it can be determined
Returns:
Whether the image has been loaded fully or not
Overrides:
imageUpdate in class Component
 o serialize
 public void serialize(DataOutput out)
Serialize this ProgressVisual to the specified output stream.

Parameters:
out - The output stream to which this ProgressVisual will be serialized.
Overrides:
serialize in class ProgressVisual
 o deserialize
 public void deserialize(DataInput in)
Deserialize this ProgressVisual from the specified input stream.

Parameters:
in - The input stream from which this ProgressVisual will be deserialized.
Overrides:
deserialize in class ProgressVisual
 o addRuntimeResources
 public void addRuntimeResources(Vector resourceVector)
Get the runtime classes required by this visual.

Parameters:
resourceVector - The vector containing all runtime resources for this wizard.
Overrides:
addRuntimeResources in class ProgressVisual

All Packages  Class Hierarchy  This Package  Previous  Next  Index