A rough layout of the DTW GUI Main frame is shown in figure 6.4.1
Attributes
DTWData Data
DTWData object containing information about DLL data structures and observation.
DTWFileIO FileIO
File IO management class.
DTWHorizontalPlotter ObsPlotter
Observation plotter
DTWVerticalPlotter TempPlotter
Template plotter
DTWPathPlotter PathPlotter
Warping path plotter.
int[][] TemplateArray
Two-column array to store template index in GUI (JList) and in DLL.
Implementation of functionalities
Load records from a text file
Triggered by selecting Load data set from the menu.
Filename
from JFileChooser
dialog.
DTWDataSelector
dialog with parameters Data
and Filename
.
DTWDataSelector
dialog has finished its operations.
Save the templates to a text file
Triggered by selecting Save templates from the menu.
Filename
from JFileChooser
dialog
FileIO.saveTemplates
method with parameters Filename
and Data
.
DTWFileIOExceptions
and report them with an error dialog.
Save the observation to a text file
Triggered by selecting Save observation from the menu.
JFileChooser
dialog.
FileIO.saveObservation
method with parameters Filename
and Data
.
DTWFileIOExceptions
and report them with a error dialog.
Load an observation from a text file
Triggered by selecting Load observation from the menu.
Filename
from JFileChooser
dialog.
FileIO.loadObservation
method with Filename
as a parameter.
DTWDataVector
) in a temporary object.
DTWData.setObservation
method with the temporary DTWDataVector
as a parameter.
PathPlotter.setValues
with an empty table to clear the plotting.
ObsPlotter.setValues
method with the temporary DTWDataVector
.
Load templates from a text file
Triggered by selecting Load templates from the menu.
Filename
from JFileChooser
dialog.
FileIO.loadTemplates
method with Filename
as a parameter.
DTWDataVector[]
) in a temporary object array.
DTWData.addTemplates
method with the temporary object array.
UpdateList
method.
Update List
This section describes UpdateList
method
JList
containing templates.
Data.Templates
item and add it in the JList
. Add JList
index to TemplateArray[i][0]
and Data.Templates
index to TemplateArray[i][1]
.
Choose parameters of the DTW algorithm
There is a listener for each of the parameter GUI components. They cause the following events to take place.
PathPlotter.setValues
with an empty table
Data.setParameters
with parameter object newParameters
containing the selections.
Compare observation against one template
Triggered by Compare button.
JList
row.
TemplateArray
and call Data.DTWCompareOne
method with the TemplateArray
row number where the stored number was found as a parameter.
ShowResults
.
Compare observation against all templates
Triggered by CompareAll button.
Data.DTWCompareAll
method.
Data.getResults
, store return value.
getResults
return values. Select the template with shortest wpath from JList
.
CompareOne
.
Show Results
ShowResults method design.
PathPlotter.setPathLength
with the shortest warping path as a parameter.
Data.getWarpingPath
, store return value.
PathPlotter.setValues
with getWarpingPath
return value as a parameter.
Save log from the last algorithm run
Triggered by Log button.
Filename
from a JFileChooser
dialog.
FileIO.saveLog
with Filename
and Data
as parameters.
deleteTemplate
Triggered by Delete button.
JList
.
Data.deleteteTemplate
method with row number.
UpdateList
method.
deleteAllTemplates
Triggered by DeleteAll button.
Data.deleteAllTemplates
method.
UpdateList
method.