diva.sketch.recognition
Class StrokeSceneRecognizer

java.lang.Object
  extended by diva.sketch.recognition.StrokeSceneRecognizer
All Implemented Interfaces:
SceneRecognizer

public class StrokeSceneRecognizer
extends Object
implements SceneRecognizer

A scene recognizer that uses a given stroke recognizer so that the results of its single-stroke recognition get added to the scene properly.

Version:
$Revision: 1.12 $
Author:
Michael Shilman (michaels@eecs.berkeley.edu)

Field Summary
static String STROKE_NAME
          The string ID to access the child of a scene element.
 
Constructor Summary
StrokeSceneRecognizer(StrokeRecognizer r)
          Construct a scene recognizer using the given stroke recognizer to perform single-stroke recognition.
 
Method Summary
 StrokeRecognizer getStrokeRecognzer()
          Return the stroke recognizer that this wraps.
 SceneDeltaSet sessionCompleted(StrokeElement[] session, Scene db)
          Call the child recognizer and add the results, if any, to the given scene database.
 SceneDeltaSet strokeCompleted(StrokeElement se, Scene db)
          Call the child recognizer and add the results, if any, to the given scene database.
 SceneDeltaSet strokeModified(StrokeElement se, Scene db)
          Call the child recognizer and add the results, if any, to the given scene database.
 SceneDeltaSet strokeStarted(StrokeElement se, Scene db)
          Call the child recognizer and add the results, if any, to the given scene database.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

STROKE_NAME

public static final String STROKE_NAME
The string ID to access the child of a scene element. When StrokeSceneRecognizer calls a StrokeRecognizer to perform recognition of individual strokes, it uses this name to point from the SceneElement to the StrokeElement in the scene database. To access the stroke use:
 SceneElement parent = ...
 StrokeElement stroke = parent.getChild(
      StrokeSceneRecognizer.STROKE_NAME);
 
assuming that "parent" is the parent of a stroke element.

See Also:
Constant Field Values
Constructor Detail

StrokeSceneRecognizer

public StrokeSceneRecognizer(StrokeRecognizer r)
Construct a scene recognizer using the given stroke recognizer to perform single-stroke recognition.

Method Detail

getStrokeRecognzer

public StrokeRecognizer getStrokeRecognzer()
Return the stroke recognizer that this wraps.


strokeCompleted

public SceneDeltaSet strokeCompleted(StrokeElement se,
                                     Scene db)
Call the child recognizer and add the results, if any, to the given scene database.

Specified by:
strokeCompleted in interface SceneRecognizer

strokeModified

public SceneDeltaSet strokeModified(StrokeElement se,
                                    Scene db)
Call the child recognizer and add the results, if any, to the given scene database.

Specified by:
strokeModified in interface SceneRecognizer

strokeStarted

public SceneDeltaSet strokeStarted(StrokeElement se,
                                   Scene db)
Call the child recognizer and add the results, if any, to the given scene database.

Specified by:
strokeStarted in interface SceneRecognizer

sessionCompleted

public SceneDeltaSet sessionCompleted(StrokeElement[] session,
                                      Scene db)
Call the child recognizer and add the results, if any, to the given scene database. If the session contains more than one stroke, call the child recognizer for each stroke in the session and append the deltas. (FIXME: does this make sense?)

Specified by:
sessionCompleted in interface SceneRecognizer


Copyright © 2015 Central Laboratory of the Research Councils. All Rights Reserved.