thereandbackpacer.java

来自「用applet实现很多应用小程序」· Java 代码 · 共 21 行

JAVA
21
字号
package prefuse.activity;

/**
 * Pacing function that maps the animation fraction f such that it ranges
 * from 0 to 1 and then back to 0 again. This is useful for animations
 * with periodic activity.
 *
 * @author <a href="http://jheer.org">jeffrey heer</a>
 */
public class ThereAndBackPacer implements Pacer {

    /**
     * Pacing function for providing there-and-back (periodic) transitions.
     * @see prefuse.activity.Pacer#pace(double)
     */
    public double pace(double f) {
        return 2*(f <= 0.5 ? f : (1-f));
    }

} // end of class ThereAndBackPacer

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?