UC Berkeley Group for User Interface Research
Updated November 17, 2000

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.
 
Constructor Summary
Feature()
           
Feature(Gesture g)
           
 
Method Summary
protected abstract  void computeValue()
          Non-incremental computation.
 Gesture getGesture()
           
abstract  double getMaxValue()
          Return minimum value this feature can have
abstract  double getMinValue()
          Return maximum value this feature can have
abstract  String getName()
          Return a name that will be meaningful to the user
 double getValue()
           
 void newPoint(int x, int y)
          Subclasses that incrementally compute the value should override this.
 void newPoint(Point p)
           
abstract  void scale(double factor)
          Change @gesture so that the feature changes (ideally by the scale factor).
 void setGesture(Gesture g)
           
 void update(Observable gesture, Object arg)
           
 
Methods inherited from class java.util.Observable
addObserver, clearChanged, countObservers, deleteObserver, deleteObservers, hasChanged, notifyObservers, notifyObservers, setChanged
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

value

protected double value

valueOk

protected boolean valueOk
true iff @value has been recomputed since @gesture changed.

gesture

protected Gesture gesture
Constructor Detail

Feature

public Feature()

Feature

public Feature(Gesture g)
Method Detail

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).

Copyright Information