|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.mucommander.ui.icon.AnimatedIcon
com.mucommander.ui.icon.SpinningDial
public class SpinningDial
Animated icon of a spinning dial used to notify users that an application is performing a task.
This behaves as any animated icon except for one thing: when the animation is stopped using
setAnimated(boolean), the dial won't be displayed anymore until the animation is
resumed.
This heavily borrows code from Technomage's furbelow package, distributed
under the GNU Lesser General Public License.
The original source code can be found here.
| Field Summary | |
|---|---|
static boolean |
DEFAULT_ANIMATE
Default creation animation status. |
static java.awt.Color |
DEFAULT_COLOR
Dial's default color. |
static int |
DEFAULT_SIZE
Icon's default width and height. |
static int |
DEFAULT_SPOKES
Default number of spokes in the dial. |
| Fields inherited from class com.mucommander.ui.icon.AnimatedIcon |
|---|
DEFAULT_FRAME_COUNT, DEFAULT_FRAME_DELAY |
| Constructor Summary | |
|---|---|
SpinningDial()
Creates a new spinning dial. |
|
SpinningDial(boolean animate)
Creates a new spinning dial. |
|
SpinningDial(java.awt.Color c)
Creates a new spinning dial with the specified color. |
|
SpinningDial(java.awt.Color c,
boolean animate)
Creates a new spinning dial with the specified color. |
|
SpinningDial(int w,
int h)
Creates a new spinning dial with the specified dimensions. |
|
SpinningDial(int w,
int h,
boolean animate)
Creates a new spinning dial with the specified dimensions. |
|
SpinningDial(int w,
int h,
java.awt.Color c)
Creates a new spinning dial with the specified dimensions and color. |
|
SpinningDial(int w,
int h,
java.awt.Color c,
boolean animate)
Creates a new spinning dial with the specified dimensions and color. |
|
SpinningDial(int w,
int h,
int spokes)
Creates a new spinning dial with the specified dimensions and number of spokes. |
|
SpinningDial(int w,
int h,
int spokes,
boolean animate)
Creates a new spinning dial with the specified dimensions and number of spokes. |
|
SpinningDial(int w,
int h,
int spokes,
java.awt.Color c)
Creates a new spinning dial with the specified characteristics. |
|
SpinningDial(int w,
int h,
int spokes,
java.awt.Color c,
boolean animate)
Creates a new spinning dial with the specified characteristics. |
|
| Method Summary | |
|---|---|
java.awt.Color |
getColor()
Returns the color used to paint the dial. |
int |
getIconHeight()
Returns the icon's height. |
int |
getIconWidth()
Returns the icon's width. |
protected java.awt.Color |
getSpokeColor(int alpha)
Computes the dial color according to the specified alpha-transparency value. |
float |
getStrokeWidth()
Returns the width of the strokes used to paint each of the dial's spokes. |
void |
paintFrame(java.awt.Component c,
java.awt.Graphics graphics,
int x,
int y)
Paints the current frame on the specified component. |
void |
setAnimated(boolean a)
Starts / stops the spinning dial. |
void |
setColor(java.awt.Color c)
Sets the color used to draw the dial. |
void |
setStrokeWidth(float width)
Sets the width of the strokes used to paint each of the dial's spokes. |
| Methods inherited from class com.mucommander.ui.icon.AnimatedIcon |
|---|
finalize, getFrame, getFrameCount, getFrameDelay, isAnimated, nextFrame, paintIcon, repaint, setFrame, setFrameCount, setFrameDelay |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final boolean DEFAULT_ANIMATE
public static final java.awt.Color DEFAULT_COLOR
public static final int DEFAULT_SIZE
public static final int DEFAULT_SPOKES
| Constructor Detail |
|---|
public SpinningDial()
The new instance will be initialised using default values:
DEFAULT_SIZE for its width and height.DEFAULT_COLOR for its color.DEFAULT_SPOKES for its number of spokes.
A dial created that way will not be displayed until setAnimated(boolean) is
called to animate it.
public SpinningDial(boolean animate)
The new instance will be initialised using default values:
DEFAULT_SIZE for its width and height.DEFAULT_COLOR for its color.DEFAULT_SPOKES for its number of spokes.
animate - whether to animate the dial immediately or not.public SpinningDial(java.awt.Color c)
The new instance will be initialised using default values:
DEFAULT_SIZE for its width and height.DEFAULT_SPOKES for its number of spokes.
A dial created that way will not be displayed until setAnimated(boolean) is
called to animate it.
c - color in which to paint the dial.
public SpinningDial(java.awt.Color c,
boolean animate)
The new instance will be initialised using default values:
DEFAULT_SIZE for its width and height.DEFAULT_SPOKES for its number of spokes.
c - color in which to paint the dial.animate - whether to animate the dial immediately or not.
public SpinningDial(int w,
int h)
The new instance will be initialised using default values:
DEFAULT_COLOR for its color.DEFAULT_SPOKES for its number of spokes.
A dial created that way will not be displayed until setAnimated(boolean) is
called to animate it.
w - width of the icon.h - height of the icon.
public SpinningDial(int w,
int h,
boolean animate)
The new instance will be initialised using default values:
DEFAULT_COLOR for its color.DEFAULT_SPOKES for its number of spokes.
w - width of the icon.h - height of the icon.animate - whether to animate the dial immediately or not.
public SpinningDial(int w,
int h,
java.awt.Color c)
The new instance will use DEFAULT_SPOKES for its number of spokes.
A dial created that way will not be displayed until setAnimated(boolean) is
called to animate it.
w - width of the icon.h - height of the icon.c - color in which to paint the dial.
public SpinningDial(int w,
int h,
java.awt.Color c,
boolean animate)
The new instance will use DEFAULT_SPOKES for its number of spokes.
w - width of the icon.h - height of the icon.c - color in which to paint the dial.animate - whether to animate the dial immediately or not.
public SpinningDial(int w,
int h,
int spokes)
The new instance will use DEFAULT_COLOR for its color.
A dial created that way will not be displayed until setAnimated(boolean) is
called to animate it.
w - width of the icon.h - height of the icon.spokes - number of spokes that compose the dial.
public SpinningDial(int w,
int h,
int spokes,
boolean animate)
The new instance will use DEFAULT_COLOR for its color.
w - width of the icon.h - height of the icon.spokes - number of spokes that compose the dial.animate - whether to animate the dial immediately or not.
public SpinningDial(int w,
int h,
int spokes,
java.awt.Color c)
A dial created that way will not be displayed until setAnimated(boolean) is
called to animate it.
w - width of the icon.h - height of the icon.spokes - number of spokes that compose the dial.c - color in which to paint the dial.
public SpinningDial(int w,
int h,
int spokes,
java.awt.Color c,
boolean animate)
w - width of the icon.h - height of the icon.spokes - number of spokes that compose the dial.c - color in which to paint the dial.animate - whether to animate the dial immediately or not.| Method Detail |
|---|
public void setStrokeWidth(float width)
width - width of the strokes used to paint each of the dial's spokes.public float getStrokeWidth()
public void setColor(java.awt.Color c)
c - color in which to paint the dial.public java.awt.Color getColor()
protected java.awt.Color getSpokeColor(int alpha)
alpha - transparency value that must be applied to the dial's color.public int getIconHeight()
getIconHeight in interface javax.swing.IcongetIconHeight in class AnimatedIconpublic int getIconWidth()
getIconWidth in interface javax.swing.IcongetIconWidth in class AnimatedIcon
public void paintFrame(java.awt.Component c,
java.awt.Graphics graphics,
int x,
int y)
paintFrame in class AnimatedIconc - component on which to paint the dial.graphics - graphic context to use when painting the dial.x - horizontal coordinate at which to paint the dial.y - vertical coordinate at which to paint the dial.public void setAnimated(boolean a)
If a is false, the animation will stop and the
the dial won't be displayed anymore until the animationr resumes.
setAnimated in class AnimatedIcona - whether to start or stop the animation.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
This file is part of muCommander - Copyright (C) 2002-2008 Maxence Bernard