All Packages Class Hierarchy This Package Previous Next Index
Class com.sun.wizards.awt.Pinwheel
java.lang.Object
|
+----java.awt.Component
|
+----com.sun.wizards.awt.Pinwheel
- public class Pinwheel
- extends Component
- implements Runnable
The Pinwheel component is an indicator that runs in its own thread.
This component is used to indicate the program is busy (doing something
that is difficult to calculate progress for).
The Pinwheel component appears to spin until the stop method is called.
Here is the code for this applet:
import java.applet.Applet;
import java.awt.*;
import com.sun.wizards.awt.*;
public class Test extends Applet
{
public void init()
{
setLayout(new GridBagLayout());
add(new Pinwheel());
}
}
-
framesPerRevolution
- The number of frames in a cycle.
-
sectionCount
- The number of sections in the pinwheel.
-
updateRate
- The image update rate (fps).
-
Pinwheel()
- Creates a Pinwheel component that updates 5 times per
second and has 4 sections.
-
Pinwheel(int)
- Creates a Pinwheel that updates the specified number of
images per second and has 4 sections.
-
Pinwheel(int, int)
- Creates a Pinwheel that updates the specified number of
images per second with the specified number of sections.
-
Pinwheel(int, int, int)
- Creates a Pinwheel that updates the specified number of
images per second with the specified number of sections.
-
createImage(int)
- Creates the specified image.
-
displayImage(int)
- Displays the specified image.
-
getMinimumSize()
- Gets the minimum size of this component.
-
getPreferredSize()
- Gets the preferred size of this component.
-
paint(Graphics)
- The paint method draws the pinwheel.
-
run()
- This thread is responsible for creating the pinwheel animation images
and displaying them at the rate specified at initialization time.
-
stop()
- Stop the animation thread.
updateRate
protected int updateRate
- The image update rate (fps).
sectionCount
protected int sectionCount
- The number of sections in the pinwheel.
framesPerRevolution
protected int framesPerRevolution
- The number of frames in a cycle.
Pinwheel
public Pinwheel()
- Creates a Pinwheel component that updates 5 times per
second and has 4 sections.
Pinwheel
public Pinwheel(int updateRate)
- Creates a Pinwheel that updates the specified number of
images per second and has 4 sections.
- Parameters:
- updateRate - The number of updates per second.
Pinwheel
public Pinwheel(int updateRate,
int sectionCount)
- Creates a Pinwheel that updates the specified number of
images per second with the specified number of sections.
- Parameters:
- updateRate - The number of updates per second.
- sectionCount - The number of sections in the pinwheel.
Pinwheel
public Pinwheel(int updateRate,
int sectionCount,
int framesPerRevolution)
- Creates a Pinwheel that updates the specified number of
images per second with the specified number of sections.
- Parameters:
- updateRate - The number of updates per second.
- sectionCount - The number of sections in the pinwheel.
- framesPerRevolution - The number of frames per revolution.
getPreferredSize
public Dimension getPreferredSize()
- Gets the preferred size of this component.
- Returns:
- A dimension object indicating this component's preferred size.
- Overrides:
- getPreferredSize in class Component
getMinimumSize
public Dimension getMinimumSize()
- Gets the minimum size of this component.
- Returns:
- A dimension object indicating this component's minimum size.
- Overrides:
- getMinimumSize in class Component
createImage
protected Image createImage(int imageNumber)
- Creates the specified image.
- Parameters:
- imageNumber - The index of the image that should be created.
displayImage
protected void displayImage(int imageNumber)
- Displays the specified image.
- Parameters:
- imageNumber - The index of the image to be displayed.
run
public void run()
- This thread is responsible for creating the pinwheel animation images
and displaying them at the rate specified at initialization time.
stop
public synchronized void stop()
- Stop the animation thread.
paint
public void paint(Graphics g)
- The paint method draws the pinwheel.
- Overrides:
- paint in class Component
All Packages Class Hierarchy This Package Previous Next Index