strokes.listeners
Interface StrokeListener

All Known Implementing Classes:
FlickCriterion, StrokeAdapter

public interface StrokeListener

The listener interface for stroke events fired by the stroke shortcuts manager.

The class that is interested in processing stroke events implements this interface (and the method it contains).

The listener object created from that class is then registered to the stroke shortcuts manager manager using the addStrokeListener method on manager.

 StrokeShortcuts manager = new StrokeShortcuts();
 ...
 manager.addStrokeListener(new StrokeListener() {
    public void strokeBegun(StrokeEvent event) {
       System.out.println("New stroke...");
    }
    public void strokePointAdded(StrokeEvent event) {
       System.out.println(".add point.");
    }
    public void shortcutRecognized(StrokeEvent event) {
       System.out.println("...End shortcut: "+event.getStrokeClass());
    }
    public void strokeRecognized(StrokeEvent event) {
       System.out.println("...End stroke: "+event.getStrokeClass());
    }
    public void strokeNotRecognized(StrokeEvent event) {
       System.out.println("...End non recognized stroke.");
    }
 });
 

Author:
Caroline Appert
See Also:
StrokeAdapter, StrokeEvent

Method Summary
 void shortcutRecognized(StrokeEvent event)
          Invoked when a stroke ends and has not been recognized as a shortcut.
 void strokeBegun(StrokeEvent event)
          Invoked when a stroke begins.
 void strokeNotRecognized(StrokeEvent event)
          Invoked when a stroke ends and has not been recognized as a shortcut.
 void strokePointAdded(StrokeEvent event)
          Invoked when a point is added to a stroke.
 void strokeRecognized(StrokeEvent event)
          Invoked when a stroke ends and has been recognized by the stroke shortcuts manager but not as as a shortcut.
 

Method Detail

strokeBegun

void strokeBegun(StrokeEvent event)
Invoked when a stroke begins.

Parameters:
event - The stroke event.

strokePointAdded

void strokePointAdded(StrokeEvent event)
Invoked when a point is added to a stroke.

Parameters:
event - The stroke event.

shortcutRecognized

void shortcutRecognized(StrokeEvent event)
Invoked when a stroke ends and has not been recognized as a shortcut.

Parameters:
event - The stroke event.

strokeRecognized

void strokeRecognized(StrokeEvent event)
Invoked when a stroke ends and has been recognized by the stroke shortcuts manager but not as as a shortcut.

Parameters:
event - The stroke event.

strokeNotRecognized

void strokeNotRecognized(StrokeEvent event)
Invoked when a stroke ends and has not been recognized as a shortcut.

Parameters:
event - The stroke event.