diva.sketch.toolbox
Class ZoomRecognizer

java.lang.Object
  extended by diva.sketch.toolbox.ModedIncrRecognizer
      extended by diva.sketch.toolbox.ZoomRecognizer
All Implemented Interfaces:
StrokeRecognizer

public class ZoomRecognizer
extends ModedIncrRecognizer

A recognizer that recognizes "zoom" gestures ("Z") and then zooms in if the the events are "down" and out if the events are "up". ZoomRecognizer calls upon a ClassifyingRecognizer to recognize "Z". Since ClassifyingRecognizer reports results by dispatching events to its listeners, we use a local classification listener in the ZoomRecognizer to receive the events and report back to the ZoomRecognizer.

Version:
$Revision: 1.8 $
Author:
Michael Shilman (michaels@eecs.berkeley.edu), Heloise Hse (hwawen@eecs.berkeley.edu)

Nested Class Summary
static class ZoomRecognizer.ZoomData
          A classification type for zooming.
 
Field Summary
static String LETTER_Z
           
 
Fields inherited from class diva.sketch.toolbox.ModedIncrRecognizer
ACTION, IDLE, UNKNOWN
 
Constructor Summary
ZoomRecognizer(double zoomFactor, StrokeRecognizer r)
          Construct a zoom recognizer with the given scaling factor and a classifying recognizer which has been trained on "Z" shapes..
ZoomRecognizer(StrokeRecognizer r)
          Construct a zoom recognizer with a default scaling factor of 1.0 and a classifying recognizer which has been trained on "Z" shapes.
 
Method Summary
 double getZoomFactor()
          Return the zoom scaling factor for this recognizer.
 RecognitionSet processActionStroke(TimedStroke s)
          Emit zoom events based on whether the mouse has gone up or down.
 int recognizeActionSignal(TimedStroke s)
          Perform the recognition of the "Z".
 void setZoomFactor(double zoomFactor)
          Set the zoom scaling factor for this recognizer.
 
Methods inherited from class diva.sketch.toolbox.ModedIncrRecognizer
strokeCompleted, strokeModified, strokeStarted
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

LETTER_Z

public static final String LETTER_Z
See Also:
Constant Field Values
Constructor Detail

ZoomRecognizer

public ZoomRecognizer(StrokeRecognizer r)
Construct a zoom recognizer with a default scaling factor of 1.0 and a classifying recognizer which has been trained on "Z" shapes.


ZoomRecognizer

public ZoomRecognizer(double zoomFactor,
                      StrokeRecognizer r)
Construct a zoom recognizer with the given scaling factor and a classifying recognizer which has been trained on "Z" shapes..

See Also:
setZoomFactor(double)
Method Detail

getZoomFactor

public double getZoomFactor()
Return the zoom scaling factor for this recognizer.

See Also:
setZoomFactor(double)

processActionStroke

public RecognitionSet processActionStroke(TimedStroke s)
Emit zoom events based on whether the mouse has gone up or down.

Specified by:
processActionStroke in class ModedIncrRecognizer

recognizeActionSignal

public int recognizeActionSignal(TimedStroke s)
Perform the recognition of the "Z".

Specified by:
recognizeActionSignal in class ModedIncrRecognizer

setZoomFactor

public void setZoomFactor(double zoomFactor)
Set the zoom scaling factor for this recognizer. XXX



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