edu.berkeley.guir.lib.gesture
Class Feature
java.lang.Object
|
+--java.util.Observable
|
+--edu.berkeley.guir.lib.gesture.Feature
- All Implemented Interfaces:
- Observer, Serializable
- Direct Known Subclasses:
- AnglePerDistance, Aspect, BoundsAngle, BoundsSize, Curviness, Curviness2, Density1, Density2, EndsAngleCosine, EndsAngleSine, EndsDistance, InitAngleCosine, InitAngleSine, LogArea, LogAspect, Sharpness, TotalAbsAngle, TotalAngle, TotalLength
- public abstract class Feature
- extends Observable
- implements Serializable, Observer
- See Also:
- Serialized Form
Field Summary |
protected Gesture |
gesture
|
protected double |
value
|
protected boolean |
valueOk
true iff @value has been recomputed since @gesture changed. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
value
protected double value
valueOk
protected boolean valueOk
- true iff @value has been recomputed since @gesture changed.
gesture
protected Gesture gesture
Feature
public Feature()
Feature
public Feature(Gesture g)
newPoint
public void newPoint(Point p)
newPoint
public void newPoint(int x,
int y)
- Subclasses that incrementally compute the value should override this.
It should compute the new @value and set @valueOk to true.
setGesture
public void setGesture(Gesture g)
getGesture
public Gesture getGesture()
getValue
public double getValue()
update
public void update(Observable gesture,
Object arg)
- Specified by:
update
in interface Observer
getName
public abstract String getName()
- Return a name that will be meaningful to the user
getMinValue
public abstract double getMinValue()
- Return maximum value this feature can have
getMaxValue
public abstract double getMaxValue()
- Return minimum value this feature can have
computeValue
protected abstract void computeValue()
- Non-incremental computation. Should set @value to new value and
scale
public abstract void scale(double factor)
- Change @gesture so that the feature changes (ideally by the
scale factor).