next up previous contents
Next: DTWPathPlotter module detail Up: GUI detailed design Previous: DTWFileIO module detail   Contents

DTWDataPlotter module detail

Private data and data structures

float[] values
A float table containing the values for plotting.

javax.swing.JLabel Name
Plotting name.

javax.swing.JLabel Length
Plotting length.

DTWSelectionPlotter.selectionStart
Selection start point.

DTWSelectionPlotter.selectionEnd
Selection ending point.

DTWSelectionPlotter.mouseListener
A listener for mouse actions in the plotter area. On a mouse event the listener raises an DTWSelectionPlotterEvent that contains the relative coordinate the mouse cursor was in on the moment of click.

Either
java.awt.BufferedImage Plotting
Plotting area image to be scaled into ScaledPlotting.

java.awt.Graphics ScaledPlotting
The plotting area for the component.

Or
java.awt.Graphics2D grap
The plotting area for the component.

Implementation of methods

DTWDataPlotter
Create a new DTWDataPlotter object with width and height specified in parameters.
setValues

  1. Set values for plotter to match with values in newValues.
  2. Draw the plotting with method drawPlotting().
  3. Set Name label to newValues.name.
  4. Set Length label to newValues.values.length()\verb.

DTWHorizontalPlotter.drawPlotting

  1. Find the maximum value from values array.
  2. Create a new int array plotValues[] with size of values.length().
  3. Convert values[] to the array by scaling; The scaling factor is graphicsHeight/maxValue. $plotValues[i] = values[i] * height/maxValue$.
  4. Set distance of two plotting points $plotDistance = graphicsWidth / values.length()$
  5. initialize $currentY = graphicsHeight$ and $currentX = 0$
  6. Draw the plotting:

DTWVerticalPlotter.drawPlotting

  1. Find the maximum value from values array.
  2. Create a new int array plotValues[] with size of values.length().
  3. Convert values[] to the array by scaling; The scaling factor is graphicsWidth/maxValue. $plotValues[i] = values[i] * width/maxValue$.
  4. Set distance of two plotting points $plotDistance = graphicsHeight / values.length()$
  5. initialize $currentY = graphicsHeight$ and $currentX = graphicsWidth$
  6. Draw the plotting:

DTWSelectionPlotter.setSelection

  1. Set this.selectionStart = start
  2. Set this.selectionEnd = end
  3. Invert area covering the selection from the plotter.

DTWSelectionPlotter.getSelectionValues

  1. Create a new array of floats of size $selectionEnd - selectionStart + 1$
  2. Copy values array items from selectionStart to selectionEnd to the new array.
  3. Return the new array.


next up previous contents
Next: DTWPathPlotter module detail Up: GUI detailed design Previous: DTWFileIO module detail   Contents
2002-03-19