edu.mit.sketch.ui
Class TabletGUIBehavior

java.lang.Object
  extended by java.awt.Component
      extended by java.awt.Container
          extended by java.awt.Window
              extended by java.awt.Frame
                  extended by edu.mit.sketch.ui.TabletGUI
                      extended by edu.mit.sketch.ui.TabletDataProcessor
                          extended by edu.mit.sketch.ui.TabletGUIBehavior
All Implemented Interfaces:
java.awt.event.ActionListener, java.awt.event.AdjustmentListener, java.awt.event.MouseListener, java.awt.event.MouseMotionListener, java.awt.image.ImageObserver, java.awt.MenuContainer, java.io.Serializable, java.util.EventListener, javax.accessibility.Accessible

public class TabletGUIBehavior
extends TabletDataProcessor
implements java.awt.event.ActionListener

Acronyms: sdr -> StrokeDataReader, data -> StrokeData This class handles the updates to various frames.

See Also:
Serialized Form

Field Summary
static double a_scale
           
 java.awt.Graphics a_window_graphics
           
static double accumulated_length_scale
           
static float brush_thickness
           
 java.awt.image.BufferedImage buffer
           
 java.awt.Graphics buffer_graphics
           
 boolean buffer_ready
           
static double d_theta_scale
           
 java.awt.Graphics d_window_graphics
           
 java.awt.Graphics dd_dt_window_graphics
           
 boolean display_lsq_vectors
           
 java.awt.TextField filename_field
           
 java.awt.Graphics fits_window_graphics
           
 boolean show_parsed_objects
           
static double t_scale
           
static double theta_scale
           
static double v_scale
           
 java.awt.Graphics v_window_graphics
           
 
Fields inherited from class edu.mit.sketch.ui.TabletDataProcessor
circle_vs_general_path_bias, circle_vs_speed_bias, classifier, combine_treshold, control_module, data, dd_dt_average_scale, debug, debug2, deriving_scale_space, direction_fit, direction_window_width, final_fit, fit_method, gesture_gui, in_recognition_mode, line, LSQE_treshold, object_manager, platform_is_windows9x, polar_points, sdr, sequence_delay, speed_average_scale, speed_fit, test_line_scale, turn_angle_treshold, window_width
 
Fields inherited from class edu.mit.sketch.ui.TabletGUI
a_menu, a_window, bar_statistics_module, controls_menu, d_menu, d_window, data_menu, data_window, dd_dt_menu, dd_dt_scale_space_menu, dd_dt_scale_space_viewer, dd_dt_window, ddsw_statistics_module, debug_graphics, derive_properties_menu, derive_snapshots_menu, direction_menu, display_menu, dsw_statistics_module, edit, file, fits_menu, fits_window, 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, vectors_menu, windows, x_list, y_list
 
Fields inherited from class java.awt.Frame
CROSSHAIR_CURSOR, DEFAULT_CURSOR, E_RESIZE_CURSOR, HAND_CURSOR, ICONIFIED, MAXIMIZED_BOTH, MAXIMIZED_HORIZ, MAXIMIZED_VERT, 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
TabletGUIBehavior(int max_data_points, java.lang.String cursor_image_name, boolean platform_is_windows9x)
          The constructor.
 
Method Summary
 void actionPerformed(java.awt.event.ActionEvent e)
          Handle action events
 void constructToolbar()
          Construct the toolbar
 void convolveChangeInDirection()
          Do convolution.
 void convolveDirection()
          Do convolution.
 void displayFitByIndices(int[] indices)
          displayFitByIndices
 void displayFitByIndices(int[] indices, java.awt.Color edge_color, java.awt.Color vertex_color)
          displayFitByIndices
 void displayFitByPositions(double[] x, double[] y, int[] indices)
          displayFitByPositions
 void displayFitByReversedIndices(int[] indices)
          displayFitByIndices
 void displayVertices(Vertex[] vertices)
          Paint the vertices along with the path combining them
 void displayVerticesAsDots(Vertex[] vertices)
          Paint the vertices along without the path combining them
 void initializeBuffer()
          Overloaded for double buffering.
 void mouseClicked(java.awt.event.MouseEvent e)
          Handle mouse events
 void mouseDragged(java.awt.event.MouseEvent e)
          Handle mouse motion events
 void mouseEntered(java.awt.event.MouseEvent e)
          Handle mouse events
 void mouseExited(java.awt.event.MouseEvent e)
          Handle mouse events
 void mouseMoved(java.awt.event.MouseEvent e)
          Handle mouse motion events
 void mousePressed(java.awt.event.MouseEvent e)
          Handle mouse events
 void mouseReleased(java.awt.event.MouseEvent e)
          Handle mouse events
 void paint_d(StrokeData data, java.awt.Color color)
          Update the direction graph.
 void paint_dd_dt(StrokeData data, java.awt.Color color)
          Update change in direction
 void paint(java.awt.Graphics g)
          Overloaded for double buffering.
 void paintAcceleration(StrokeData data, java.awt.Color color)
          Update the acceleration graph.
 void paintFvsG(double[] f, double[] g, java.awt.Color color, java.awt.Component component, java.awt.geom.AffineTransform transform)
          Paint f vs g in the frame using the input color and affine transform.
 void paintFvsG(long[] f, double[] g, java.awt.Color color, java.awt.Component component, java.awt.geom.AffineTransform transform)
          Paint f vs g in the frame using the input color and affine transform.
 void paintVelocity(StrokeData data, java.awt.Color color)
          Update the velocity graph.
 void setFitMehod(LinearFit.Method method)
          Change the fit method, rederive the direction and related entities.
 void toggle()
          toggle the state related with showing the parsed objects.
 void update_fits()
          Update the info about the various fits (LSQE etc.)
 void update(java.awt.Graphics g)
          Update various graphs and statistics.
 void zoomX(double k)
          Zoom in all window's X axis by k
 void zoomY(double k)
          Zoom in all window's y axis by k
 
Methods inherited from class edu.mit.sketch.ui.TabletDataProcessor
addEventListeners, addPoint, classifyData, combineEndPoints, getDrawComponent, getTimeStamp, processStrokes, reset, setDebugging, setRecognitionMode, simplifyPolygon
 
Methods inherited from class edu.mit.sketch.ui.TabletGUI
adjustmentValueChanged, clearComponent, clearScreen, constructGUI, initializeGraphicsObjects, setInfoMessage, setStatusMessage
 
Methods inherited from class java.awt.Frame
addNotify, getAccessibleContext, getCursorType, getExtendedState, getFrames, getIconImage, getMaximizedBounds, getMenuBar, getState, getTitle, isResizable, isUndecorated, remove, removeNotify, setCursor, setExtendedState, setIconImage, setMaximizedBounds, setMenuBar, setResizable, setState, setTitle, setUndecorated
 
Methods inherited from class java.awt.Window
addPropertyChangeListener, addPropertyChangeListener, addWindowFocusListener, addWindowListener, addWindowStateListener, applyResourceBundle, applyResourceBundle, createBufferStrategy, createBufferStrategy, dispose, getBufferStrategy, getFocusableWindowState, getFocusCycleRootAncestor, getFocusOwner, getFocusTraversalKeys, getGraphicsConfiguration, getInputContext, getListeners, getLocale, getMostRecentFocusOwner, getOwnedWindows, getOwner, getToolkit, getWarningString, getWindowFocusListeners, getWindowListeners, getWindowStateListeners, hide, isActive, isAlwaysOnTop, isFocusableWindow, isFocusCycleRoot, isFocused, isLocationByPlatform, isShowing, pack, postEvent, removeWindowFocusListener, removeWindowListener, removeWindowStateListener, setAlwaysOnTop, setBounds, setCursor, setFocusableWindowState, setFocusCycleRoot, setLocationByPlatform, setLocationRelativeTo, show, toBack, toFront
 
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getAlignmentX, getAlignmentY, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalPolicy, getInsets, getLayout, getMaximumSize, getMinimumSize, getMousePosition, getPreferredSize, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, print, printComponents, remove, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusTraversalKeys, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setFont, setLayout, transferFocusBackward, transferFocusDownCycle, validate
 
Methods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, contains, contains, createImage, createImage, createVolatileImage, createVolatileImage, disable, dispatchEvent, enable, enable, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBackground, getBounds, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphics, getHeight, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocation, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getSize, getTreeLock, getWidth, getX, getY, gotFocus, handleEvent, hasFocus, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isDoubleBuffered, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isOpaque, isPreferredSizeSet, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, prepareImage, prepareImage, printAll, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, repaint, requestFocus, requestFocusInWindow, reshape, resize, resize, setBackground, setBounds, setComponentOrientation, setDropTarget, setEnabled, setFocusable, setFocusTraversalKeysEnabled, setForeground, setIgnoreRepaint, setLocale, setLocation, setLocation, setMaximumSize, setMinimumSize, setName, setPreferredSize, setSize, setSize, setVisible, show, size, toString, transferFocus, transferFocusUpCycle
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface java.awt.MenuContainer
getFont, postEvent
 

Field Detail

a_scale

public static double a_scale

v_scale

public static double v_scale

t_scale

public static double t_scale

theta_scale

public static double theta_scale

d_theta_scale

public static double d_theta_scale

accumulated_length_scale

public static double accumulated_length_scale

brush_thickness

public static float brush_thickness

display_lsq_vectors

public boolean display_lsq_vectors

show_parsed_objects

public boolean show_parsed_objects

buffer_ready

public boolean buffer_ready

buffer

public java.awt.image.BufferedImage buffer

buffer_graphics

public java.awt.Graphics buffer_graphics

v_window_graphics

public java.awt.Graphics v_window_graphics

a_window_graphics

public java.awt.Graphics a_window_graphics

d_window_graphics

public java.awt.Graphics d_window_graphics

fits_window_graphics

public java.awt.Graphics fits_window_graphics

dd_dt_window_graphics

public java.awt.Graphics dd_dt_window_graphics

filename_field

public java.awt.TextField filename_field
Constructor Detail

TabletGUIBehavior

public TabletGUIBehavior(int max_data_points,
                         java.lang.String cursor_image_name,
                         boolean platform_is_windows9x)
The constructor.

Method Detail

initializeBuffer

public void initializeBuffer()
Overloaded for double buffering.


constructToolbar

public void constructToolbar()
Construct the toolbar


paint

public void paint(java.awt.Graphics g)
Overloaded for double buffering.

Overrides:
paint in class java.awt.Container

actionPerformed

public void actionPerformed(java.awt.event.ActionEvent e)
Handle action events

Specified by:
actionPerformed in interface java.awt.event.ActionListener

toggle

public void toggle()
toggle the state related with showing the parsed objects.


mouseReleased

public void mouseReleased(java.awt.event.MouseEvent e)
Handle mouse events

Specified by:
mouseReleased in interface java.awt.event.MouseListener
Overrides:
mouseReleased in class TabletDataProcessor

mouseClicked

public void mouseClicked(java.awt.event.MouseEvent e)
Handle mouse events

Specified by:
mouseClicked in interface java.awt.event.MouseListener
Overrides:
mouseClicked in class TabletDataProcessor

mouseEntered

public void mouseEntered(java.awt.event.MouseEvent e)
Handle mouse events

Specified by:
mouseEntered in interface java.awt.event.MouseListener
Overrides:
mouseEntered in class TabletDataProcessor

mouseExited

public void mouseExited(java.awt.event.MouseEvent e)
Handle mouse events

Specified by:
mouseExited in interface java.awt.event.MouseListener
Overrides:
mouseExited in class TabletDataProcessor

mousePressed

public void mousePressed(java.awt.event.MouseEvent e)
Handle mouse events

Specified by:
mousePressed in interface java.awt.event.MouseListener
Overrides:
mousePressed in class TabletDataProcessor

mouseDragged

public void mouseDragged(java.awt.event.MouseEvent e)
Handle mouse motion events

Specified by:
mouseDragged in interface java.awt.event.MouseMotionListener
Overrides:
mouseDragged in class TabletDataProcessor

mouseMoved

public void mouseMoved(java.awt.event.MouseEvent e)
Handle mouse motion events

Specified by:
mouseMoved in interface java.awt.event.MouseMotionListener
Overrides:
mouseMoved in class TabletDataProcessor

displayVertices

public void displayVertices(Vertex[] vertices)
Paint the vertices along with the path combining them


displayVerticesAsDots

public void displayVerticesAsDots(Vertex[] vertices)
Paint the vertices along without the path combining them


displayFitByReversedIndices

public void displayFitByReversedIndices(int[] indices)
displayFitByIndices


displayFitByPositions

public void displayFitByPositions(double[] x,
                                  double[] y,
                                  int[] indices)
displayFitByPositions


displayFitByIndices

public void displayFitByIndices(int[] indices)
displayFitByIndices


displayFitByIndices

public void displayFitByIndices(int[] indices,
                                java.awt.Color edge_color,
                                java.awt.Color vertex_color)
displayFitByIndices


update

public void update(java.awt.Graphics g)
Update various graphs and statistics.

Overrides:
update in class java.awt.Container

paintVelocity

public void paintVelocity(StrokeData data,
                          java.awt.Color color)
Update the velocity graph.


paintAcceleration

public void paintAcceleration(StrokeData data,
                              java.awt.Color color)
Update the acceleration graph.


paint_d

public void paint_d(StrokeData data,
                    java.awt.Color color)
Update the direction graph.


paint_dd_dt

public void paint_dd_dt(StrokeData data,
                        java.awt.Color color)
Update change in direction


paintFvsG

public void paintFvsG(double[] f,
                      double[] g,
                      java.awt.Color color,
                      java.awt.Component component,
                      java.awt.geom.AffineTransform transform)
Paint f vs g in the frame using the input color and affine transform. f is on the horizontal axis.


paintFvsG

public void paintFvsG(long[] f,
                      double[] g,
                      java.awt.Color color,
                      java.awt.Component component,
                      java.awt.geom.AffineTransform transform)
Paint f vs g in the frame using the input color and affine transform. f is on the horizontal axis.


update_fits

public void update_fits()
Update the info about the various fits (LSQE etc.)


setFitMehod

public void setFitMehod(LinearFit.Method method)
Change the fit method, rederive the direction and related entities. Also update the graphs.


convolveDirection

public void convolveDirection()
Do convolution.


convolveChangeInDirection

public void convolveChangeInDirection()
Do convolution.


zoomY

public void zoomY(double k)
Zoom in all window's y axis by k


zoomX

public void zoomX(double k)
Zoom in all window's X axis by k