|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.jpackages.jtray.IconAnimation
public class IconAnimation
This class defines a list of icons to be used as frames in animation.
The icon animation frames are animated in the order added to this IconAnimation. When all icons have been displayed, it will return to the beginning of this animation and begin again.
If you wish to show an animation once, use showAnimationOnce().
Example:
IconAnimation iconAnimation = new IconAnimation();
iconAnimation.addIcon("frame1.ico", ImageFileType.ICO);
iconAnimation.addIcon("frame2.ico", ImageFileType.ICO);
iconAnimation.addIcon("frame3.ico", ImageFileType.ICO);
iconAnimation.addIcon("frame4.ico", ImageFileType.ICO);
iconAnimation.addIcon("frame5.ico", ImageFileType.ICO);
iconAnimation.addIcon("frame4.ico", ImageFileType.ICO);
iconAnimation.addIcon("frame3.ico", ImageFileType.ICO);
iconAnimation.addIcon("frame2.ico", ImageFileType.ICO);
iconAnimation.addIcon("frame1.ico", ImageFileType.ICO);
// jTrayIcon is a JTrayIcon instance
jTrayIcon.setAnimation(iconAnimation);
jTrayIcon.startAnimation();
Copyright (c) 2001-2008
| Constructor Summary | |
|---|---|
IconAnimation()
|
|
| Method Summary | |
|---|---|
boolean |
addIcon(java.awt.Image i)
Adds an icon to this animation from an Image. |
boolean |
addIcon(javax.swing.ImageIcon i)
Adds an icon to this animation from an ImageIcon. |
boolean |
addIcon(java.lang.String filePath,
int file_type)
Adds an icon to this animation from a file. |
boolean |
addIcon(java.lang.String filePath,
int file_type,
int index)
Adds an icon to this animation from a file. |
boolean |
clearIcons()
Removes all icons from this animation. |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public IconAnimation()
| Method Detail |
|---|
public boolean clearIcons()
Removes all icons from this animation.
public boolean addIcon(java.awt.Image i)
Adds an icon to this animation from an Image.
The Image should have a 1:1 aspect ratio. Recommended image size is 32x32 or 16x16. Color limitations depend on the OS.
i - The Image to use as an icon.
public boolean addIcon(javax.swing.ImageIcon i)
Adds an icon to this animation from an ImageIcon.
The ImageIcon should have a 1:1 aspect ratio. Recommended image size is 32x32 or 16x16. Color limitations depend on the OS.
i - The ImageIcon to use as an icon.
public boolean addIcon(java.lang.String filePath,
int file_type)
Adds an icon to this animation from a file.
filePath - The file path to a file that contains an icon. (Such as "icons\\icon1.ico")file_type - The type of the file. Types are listed in ImageFileType.
public boolean addIcon(java.lang.String filePath,
int file_type,
int index)
Adds an icon to this animation from a file.
filePath - The file path to a file that contains an icon. (Such as "icons\\icon1.ico")file_type - The type of the file. Types are listed in ImageFileType.index - The index of the icon to use. DLLs and EXEs can contain multiple icons accessed by this index. To use this,
set file_type to ImageFileType.ICO.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||