tnt.gui
Class MetricsCalculation

java.lang.Object
  extended by tnt.gui.MetricsCalculation

public class MetricsCalculation
extends java.lang.Object

Inner classes encapsulate threads to calculate performance metrics, and display calculation progress. This class initializes those threads and runs them concurrently.

Version:
1.0a - 02/2006
Author:
Steven J. Castellucci

Nested Class Summary
(package private)  class MetricsCalculation.CalculationThread
          Encapsulates a thread to calculate performance metrics.
(package private)  class MetricsCalculation.ProgressDialog
          Encapsulates a modal dialog to display calculation progress and presents a stop button to allow the user to cancel calculation.
(package private)  class MetricsCalculation.ProgressThread
          Encapsulates a thread to display a modal instance of ProgressDialog.
 
Field Summary
protected  MetricsCalculation.CalculationThread calculateThread
           
protected  boolean halt
          The flag that represents calculation should halt as soon as possible.
protected  MetricsCalculation.ProgressDialog progressDialog
           
protected  MetricsCalculation.ProgressThread progressThread
           
protected  javax.swing.Timer timer
           
 
Constructor Summary
MetricsCalculation(java.awt.Frame owner, java.lang.String alpha, java.lang.String keys, java.lang.String wordfreqFile, ModelDefinition model)
          Initializes the progress dialog, update timer, and the parameters for the metrics.
 
Method Summary
 TnKSPC getKSPC()
          Returns the TnKSPC object processed by this class.
 TnWPM getWPM()
          Returns the TnWPM object processed by this class.
 void start()
          Calls start() on an instance of ProgressThread and CalculationThread.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

halt

protected boolean halt
The flag that represents calculation should halt as soon as possible.


calculateThread

protected MetricsCalculation.CalculationThread calculateThread

progressDialog

protected MetricsCalculation.ProgressDialog progressDialog

progressThread

protected MetricsCalculation.ProgressThread progressThread

timer

protected javax.swing.Timer timer
Constructor Detail

MetricsCalculation

public MetricsCalculation(java.awt.Frame owner,
                          java.lang.String alpha,
                          java.lang.String keys,
                          java.lang.String wordfreqFile,
                          ModelDefinition model)
Initializes the progress dialog, update timer, and the parameters for the metrics.

Parameters:
owner - the frame to which this dialog is modal.
alpha - a String with all the letters of the alphabet.
keys - a String with the keys in the same index as their corresponding letters of the alphabet.
wordfreqFile - the name of the word-frequency file.
model - the ModelDefinition objcet to use.
See Also:
TnKSPC, TnWPM
Method Detail

start

public void start()
Calls start() on an instance of ProgressThread and CalculationThread.


getKSPC

public TnKSPC getKSPC()
Returns the TnKSPC object processed by this class.

Returns:
the TnKSPC object processed by this class.

getWPM

public TnWPM getWPM()
Returns the TnWPM object processed by this class.

Returns:
the TnWPM object processed by this class.


Copyright © 2006 Steven Castellucci and Scott MacKenzie. All Rights Reserved.