KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > prefuse > action > animate > SizeAnimator


1 package prefuse.action.animate;
2
3 import prefuse.action.ItemAction;
4 import prefuse.visual.VisualItem;
5
6 /**
7  * Animator that linearly interpolates the size of a VisualItems.
8  *
9  * @author <a HREF="http://jheer.org">jeffrey heer</a>
10  */

11 public class SizeAnimator extends ItemAction {
12
13     /**
14      * Create a new SizeAnimator that processes all data groups.
15      */

16     public SizeAnimator() {
17         super();
18     }
19     
20     /**
21      * Create a new SizeAnimator that processes the specified group.
22      * @param group the data group to process.
23      */

24     public SizeAnimator(String JavaDoc group) {
25         super(group);
26     }
27
28     /**
29      * @see prefuse.action.ItemAction#process(prefuse.visual.VisualItem, double)
30      */

31     public void process(VisualItem item, double frac) {
32         double ss = item.getStartSize();
33         item.setSize(ss + frac*(item.getEndSize() - ss));
34     }
35
36 } // end of class SizeAnimator
37
Popular Tags