|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objecttnt.gui.CalculateMetrics
public class CalculateMetrics
Inner classes encapsulate threads to calculate performance metrics, and display calculation progress. This class initializes those threads and runs them concurrently.
Nested Class Summary | |
---|---|
(package private) class |
CalculateMetrics.CalculateThread
Encapsulates a thread to calculate performance metrics. |
(package private) class |
CalculateMetrics.ProgressDialog
Encapsulates a modal dialog to display calculation progress and presents a stop button to allow the user to cancel calculation. |
(package private) class |
CalculateMetrics.ProgressThread
Encapsulates a thread to display a modal instance of ProgressDialog . |
Field Summary | |
---|---|
protected CalculateMetrics.CalculateThread |
calculateThread
|
protected boolean |
halt
The flag that represents calculation should halt as soon as possible. |
protected CalculateMetrics.ProgressDialog |
progressDialog
|
protected CalculateMetrics.ProgressThread |
progressThread
|
protected javax.swing.Timer |
timer
|
Constructor Summary | |
---|---|
CalculateMetrics(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 CalculateThread . |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected boolean halt
protected CalculateMetrics.CalculateThread calculateThread
protected CalculateMetrics.ProgressDialog progressDialog
protected CalculateMetrics.ProgressThread progressThread
protected javax.swing.Timer timer
Constructor Detail |
---|
public CalculateMetrics(java.awt.Frame owner, java.lang.String alpha, java.lang.String keys, java.lang.String wordfreqFile, ModelDefinition model)
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.TnKSPC
,
TnWPM
Method Detail |
---|
public void start()
start()
on an instance of
ProgressThread
and CalculateThread
.
public TnKSPC getKSPC()
TnKSPC
object processed by this class.
TnKSPC
object processed by this class.public TnWPM getWPM()
TnWPM
object processed by this class.
TnWPM
object processed by this class.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |