: Class Tablet

Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## Class Tablet

    java.lang.Object
      |
      +--java.awt.Component
            |
            +--java.awt.Container
                  |
                  +--java.awt.Window
                        |
                        +--java.awt.Frame
                              |
                              +--Tablet

class Tablet
extends java.awt.Frame
implements java.awt.event.ActionListener, java.awt.event.KeyListener, java.awt.event.MouseMotionListener, java.awt.event.MouseListener

In this class last_index refers to the index of the last point read in the points array (ie. it can directly be used to access the last point entered. last_index is actually one less than the number of calid points in the points array. Due to derivation, speed array's length is equal to last_index. Also acceleration's legnth is (last_index-1). Time array has the same length as points. It stores the time that was supplied to addPoint( Point point, long time ) method. In order to make proper use of cached data, additions to points and time array should be done via the addPoint( Point point, long time ) method.

See Also:
  Serialized Form

Inner classes inherited from class java.awt.Component
`java.awt.Component.AWTTreeLock`

Field Summary
`boolean` | `a_is_valid`
`java.awt.MenuItem` | `a_menu`
`double` | `a_scale`
`java.awt.Frame` | `a_window`
`java.awt.Graphics` | `a_window_graphics`
`double[]` | `acceleration`
`static StatisticsModule` | `bar_statistics_module`
`Point` | `center`
`double` | `combine_treshold`
`private ControlModule` | `control_module`
`java.awt.MenuItem` | `controls_menu`
`double[]` | `d`
`boolean` | `d_is_valid`
`java.awt.MenuItem` | `d_menu`
`double` | `d_theta_scale`
`java.awt.Frame` | `d_window`
`java.awt.Graphics` | `d_window_graphics`
`double[]` | `dd_dt`
`boolean` | `dd_dt_is_valid`
`java.awt.MenuItem` | `dd_dt_menu`
`java.awt.Frame` | `dd_dt_window`
`java.awt.Graphics` | `dd_dt_window_graphics`
`static boolean` | `debug`
`static java.awt.Graphics` | `debug_graphics`
`static boolean` | `debug2`
`java.awt.Menu` | `direction_menu`
`boolean` | `display_lsq_vectors`
`java.awt.MenuItem` | `display_menu`
`java.awt.Menu` | `edit`
`java.awt.Menu` | `file`
`boolean` | `FILTER_ON`
`boolean` | `in_recognition_mode`
`int` | `last_index`
`Point[]` | `line`
`Point` | `lower_left`
`java.awt.MenuBar` | `menubar`
`private ObjectManager` | `object_manager`
`private java.awt.Dimension` | `off_dimension`
`java.awt.Menu` | `options`
`double` | `orientation_angle`
`Point[]` | `output_polygon`
`java.awt.Menu` | `pen_menu`
`Point[]` | `points`
`PolarPoint[]` | `polar_points`
`boolean` | `polar_points_is_valid`
`java.awt.MenuItem` | `quit_menu`
`java.awt.Dimension` | `radius`
`double` | `scale`
`double` | `sd_scale`
`static long` | `sequence_delay`
`boolean` | `show_parsed_objects`
`static StatisticsModule` | `sliding_window_statistics_module`
`double[]` | `speed`
`java.awt.MenuItem` | `statistics_menu`
`double` | `step_angle`
`double` | `t_scale`
`double` | `theta_scale`
`long[]` | `time`
`double` | `turn_angle_treshold`
`java.awt.MenuItem` | `undo_menu`
`Point` | `upper_right`
`boolean` | `v_is_valid`
`java.awt.MenuItem` | `v_menu`
`double` | `v_scale`
`java.awt.Frame` | `v_window`
`java.awt.Graphics` | `v_window_graphics`
`java.awt.MenuItem` | `vectors_menu`
`static double` | `window_width`
`java.awt.Menu` | `windows`
`static java.awt.Graphics` | `x_window_graphics`

Fields inherited from class java.awt.Frame
`base, CROSSHAIR_CURSOR, DEFAULT_CURSOR, E_RESIZE_CURSOR, frameSerializedDataVersion, HAND_CURSOR, icon, ICONIFIED, mbManagement, menuBar, MOVE_CURSOR, N_RESIZE_CURSOR, nameCounter, NE_RESIZE_CURSOR, NORMAL, NW_RESIZE_CURSOR, ownedWindows, resizable, S_RESIZE_CURSOR, SE_RESIZE_CURSOR, serialVersionUID, state, SW_RESIZE_CURSOR, TEXT_CURSOR, title, W_RESIZE_CURSOR, WAIT_CURSOR, weakThis`

Fields inherited from class java.awt.Window
`active, base, focusMgr, inputContext, nameCounter, OPENED, ownedWindowList, serialVersionUID, state, warningString, weakThis, windowListener, windowSerializedDataVersion`

Fields inherited from class java.awt.Container
`component, containerListener, containerSerializedDataVersion, dispatcher, layoutMgr, maxSize, ncomponents, serialVersionUID`

Fields inherited from class java.awt.Component
`actionListenerK, adjustmentListenerK, appContext, assert, background, BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, changeSupport, componentListener, componentListenerK, componentOrientation, componentSerializedDataVersion, containerListenerK, cursor, dropTarget, enabled, eventMask, focusListener, focusListenerK, font, foreground, hasFocus, height, incRate, inputMethodListener, inputMethodListenerK, isInc, isPacked, itemListenerK, keyListener, keyListenerK, LEFT_ALIGNMENT, locale, LOCK, minSize, mouseListener, mouseListenerK, mouseMotionListener, mouseMotionListenerK, name, nameExplicitlySet, newEventsOnly, ownedWindowK, parent, peer, peerFont, popups, prefSize, RIGHT_ALIGNMENT, serialVersionUID, textListenerK, TOP_ALIGNMENT, valid, visible, width, windowListenerK, x, y`

Constructor Summary
`Tablet(int max_data_points, double s, double avg_scale, java.lang.String cursor_image_name)` The constructor.

Method Summary
`void` | `actionPerformed(java.awt.event.ActionEvent e)` Handle action events
`void` | `addPoint(Point p, long t)` Add a new point to points, and the corresponding time info to time.
`double` | `averageSpeed()` Average speed
`void` | `clearScreen()` Clear screen
`void` | `clearScreenStrong()` Clear screen strong (works in debug mode).
`void` | `combineEndPoints()` Combines the ends of the polygon if they are sufficiently close.
`void` | `derive_d()` Derive direction, and fill in the d array.
`void` | `derive_dd_dt()` Derive time derivative of direction, and fill in the dd_dt array.
`void` | `deriveAcceleration()` Derive acceleration, and fill in the acceleration array.
`void` | `deriveBoundingBox()` Derive the bounding box for thee points.
`void` | `derivePolarCoordinates()` Derive the polar coordinates of the points with respect to the center.
`void` | `deriveSpeed()` Derive speed, and fill in the speed array.
`void` | `filter()` Try to get rid of some of the noise.
`Polygon` | `getDataPoints()` Put the valid points in the points array in a Polygon and return it.
`int[]` | `getPolygonIndices()` calculate the lsq error.
`void` | `invalidateCaches()` Invalidates caches
`void` | `keyPressed(java.awt.event.KeyEvent k)` Handle key stroke events
`void` | `keyReleased(java.awt.event.KeyEvent k)` Handle key stroke events
`void` | `keyTyped(java.awt.event.KeyEvent k)` Handle key stroke events
`double` | `leastSquaresForCircle()` calculate the lsq error.
`double` | `leastSquaresForPolygon()` calculate the lsq error.
`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` | `normalizePolygon()` Modify the polygon, so that the lines appear as the user wanted them to be (ie, get rid of the small rotations and shifts.
`void` | `paint(java.awt.Graphics g)` Overloaded for double buffering.
`void` | `plot_output_circle()` Plot the recognized circle if one was recognized.
`void` | `plot_output_line()` Plot the recognized line if one was recognized.
`void` | `plot_output_polygon()` Plot the recognized polygon if one was recognized.
`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.
`void` | `simplifyPolygon()` Simplify the polygon to get rid of consecutive lines which are sufficiently parallel.
`void` | `sleep(int iterations)` Do useless work for some number of iterations specified by the argument.
`boolean` | `test_circle()` See if the input was meant to be a circle.
`boolean` | `test_line()` See if the input is a line.
`boolean` | `test_polygon()` See if the input is a polygon.
`void` | `update_d()` Update the direction graph.
`void` | `update_dd_dt()` Update change in direction
`void` | `update(java.awt.Graphics g)` Handle double buffering and do the real drawing.
`void` | `updateAcceleration()` Update the acceleration graph.
`void` | `updateMain()` Update the main graph.
`void` | `updateVelocity()` Update the velocity graph.

Methods inherited from class java.awt.Frame
`, addNotify, addToFrameList, constructComponentName, finalize, getCursorType, getFrames, getIconImage, getMenuBar, getState, getTitle, initIDs, isResizable, paramString, postProcessKeyEvent, readObject, remove, removeFromFrameList, removeNotify, setCursor, setIconImage, setMenuBar, setResizable, setState, setTitle, writeObject`

Methods inherited from class java.awt.Window
`addOwnedWindow, addWindowListener, applyResourceBundle, applyResourceBundle, connectOwnedWindow, dispatchEventImpl, dispose, eventEnabled, getFocusOwner, getInputContext, getLocale, getOwnedWindows, getOwner, getToolkit, getWarningString, hide, isActive, isShowing, nextFocus, ownedInit, pack, postEvent, postWindowEvent, preProcessKeyEvent, processEvent, processWindowEvent, removeOwnedWindow, removeWindowListener, setCursor, setFocusOwner, setWarningString, show, toBack, toFront, transferFocus`

Methods inherited from class java.awt.Container
`add, add, add, add, add, addContainerListener, addImpl, applyOrientation, countComponents, deliverEvent, dispatchEventToSelf, doLayout, findComponentAt, findComponentAt, getAlignmentX, getAlignmentY, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents_NoClientCode, getComponents, getCursorTarget, getInsets, getLayout, getMaximumSize, getMinimumSize, getMouseEventTarget, getPreferredSize, getWindow, insets, invalidate, invalidateTree, isAncestorOf, layout, lightweightPrint, list, list, locate, minimumSize, paintComponents, postsOldMouseEvents, preferredSize, print, printComponents, printOneComponent, processContainerEvent, proxyEnableEvents, proxyRequestFocus, remove, remove, removeAll, removeContainerListener, setFont, setLayout, updateCursor, validate, validateTree`

Methods inherited from class java.awt.Component
`action, add, addComponentListener, addFocusListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addPropertyChangeListener, addPropertyChangeListener, areInputMethodsEnabled, bounds, checkImage, checkImage, coalesceEvents, contains, contains, createImage, createImage, disable, disableEvents, dispatchEvent, enable, enable, enableEvents, enableInputMethods, firePropertyChange, getBackground, getBounds, getBounds, getColorModel, getComponentOrientation, getCursor, getDropTarget, getFont_NoClientCode, getFont, getFontMetrics, getForeground, getGraphics, getHeight, getInputMethodRequests, getIntrinsicCursor, getLocation, getLocation, getLocationOnScreen, getName, getNativeContainer, getParent_NoClientCode, getParent, getPeer, getSize, getSize, getToolkitImpl, getTreeLock, getWidth, getWindowForObject, getX, getY, gotFocus, handleEvent, hasFocus, imageUpdate, inside, isDisplayable, isDoubleBuffered, isEnabled, isEnabledImpl, 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, processInputMethodEvent, processKeyEvent, processMouseEvent, processMouseMotionEvent, removeComponentListener, removeFocusListener, 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, registerNatives, wait, wait, wait`

Field Detail

### last_index

    public int last_index

### points

    public Point[] points

### output_polygon

    public Point[] output_polygon

### time

    public long[] time

### speed

    public double[] speed

### acceleration

    public double[] acceleration

### d

    public double[] d

### dd_dt

    public double[] dd_dt

### polar_points

    public PolarPoint[] polar_points

### scale

    public double scale

### a_scale

    public double a_scale

### v_scale

    public double v_scale

### t_scale

    public double t_scale

### theta_scale

    public double theta_scale

### combine_treshold

    public double combine_treshold

### d_theta_scale

    public double d_theta_scale

### sd_scale

    public double sd_scale

### step_angle

    public double step_angle

### orientation_angle

    public double orientation_angle

### turn_angle_treshold

    public double turn_angle_treshold

### lower_left

    public Point lower_left

### upper_right

    public Point upper_right

### center

    public Point center

### radius

    public java.awt.Dimension radius

### line

    public Point[] line

### polar_points_is_valid

    public boolean polar_points_is_valid

### v_is_valid

    public boolean v_is_valid

### a_is_valid

    public boolean a_is_valid

### d_is_valid

    public boolean d_is_valid

### dd_dt_is_valid

    public boolean dd_dt_is_valid

### display_lsq_vectors

    public boolean display_lsq_vectors

### show_parsed_objects

    public boolean show_parsed_objects

### in_recognition_mode

    public boolean in_recognition_mode

### v_window

    public java.awt.Frame v_window

### a_window

    public java.awt.Frame a_window

### d_window

    public java.awt.Frame d_window

### dd_dt_window

    public java.awt.Frame dd_dt_window

### menubar

    public java.awt.MenuBar menubar

### file

    public java.awt.Menu file

### quit_menu

    public java.awt.MenuItem quit_menu

### edit

    public java.awt.Menu edit

### undo_menu

    public java.awt.MenuItem undo_menu

### windows

    public java.awt.Menu windows

### v_menu

    public java.awt.MenuItem v_menu

### a_menu

    public java.awt.MenuItem a_menu

### pen_menu

    public java.awt.Menu pen_menu

### direction_menu

    public java.awt.Menu direction_menu

### d_menu

    public java.awt.MenuItem d_menu

### dd_dt_menu

    public java.awt.MenuItem dd_dt_menu

### controls_menu

    public java.awt.MenuItem controls_menu

### statistics_menu

    public java.awt.MenuItem statistics_menu

### options

    public java.awt.Menu options

### vectors_menu

    public java.awt.MenuItem vectors_menu

### display_menu

    public java.awt.MenuItem display_menu

### debug

    public static boolean debug

### debug2

    public static boolean debug2

### x_window_graphics

    public static java.awt.Graphics x_window_graphics

### debug_graphics

    public static java.awt.Graphics debug_graphics

### bar_statistics_module

    public static StatisticsModule bar_statistics_module

### sliding_window_statistics_module

    public static StatisticsModule sliding_window_statistics_module

### window_width

    public static double window_width

### 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

### dd_dt_window_graphics

    public java.awt.Graphics dd_dt_window_graphics

### off_dimension

    private java.awt.Dimension off_dimension

### sequence_delay

    public static long sequence_delay

### FILTER_ON

    public final boolean FILTER_ON

### object_manager

    private ObjectManager object_manager

### control_module

    private ControlModule control_module

Constructor Detail

### Tablet

    public Tablet(int max_data_points,
                  double s,
                  double avg_scale,
                  java.lang.String cursor_image_name)

  The constructor.

Method Detail

### setDebugging

    public void setDebugging(boolean d)

  Set debugging mode

### paint

    public void paint(java.awt.Graphics g)

  Overloaded for double buffering.
  Overrides:
    paint in class java.awt.Container

### keyPressed

    public void keyPressed(java.awt.event.KeyEvent k)

  Handle key stroke events
  Specified by:
    keyPressed in interface java.awt.event.KeyListener

### keyReleased

    public void keyReleased(java.awt.event.KeyEvent k)

  Handle key stroke events
  Specified by:
    keyReleased in interface java.awt.event.KeyListener

### keyTyped

    public void keyTyped(java.awt.event.KeyEvent k)

  Handle key stroke events
  Specified by:
    keyTyped in interface java.awt.event.KeyListener

### actionPerformed

    public void actionPerformed(java.awt.event.ActionEvent e)

  Handle action events
  Specified by:
    actionPerformed in interface java.awt.event.ActionListener

### mouseClicked

    public void mouseClicked(java.awt.event.MouseEvent e)

  Handle mouse events
  Specified by:
    mouseClicked in interface java.awt.event.MouseListener

### mouseEntered

    public void mouseEntered(java.awt.event.MouseEvent e)

  Handle mouse events
  Specified by:
    mouseEntered in interface java.awt.event.MouseListener

### mouseExited

    public void mouseExited(java.awt.event.MouseEvent e)

  Handle mouse events
  Specified by:
    mouseExited in interface java.awt.event.MouseListener

### mousePressed

    public void mousePressed(java.awt.event.MouseEvent e)

  Handle mouse events
  Specified by:
    mousePressed in interface java.awt.event.MouseListener

### reset

    public void reset()

  Reset the arrays

### addPoint

    public void addPoint(Point p,
                         long t)

  Add a new point to points, and the corresponding time info to time. This method is solely for the purpose of making caching easier through abstraction. All changes to points[] and time[] is to be done through this method.

### 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.

### invalidateCaches

    public void invalidateCaches()

  Invalidates caches

### mouseReleased

    public void mouseReleased(java.awt.event.MouseEvent e)

  Handle mouse events
  Specified by:
    mouseReleased in interface java.awt.event.MouseListener

### mouseDragged

    public void mouseDragged(java.awt.event.MouseEvent e)

  Handle mouse motion events
  Specified by:
    mouseDragged in interface java.awt.event.MouseMotionListener

### clearScreen

    public void clearScreen()

  Clear screen

### clearScreenStrong

    public void clearScreenStrong()

  Clear screen strong (works in debug mode).

### mouseMoved

    public void mouseMoved(java.awt.event.MouseEvent e)

  Handle mouse motion events
  Specified by:
    mouseMoved in interface java.awt.event.MouseMotionListener

### update

    public void update(java.awt.Graphics g)

  Handle double buffering and do the real drawing.
  Overrides:
    update in class java.awt.Container

### updateMain

    public void updateMain()

  Update the main graph.

### updateVelocity

    public void updateVelocity()

  Update the velocity graph.

### updateAcceleration

    public void updateAcceleration()

  Update the acceleration graph.

### update_d

    public void update_d()

  Update the direction graph.

### update_dd_dt

    public void update_dd_dt()

  Update change in direction

### filter

    public void filter()

  Try to get rid of some of the noise.

### deriveSpeed

    public void deriveSpeed()

  Derive speed, and fill in the speed array. This method should cache data in order to save computation.

### getDataPoints

    public Polygon getDataPoints()

  Put the valid points in the points array in a Polygon and return it.

### derivePolarCoordinates

    public void derivePolarCoordinates()

  Derive the polar coordinates of the points with respect to the center. Also determine the center, upper_right and lower right points (for surrounding rectangle).

### deriveBoundingBox

    public void deriveBoundingBox()

  Derive the bounding box for thee points. Determine the center of the points, upper_right and lower right points (for surrounding rectangle).

### deriveAcceleration

    public void deriveAcceleration()

  Derive acceleration, and fill in the acceleration array.

### derive_d

    public void derive_d()

  Derive direction, and fill in the d array.

### derive_dd_dt

    public void derive_dd_dt()

  Derive time derivative of direction, and fill in the dd_dt array.

### averageSpeed

    public double averageSpeed()

  Average speed

### test_circle

    public boolean test_circle()

  See if the input was meant to be a circle.

### plot_output_circle

    public void plot_output_circle()

  Plot the recognized circle if one was recognized.

### test_polygon

    public boolean test_polygon()

  See if the input is a polygon.

### test_line

    public boolean test_line()

  See if the input is a line.

### normalizePolygon

    public void normalizePolygon()

  Modify the polygon, so that the lines appear as the user wanted them to be (ie, get rid of the small rotations and shifts. (For example usually lines which look horizontal were meant to be perfectly horizontal.

### combineEndPoints

    public void combineEndPoints()

  Combines the ends of the polygon if they are sufficiently close.

### simplifyPolygon

    public void simplifyPolygon()

  Simplify the polygon to get rid of consecutive lines which are sufficiently parallel.

### plot_output_line

    public void plot_output_line()

  Plot the recognized line if one was recognized.

### plot_output_polygon

    public void plot_output_polygon()

  Plot the recognized polygon if one was recognized.

### getPolygonIndices

    public int[] getPolygonIndices()

  calculate the lsq error.

### leastSquaresForPolygon

    public double leastSquaresForPolygon()

  calculate the lsq error.

### leastSquaresForCircle

    public double leastSquaresForCircle()

  calculate the lsq error.

### sleep

    public void sleep(int iterations)

  Do useless work for some number of iterations specified by the argument.

Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD