edu.mit.sketch.ui
Class TabletDataProcessor

java.lang.Object
  |
  +--java.awt.Component
        |
        +--java.awt.Container
              |
              +--java.awt.Window
                    |
                    +--java.awt.Frame
                          |
                          +--edu.mit.sketch.ui.TabletGUI
                                |
                                +--edu.mit.sketch.ui.TabletDataProcessor
All Implemented Interfaces:
Accessible, AdjustmentListener, EventListener, ImageObserver, MenuContainer, MouseListener, MouseMotionListener, Serializable
Direct Known Subclasses:
TabletGUIBehavior

public class TabletDataProcessor
extends TabletGUI
implements MouseMotionListener, MouseListener

This class is for reading mouse input and processing it. Various fits are generated and stored here. Acronyms: sdr -> StrokeDataReader, sd -> StrokeData

See Also:
Serialized Form

Inner classes inherited from class java.awt.Frame
Frame.AccessibleAWTFrame
 
Inner classes inherited from class java.awt.Window
Window.AccessibleAWTWindow
 
Inner classes inherited from class java.awt.Container
Container.AccessibleAWTContainer
 
Inner classes inherited from class java.awt.Component
Component.AccessibleAWTComponent
 
Field Summary
 double circle_vs_general_path_bias
           
 double circle_vs_speed_bias
           
 SimpleClassifier classifier
           
 double combine_treshold
           
 ControlModule control_module
           
static StrokeData data
          Stroke data
 double dd_dt_average_scale
           
static boolean debug
           
static boolean debug2
           
 boolean deriving_scale_space
           
 Vertex[] direction_fit
           
 int direction_window_width
           
 Vertex[] final_fit
           
static int fit_method
           
 GestureGUI gesture_gui
           
 boolean in_recognition_mode
           
 Point[] line
          Parameters and constants.
static double LSQE_treshold
           
 ObjectManager object_manager
           
static boolean platform_is_windows9x
           
 PolarPoint[] polar_points
           
static StrokeDataReader sdr
          Stroke data reader used for reading and instantiating StrokeData
static long sequence_delay
           
 double speed_average_scale
           
 Vertex[] speed_fit
           
 double test_line_scale
           
 double turn_angle_treshold
           
static double window_width
           
 
Fields inherited from class edu.mit.sketch.ui.TabletGUI
a_menu, a_window, a_window_graphics, bar_statistics_module, controls_menu, d_menu, d_window, d_window_graphics, data_menu, data_window, dd_dt_menu, dd_dt_scale_space_menu, dd_dt_scale_space_viewer, dd_dt_window, dd_dt_window_graphics, ddsw_statistics_module, debug_graphics, derive_properties_menu, derive_snapshots_menu, direction_menu, display_menu, dsw_statistics_module, edit, file, fits_menu, fits_window, fits_window_graphics, gesture_gui_menu, graph_color, info_bar, joint_display, joint_display_menu, menubar, open_menu, options, pen_menu, processing, quit_menu, save_as_menu, save_features_menu, save_menu, sliding_window_statistics_module, statistics_menu, status_bar, undo_menu, v_menu, v_scale_space_menu, v_scale_space_viewer, v_window, v_window_graphics, vectors_menu, windows, x_list, y_list
 
Fields inherited from class java.awt.Frame
CROSSHAIR_CURSOR, DEFAULT_CURSOR, E_RESIZE_CURSOR, HAND_CURSOR, ICONIFIED, MOVE_CURSOR, N_RESIZE_CURSOR, NE_RESIZE_CURSOR, NORMAL, NW_RESIZE_CURSOR, S_RESIZE_CURSOR, SE_RESIZE_CURSOR, SW_RESIZE_CURSOR, TEXT_CURSOR, W_RESIZE_CURSOR, WAIT_CURSOR
 
Fields inherited from class java.awt.Component
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
 
Fields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
 
Constructor Summary
TabletDataProcessor(int max_data_points, String cursor_image_name, boolean platform_is_windows9x)
          The constructor.
 
Method Summary
 void addEventListeners()
          add event listeners
 void addPoint(Point p, long t)
          Add a new point to sdr with t as the time stamp.
 void classifyData(StrokeData data)
          Handle mouse events
 Vertex[] combineEndPoints(Vertex[] polygon)
          Combines the ends of the polygon if they are sufficiently close.
 long getTimeStamp(MouseEvent e)
          This method is needed only for supporting the rather silly windows9X platform, because it is still using the dos clock.
 void mouseClicked(MouseEvent e)
          Handle mouse events
 void mouseDragged(MouseEvent e)
          Handle mouse motion events
 void mouseEntered(MouseEvent e)
          Handle mouse events
 void mouseExited(MouseEvent e)
          Handle mouse events
 void mouseMoved(MouseEvent e)
          Handle mouse motion events
 void mousePressed(MouseEvent e)
          Handle mouse events
 void mouseReleased(MouseEvent e)
          Handle mouse events
 void mouseReleased2(MouseEvent e)
          Handle mouse events
 void reset()
          Reset the arrays
 void setDebugging(boolean d)
          Set debugging mode
 void setRecognitionMode(boolean flag)
          Disable or enable recognition process by turning mouse event listening off or on.
 Vertex[] simplifyPolygon(Vertex[] input_vertices)
          Simplify the polygon to get rid of consecutive lines which are sufficiently parallel.
 
Methods inherited from class edu.mit.sketch.ui.TabletGUI
adjustmentValueChanged, clearComponent, clearScreen, constructGUI, initializeGraphicsObjects, setInfoMessage, setStatusMessage
 
Methods inherited from class java.awt.Frame
addNotify, finalize, getAccessibleContext, getCursorType, getFrames, getIconImage, getMenuBar, getState, getTitle, isResizable, paramString, remove, removeNotify, setCursor, setIconImage, setMenuBar, setResizable, setState, setTitle
 
Methods inherited from class java.awt.Window
addWindowListener, applyResourceBundle, applyResourceBundle, dispose, getFocusOwner, getGraphicsConfiguration, getInputContext, getListeners, getLocale, getOwnedWindows, getOwner, getToolkit, getWarningString, hide, isShowing, pack, postEvent, processEvent, processWindowEvent, removeWindowListener, setCursor, show, toBack, toFront
 
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, addImpl, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getAlignmentX, getAlignmentY, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getInsets, getLayout, getMaximumSize, getMinimumSize, getPreferredSize, insets, invalidate, isAncestorOf, layout, list, list, locate, minimumSize, paint, paintComponents, preferredSize, print, printComponents, processContainerEvent, remove, remove, removeAll, removeContainerListener, setFont, setLayout, update, validate, validateTree
 
Methods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addPropertyChangeListener, addPropertyChangeListener, bounds, checkImage, checkImage, coalesceEvents, contains, contains, createImage, createImage, disable, disableEvents, dispatchEvent, enable, enable, enableEvents, enableInputMethods, firePropertyChange, getBackground, getBounds, getBounds, getColorModel, getComponentOrientation, getCursor, getDropTarget, getFont, getFontMetrics, getForeground, getGraphics, getHeight, getInputMethodRequests, getLocation, getLocation, getLocationOnScreen, getName, getParent, getPeer, getSize, getSize, getTreeLock, getWidth, getX, getY, gotFocus, handleEvent, hasFocus, imageUpdate, inside, isDisplayable, isDoubleBuffered, isEnabled, isFocusTraversable, isLightweight, isOpaque, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, prepareImage, prepareImage, printAll, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processKeyEvent, processMouseEvent, processMouseMotionEvent, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, repaint, requestFocus, reshape, resize, resize, setBackground, setBounds, setBounds, setComponentOrientation, setDropTarget, setEnabled, setForeground, setLocale, setLocation, setLocation, setName, setSize, setSize, setVisible, show, size, toString, transferFocus
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface java.awt.MenuContainer
getFont, postEvent
 

Field Detail

sdr

public static StrokeDataReader sdr
Stroke data reader used for reading and instantiating StrokeData

data

public static StrokeData data
Stroke data

final_fit

public Vertex[] final_fit

speed_fit

public Vertex[] speed_fit

direction_fit

public Vertex[] direction_fit

polar_points

public PolarPoint[] polar_points

direction_window_width

public int direction_window_width

dd_dt_average_scale

public double dd_dt_average_scale

speed_average_scale

public double speed_average_scale

test_line_scale

public double test_line_scale

combine_treshold

public double combine_treshold

turn_angle_treshold

public double turn_angle_treshold

circle_vs_speed_bias

public double circle_vs_speed_bias

circle_vs_general_path_bias

public double circle_vs_general_path_bias

line

public Point[] line
Parameters and constants.

in_recognition_mode

public boolean in_recognition_mode

deriving_scale_space

public boolean deriving_scale_space

platform_is_windows9x

public static boolean platform_is_windows9x

debug

public static boolean debug

debug2

public static boolean debug2

fit_method

public static int fit_method

window_width

public static double window_width

sequence_delay

public static long sequence_delay

LSQE_treshold

public static double LSQE_treshold

object_manager

public ObjectManager object_manager

control_module

public ControlModule control_module

gesture_gui

public GestureGUI gesture_gui

classifier

public SimpleClassifier classifier
Constructor Detail

TabletDataProcessor

public TabletDataProcessor(int max_data_points,
                           String cursor_image_name,
                           boolean platform_is_windows9x)
The constructor.
Method Detail

addEventListeners

public void addEventListeners()
add event listeners

classifyData

public void classifyData(StrokeData data)
Handle mouse events

mouseReleased2

public void mouseReleased2(MouseEvent e)
Handle mouse events

mouseReleased

public void mouseReleased(MouseEvent e)
Handle mouse events
Specified by:
mouseReleased in interface MouseListener

setDebugging

public void setDebugging(boolean d)
Set debugging mode

mouseClicked

public void mouseClicked(MouseEvent e)
Handle mouse events
Specified by:
mouseClicked in interface MouseListener

mouseEntered

public void mouseEntered(MouseEvent e)
Handle mouse events
Specified by:
mouseEntered in interface MouseListener

mouseExited

public void mouseExited(MouseEvent e)
Handle mouse events
Specified by:
mouseExited in interface MouseListener

mousePressed

public void mousePressed(MouseEvent e)
Handle mouse events
Specified by:
mousePressed in interface MouseListener

reset

public void reset()
Reset the arrays

addPoint

public void addPoint(Point p,
                     long t)
Add a new point to sdr with t as the time stamp.

setRecognitionMode

public void setRecognitionMode(boolean flag)
Disable or enable recognition process by turning mouse event listening off or on. Set flag to be true if enabling is desired. Set flag to be false if disabling is desired.

mouseDragged

public void mouseDragged(MouseEvent e)
Handle mouse motion events
Specified by:
mouseDragged in interface MouseMotionListener

mouseMoved

public void mouseMoved(MouseEvent e)
Handle mouse motion events
Specified by:
mouseMoved in interface MouseMotionListener

combineEndPoints

public Vertex[] combineEndPoints(Vertex[] polygon)
Combines the ends of the polygon if they are sufficiently close.

simplifyPolygon

public Vertex[] simplifyPolygon(Vertex[] input_vertices)
Simplify the polygon to get rid of consecutive lines which are sufficiently parallel.

getTimeStamp

public long getTimeStamp(MouseEvent e)
This method is needed only for supporting the rather silly windows9X platform, because it is still using the dos clock.