1: 2: public abstract class AlgorithmAnimator 3: extends DBAnimationApplet { 4: 5: abstract protected void algorithm(); 6: 7: public void run() { 8: algorithm(); 9: } 10: 11: final protected void pause() { 12: if (Thread.currentThread() == animationThread) { 13: try { 14: Thread.currentThread().sleep(delay); 15: } catch (InterruptedException e) {} 16: repaint(); 17: } 18: } 19: 20: }