示例#1
1
  public boolean mouseDown(Event e, int x, int y) {
    if (suspended) {
      animate.resume();
      suspended = false;
    } else {
      animate.suspend();
      suspended = true;
    }

    return true;
  }
示例#2
0
  // start the applet
  public void start() {
    // always start with 1st image
    gContext.drawImage((Image) images.elementAt(0), 0, 0, this);

    // create a new animation thread when user visits page
    if (animate == null) {
      animate = new Thread(new Animator2Run(this, images, imageTracker, gContext));
      animate.start();
    }
  }
示例#3
0
 // terminate animation thread when user leaves page
 public void stop() {
   if (animate != null) {
     animate.stop();
     animate = null;
   }
 }