From 17adccabe35b07c9559937d251dc53c1ea69df14 Mon Sep 17 00:00:00 2001 From: AndrewMurrell Date: Mon, 5 May 2014 14:13:26 -0400 Subject: Added MetaCircle and MetaExpression, which aren't useful yet. --- src/us/minak/MetaCircle.java | 17 ++++++++++++++ src/us/minak/MetaExpression.java | 17 ++++++++++++++ src/us/minak/SketchpadView.java~ | 50 ---------------------------------------- 3 files changed, 34 insertions(+), 50 deletions(-) create mode 100644 src/us/minak/MetaCircle.java create mode 100644 src/us/minak/MetaExpression.java delete mode 100644 src/us/minak/SketchpadView.java~ diff --git a/src/us/minak/MetaCircle.java b/src/us/minak/MetaCircle.java new file mode 100644 index 0000000..8741e20 --- /dev/null +++ b/src/us/minak/MetaCircle.java @@ -0,0 +1,17 @@ +package us.minak; + +import android.graphics.Color; + +/* + * Not sure if this should be drawable or what. + * + */ +public class MetaCircle { + public MetaExpression metaExpr; + public int x; + public int y; + public int radius; + public Color color; + public boolean expanded; + public int expansion; //the level of expansion (if multiple circles are expanded, this decides precidence) +} diff --git a/src/us/minak/MetaExpression.java b/src/us/minak/MetaExpression.java new file mode 100644 index 0000000..fec2ddc --- /dev/null +++ b/src/us/minak/MetaExpression.java @@ -0,0 +1,17 @@ +package us.minak; + +public class MetaExpression { + public enum state { + ON, OFF, LOCK + } + + private String value; + + public getValue() { + return this.value; + } + + public setValue(Sitring value) { + this.value = value; + } +} diff --git a/src/us/minak/SketchpadView.java~ b/src/us/minak/SketchpadView.java~ deleted file mode 100644 index 55d69fd..0000000 --- a/src/us/minak/SketchpadView.java~ +++ /dev/null @@ -1,50 +0,0 @@ -import java.util.List; - -import android.gesture.Gesture; -import android.gesture.GestureLibraries; -import android.gesture.GestureLibrary; -import android.gesture.GestureOverlayView; -import android.gesture.GestureOverlayView.OnGesturePerformedListener; -import android.gesture.Prediction; - -public class SketchpadView extends GestureOverlayView implements OnGesturePerformedListener{ - //Setting score thresh hold - private static final double score_threshold = 3.0; - //loads gesture library - private final GestureLibrary gestureLib; - //used to capture drawn gestures - private onGestureRecognizedListener gestureRecognizer; - - public SketchpadView (){ - //not sure what to add here - } - - public void setOnGestureRecognizedListener(OnGestureRecognizedListener onGestureRecognizedListener) { - gestureRecognizer = onGestureRecognizedListener; - } - - @Override - public void onGesturePerformed(GestureOverlayView view, Gesture gesture){ - //create list of predicted characters to be entered - List predictions = gestureLib.recognize(gesture); - Prediction bestPrediction = null; - //if we have a prediction - if(!predictions.isEmpty()){ - //I believe that this just blidnly adds a predicted character without any checks - //we need to see if there is a way to actual get the best prediction - //if this lists them based on the best, then fuck me and ignore this/delete this - bestPrediction = predictions.get(0); - } - //if we have a gesture and a decent prediction - if(gestureRecognizer != null && bestPrediction != null){ - //if the prediction is good enough - if(bestPrediction.score > score_threshold){ - //we recognize it - gestureRecognizer.gestureRecognized(bestPrediction.name); - }else{ - //why? - clear(false); - } - } - } -} -- cgit v1.2.3-54-g00ecf