/[gzz]/gzz/gzz/client/AbstractUpdateManager.java
ViewVC logotype

Diff of /gzz/gzz/client/AbstractUpdateManager.java

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.22 by humppake, Thu Nov 28 08:41:48 2002 UTC revision 1.23 by humppake, Fri Nov 29 14:18:45 2002 UTC
# Line 260  public static final String rcsid = "$Id$ Line 260  public static final String rcsid = "$Id$
260          }          }
261      }      }
262      static public class SimpleCalculator implements FractCalculator {      static public class SimpleCalculator implements FractCalculator {
263          protected static float r = 2f, n = 0.4f;          /**
264             * Multiplicates x in Math.cos(); determines the amount of
265             * 'waves' when interpolating between two view states.
266             */
267            protected static n = 0.4f;
268            /**
269             * Multiplicates x in Math.exp(); determines how fast animation
270             * slows down, how fast it reduces 'waving'.
271             */
272            protected static float r = 2f;
273    
274          int millis = 0; // see defaultAnimationTime          int millis = 0; // see defaultAnimationTime
275          protected long startTime = 0;          protected long startTime = 0;
276          public void eventAt(long time) {          public void eventAt(long time) {
# Line 278  public static final String rcsid = "$Id$ Line 288  public static final String rcsid = "$Id$
288              float x = (time-startTime)/((float)millis);              float x = (time-startTime)/((float)millis);
289              if (-(x + x*x)*r < Math.log(0.02)) {              if (-(x + x*x)*r < Math.log(0.02)) {
290                  if (Math.abs(time-startTime-millis) > 100) {                  if (Math.abs(time-startTime-millis) > 100) {
291                      /** If animation time was either 'too fast' or                      /** XXX: If animation time was either 'too fast' or 'too slow',
292                       * 'too slow', we recalibrate r and n.                       * we recalibrate r and n. This is probably irrelevant for now on.
293                         * Although, current values for n and r are found with this. But
294                         * if we want to change values of r or n, this will help us to keep
295                         * the defaultAnimationTime.
296                       */                       */
297                      if (dbg) pa("x: " + x + " r: " + r + " n: " + n +                      if (dbg) pa("x: " + x + " r: " + r + " n: " + n +
298                                  " millis: " + (time - startTime));                                  " millis: " + (time - startTime) + " recalibrating...");
299                      r *= x; n *= x;                      r *= x; n *= x;
300                  }                  }
301                  return true;                  return true;

Legend:
Removed from v.1.22  
changed lines
  Added in v.1.23

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26