|
|
ipple (Version 1.1)
Ripple is a Canvas subclass that uses a mathematical distortion algorithm to create a water-like ripple or wave animation. The ripple animation frames are rendered using a user specified background image. Each frame of animation can optionally be overlaid with a static transparent GIF (GIF89a) foreground image. The following documentation describes how the Ripple canvas class is used. Also available is RippleApplet which can be used to plug the animation directly into a web page. The RippleApplet class is documented separately. | ||||||||||||||||||||||||||||||||||||
| peration On initialization, Ripple loads the image to animate and the static overlay image (if specified). The code then begins to render the animation while displaying a progress bar. Precisely how the animation is rendered and the speed at which the animation is displayed is controlled by parameters specified in the constructor and by public methods, all of which are described in detail below. | |||||||||||||||||||||||||||||||||||||
ample
| |||||||||||||||||||||||||||||||||||||
| onstructors
This is the standard constructor with all possible parameters.
This constructor allows images to be passed directly, rather than passing a URL and requiring the Ripple canvas to handle loading the images.
The following is a basic constructor, requiring only image loading information. The remaining parameters are set to the default values listed below the constructor.
The constructor parameters are defined as follows:
| |||||||||||||||||||||||||||||||||||||
| ublic
Methods This section lists the methods that can be called from a Java program to control or alter the animation.
Starts the animation.
Stops the animation.
Sets the number of frames of animation to render. If the animation is active and if nbrFrames is not equal to the current number of frames in the animation, then the animation will be stopped, re-rendered, then started again.
Sets the number of sine waveforms used to create the "ripple" effect for each frame of animation. If the animation is active, then the animation will be stopped, re-rendered, then started again.
Sets the wave amplitude in percent of image height for the sine waveforms. If the animation is active, then the animation will be stopped, re-rendered, then started again.
Sets the incremental number of degrees of offset that should be used for the sine waves when generating each frame of animation. If the animation is active, then the animation will be stopped, re-rendered, then started again.
Sets the direction of the ripple movement. If set to 1, then the ripples will move from the bottom to the top. If set to 2, then the ripples will move from the top to the bottom.
Sets the number of milliseconds to delay between each frame of the "ripple" animation.
If set to "true", then a small amount of randomness is introduced into the wave amplitude when each frame is rendered. If the animation is active, and if the randomizeAnimation state has changed, then the animation will be stopped, re-rendered, then started again. | |||||||||||||||||||||||||||||||||||||
| ownload The class file for Ripple, along with a copy of this documentation, is available for download as a standard zip file, as a self-extracting file (for Windows95/NT users), or as a slef-installing Java class file. | |||||||||||||||||||||||||||||||||||||
| opyright This documentation and the object code for RippleApplet and Ripple may be copied and distributed freely for non-commercial purposes so long as neither the code nor the documentation is altered in any way. If the object code is distributed with any documentation whatsoever, then this unaltered document must accompany the code. | |||||||||||||||||||||||||||||||||||||