home *** CD-ROM | disk | FTP | other *** search
/ PC Pro 1998 October / DPPCPRO1098.ISO / Hotdog / files / snagpack.exe / LOOPER.CLASS (.txt) < prev    next >
Encoding:
Java Class File  |  1996-09-09  |  1.1 KB  |  53 lines

  1. class looper extends Thread {
  2.    private int min;
  3.    private int max;
  4.    private static boolean loop = true;
  5.    private boolean slowDown;
  6.    private int speed;
  7.    private int incremental = 1;
  8.    private Thread looperThread;
  9.    private onoff mycanvas;
  10.  
  11.    public looper(boolean var1, int var2, int var3, int var4, onoff var5) {
  12.       this.min = var2;
  13.       this.max = var3;
  14.       this.slowDown = var1;
  15.       this.speed = var4;
  16.       this.mycanvas = var5;
  17.    }
  18.  
  19.    public void setInc(int var1) {
  20.       this.incremental = var1;
  21.    }
  22.  
  23.    public void run() {
  24.       loop = true;
  25.  
  26.       while(loop) {
  27.          try {
  28.             if (this.slowDown) {
  29.                this.speed += this.incremental;
  30.                if (this.speed > this.max) {
  31.                   this.speed = this.max;
  32.                }
  33.             } else {
  34.                this.speed -= this.incremental;
  35.                if (this.speed < this.min) {
  36.                   this.speed = this.min;
  37.                }
  38.             }
  39.  
  40.             this.mycanvas.changeEgorSpeed(this.speed);
  41.             Thread.sleep(20L);
  42.          } catch (InterruptedException var1) {
  43.          }
  44.       }
  45.  
  46.    }
  47.  
  48.    public int changeLoop(boolean var1) {
  49.       loop = var1;
  50.       return this.speed;
  51.    }
  52. }
  53.