class NewAnimator implements ActionListener {

  Timer timer;
  boolean looping = false;
  boolean animationRunning = false;
  Visual sklComponent;

  NewAnimator(Visual sklComponent) {
    this.sklComponent = sklComponent;
  }

  protected void init() {
  }

  public void start() {
    init();
    timer = new Timer(25, this);
    timer.start();
    animationRunning = true;
  }

  protected boolean isRunning() {
    return animationRunning;
  }

  public void setLooping(boolean looping) {
    this.looping = looping;
  }
  AnimationListener listener;

  public void setListener(AnimationListener listener) {
    this.listener = listener;
  }

  protected void animate() {
  }

  @Override
  public void actionPerformed(ActionEvent e) {<FILL_FUNCTION_BODY>}
}

    if (isRunning()) {

      Rectangle r = sklComponent.getBounds();

      //setActualLocation((int) x, (int) y);

      animate();

      r.add(sklComponent.getBounds());

      if (sklComponent.getTopLevelAncestor() != null) {
        sklComponent.getTopLevelAncestor().repaint(r.x, r.y, r.width, r.height);
      }

    } else {
      timer.stop();
      if (looping) {
        start();
      } else {
        animationRunning = false;
        if (listener != null) {
          listener.animationCompleted();
        }
      }
    }
  
<no_super_class>