Home | History | Annotate | Download | only in gesture

Lines Matching defs:gesture

17 package android.gesture;
34 import static android.gesture.GestureConstants.LOG_TAG;
37 * GestureLibrary maintains gesture examples and makes predictions on a new
38 * gesture
51 // Gesture
52 // 8 bytes long Gesture ID
82 private final HashMap<String, ArrayList<Gesture>> mNamedGestures =
83 new HashMap<String, ArrayList<Gesture>>();
94 * Specify how the gesture library will handle orientation.
122 * Get all the gesture entry names in the library
131 * Recognize a gesture
133 * @param gesture the query
134 * @return a list of predictions of possible entries for a given gesture
136 public ArrayList<Prediction> recognize(Gesture gesture) {
138 mOrientationStyle, gesture, null);
143 * Add a gesture for the entry
146 * @param gesture
148 public void addGesture(String entryName, Gesture gesture) {
152 ArrayList<Gesture> gestures = mNamedGestures.get(entryName);
154 gestures = new ArrayList<Gesture>();
157 gestures.add(gesture);
159 Instance.createInstance(mSequenceType, mOrientationStyle, gesture, entryName));
164 * Remove a gesture from the library. If there are no more gestures for the
165 * given entry, the gesture entry will be removed.
168 * @param gesture
170 public void removeGesture(String entryName, Gesture gesture) {
171 ArrayList<Gesture> gestures = mNamedGestures.get(entryName);
176 gestures.remove(gesture);
183 mClassifier.removeInstance(gesture.getID());
205 public ArrayList<Gesture> getGestures(String entryName) {
206 ArrayList<Gesture> gestures = mNamedGestures.get(entryName);
208 return new ArrayList<Gesture>(gestures);
219 * Save the gesture library
234 final HashMap<String, ArrayList<Gesture>> maps = mNamedGestures;
243 for (Map.Entry<String, ArrayList<Gesture>> entry : maps.entrySet()) {
245 final ArrayList<Gesture> examples = entry.getValue();
272 * Load the gesture library
308 final HashMap<String, ArrayList<Gesture>> namedGestures = mNamedGestures;
320 final ArrayList<Gesture> gestures = new ArrayList<Gesture>(gestureCount);
322 final Gesture gesture = Gesture.deserialize(in);
323 gestures.add(gesture);
325 Instance.createInstance(mSequenceType, mOrientationStyle, gesture, name));