[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Gzz-commits] gzz/gzz/client AbstractUpdateManager.java
From: |
Tuomas J. Lukka |
Subject: |
[Gzz-commits] gzz/gzz/client AbstractUpdateManager.java |
Date: |
Thu, 05 Sep 2002 07:54:36 -0400 |
CVSROOT: /cvsroot/gzz
Module name: gzz
Changes by: Tuomas J. Lukka <address@hidden> 02/09/05 07:54:36
Modified files:
gzz/client : AbstractUpdateManager.java
Log message:
Make the animation time configurable: now not just on-off - we can have
longer transitions when desired.
CVSWeb URLs:
http://savannah.gnu.org/cgi-bin/viewcvs/gzz/gzz/gzz/client/AbstractUpdateManager.java.diff?tr1=1.19&tr2=1.20&r1=text&r2=text
Patches:
Index: gzz/gzz/client/AbstractUpdateManager.java
diff -c gzz/gzz/client/AbstractUpdateManager.java:1.19
gzz/gzz/client/AbstractUpdateManager.java:1.20
*** gzz/gzz/client/AbstractUpdateManager.java:1.19 Tue Sep 3 17:15:32 2002
--- gzz/gzz/client/AbstractUpdateManager.java Thu Sep 5 07:54:36 2002
***************
*** 41,47 ****
*/
public abstract class AbstractUpdateManager implements Runnable {
! public static final String rcsid = "$Id: AbstractUpdateManager.java,v 1.19
2002/09/03 21:15:32 tjl Exp $";
public static boolean dbg = false;
private static void pa(String s) { System.err.println(s); }
--- 41,47 ----
*/
public abstract class AbstractUpdateManager implements Runnable {
! public static final String rcsid = "$Id: AbstractUpdateManager.java,v 1.20
2002/09/05 11:54:36 tjl Exp $";
public static boolean dbg = false;
private static void pa(String s) { System.err.println(s); }
***************
*** 70,82 ****
private boolean updating;
private int disabled;
- /** If true, there should be no animation: the end state should just be
- * shown as fast as possible.
- * This is appropriate certain kinds of user controls such as
- * an analog control for zooming.
- */
- private boolean noanimation;
-
/** If true, all windows have incorrect end state, and generateEndState()
* should be called for all of them at appropriate times.
*/
--- 70,75 ----
***************
*** 178,186 ****
}
}
! public static void setNoAnimation() { instance.setNoAnimationImpl(); }
! protected void setNoAnimationImpl() {
! noanimation = true;
}
/* Called by a space to inform that some cells have been
--- 171,187 ----
}
}
! static public int defaultAnimationTime = 2500;
! private int animationtime = defaultAnimationTime;
!
! public static void setNoAnimation() {
! instance.setAnimationTimeImpl(0);
! }
! public static void setAnimationTime(int millis) {
! instance.setAnimationTimeImpl(millis);
! }
! protected void setAnimationTimeImpl(int millis) {
! animationtime = millis;
}
/* Called by a space to inform that some cells have been
***************
*** 230,249 ****
void callRender(long time, Window w);
}
public class SimpleCalculator implements FractCalculator {
! protected float r = 10, n = 2, seconds = 2.5f;
protected long startTime = 0;
public void eventAt(long time) {
startTime = time;
}
private float fract(long time) {
! float x = (time-startTime)/(seconds*1000.0f);
x = x + x*x;
//x = (float)(1-Math.cos(2*Math.PI*n*x)*Math.pow(1-x, r));
float y = (float)(1-Math.cos(2*Math.PI*n*x)*Math.exp(-x*r));
return y;
}
public boolean isOver(long time) {
! float x = (time-startTime)/(seconds*1000.0f);
x = x + x*x;
return -x*r < Math.log(0.02);
}
--- 231,251 ----
void callRender(long time, Window w);
}
public class SimpleCalculator implements FractCalculator {
! protected float r = 10, n = 2;
! int millis = 0; // see defaultAnimationTime
protected long startTime = 0;
public void eventAt(long time) {
startTime = time;
}
private float fract(long time) {
! float x = (time-startTime)/((float)millis);
x = x + x*x;
//x = (float)(1-Math.cos(2*Math.PI*n*x)*Math.pow(1-x, r));
float y = (float)(1-Math.cos(2*Math.PI*n*x)*Math.exp(-x*r));
return y;
}
public boolean isOver(long time) {
! float x = (time-startTime)/((float)millis);
x = x + x*x;
return -x*r < Math.log(0.02);
}
***************
*** 253,259 ****
w.renderAnim(f, 1, f >= 0.85);
}
}
! public FractCalculator fractCalc = new SimpleCalculator();
/** For subclasses to override: process incoming events.
--- 255,261 ----
w.renderAnim(f, 1, f >= 0.85);
}
}
! public SimpleCalculator fractCalc = new SimpleCalculator();
/** For subclasses to override: process incoming events.
***************
*** 340,348 ****
if(dbg) pa("Couldn't generate end state for
window 0!");
} else {
regenNeeded[0] = false;
! if (!noanimation && wins[0].animUseful())
firstWinAnim = true;
! noanimation = false;
}
if(dbg) pa("Finished end state for window 0");
}
--- 342,352 ----
if(dbg) pa("Couldn't generate end state for
window 0!");
} else {
regenNeeded[0] = false;
! if (animationtime != 0
! && wins[0].animUseful())
firstWinAnim = true;
! fractCalc.millis = animationtime;
! animationtime = defaultAnimationTime;
}
if(dbg) pa("Finished end state for window 0");
}
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Gzz-commits] gzz/gzz/client AbstractUpdateManager.java,
Tuomas J. Lukka <=