dasher.applet
Class DoFrameTask

java.lang.Object
  extended by java.util.TimerTask
      extended by dasher.applet.DoFrameTask
All Implemented Interfaces:
java.lang.Runnable

public class DoFrameTask
extends java.util.TimerTask

TimerTask which orders a specified applet to redraw every time it is run, the idea being that the DasherScreen Panel will be ordered to redraw and thus produce a new frame. This differs from Dasher's traditional methods in which drawing is triggered at the bottom level; here the Applet's redraw triggers the generation of a new frame.


Field Summary
private  int FramesInQueue
          Number of frames currently in progress
private  javax.swing.JApplet m_Applet
          Applet to repaint.
 
Constructor Summary
DoFrameTask(javax.swing.JApplet iApplet)
          Creates a new task to redraw a specified applet.
 
Method Summary
 void run()
          Redraws, incrementing the FramesInQueue counter beforehand and decrementing afterwards.
 
Methods inherited from class java.util.TimerTask
cancel, scheduledExecutionTime
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

m_Applet

private javax.swing.JApplet m_Applet
Applet to repaint.


FramesInQueue

private int FramesInQueue
Number of frames currently in progress

Constructor Detail

DoFrameTask

public DoFrameTask(javax.swing.JApplet iApplet)
Creates a new task to redraw a specified applet.

Parameters:
iApplet - Applet to redraw
Method Detail

run

public void run()
Redraws, incrementing the FramesInQueue counter beforehand and decrementing afterwards. If FramesInQueue is non-zero when we are called, a frame is skipped, both to avoid tasks stacking up, and to prevent the confusion involved if two frames are in progress simeltaneously.

Specified by:
run in interface java.lang.Runnable
Specified by:
run in class java.util.TimerTask