01: package prefuse.action.animate;
02:
03: import prefuse.action.ItemAction;
04: import prefuse.visual.VisualItem;
05:
06: /**
07: * Animator that linearly interpolates the size of a VisualItems.
08: *
09: * @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 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
|