home *** CD-ROM | disk | FTP | other *** search
- class looper extends Thread {
- private int min;
- private int max;
- private static boolean loop = true;
- private boolean slowDown;
- private int speed;
- private int incremental = 1;
- private Thread looperThread;
- private onoff mycanvas;
-
- public looper(boolean var1, int var2, int var3, int var4, onoff var5) {
- this.min = var2;
- this.max = var3;
- this.slowDown = var1;
- this.speed = var4;
- this.mycanvas = var5;
- }
-
- public void setInc(int var1) {
- this.incremental = var1;
- }
-
- public void run() {
- loop = true;
-
- while(loop) {
- try {
- if (this.slowDown) {
- this.speed += this.incremental;
- if (this.speed > this.max) {
- this.speed = this.max;
- }
- } else {
- this.speed -= this.incremental;
- if (this.speed < this.min) {
- this.speed = this.min;
- }
- }
-
- this.mycanvas.changeEgorSpeed(this.speed);
- Thread.sleep(20L);
- } catch (InterruptedException var1) {
- }
- }
-
- }
-
- public int changeLoop(boolean var1) {
- loop = var1;
- return this.speed;
- }
- }
-