KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > prefuse > activity > ThereAndBackPacer


1 package prefuse.activity;
2
3 /**
4  * Pacing function that maps the animation fraction f such that it ranges
5  * from 0 to 1 and then back to 0 again. This is useful for animations
6  * with periodic activity.
7  *
8  * @author <a HREF="http://jheer.org">jeffrey heer</a>
9  */

10 public class ThereAndBackPacer implements Pacer {
11
12     /**
13      * Pacing function for providing there-and-back (periodic) transitions.
14      * @see prefuse.activity.Pacer#pace(double)
15      */

16     public double pace(double f) {
17         return 2*(f <= 0.5 ? f : (1-f));
18     }
19
20 } // end of class ThereAndBackPacer
21
Popular Tags