|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectedu.mit.sketch.clocksketch.model.Stroke
public abstract class Stroke
A stroke is a collection of Points that collectively form a "Stroke" or one single continuous motion made by the pen user.
| Constructor Summary | |
|---|---|
Stroke()
|
|
| Method Summary | |
|---|---|
abstract boolean |
addPoint(Point point)
Adds a Point to the Stroke. |
abstract void |
clearPoints()
Removes all Points from the Stroke. |
abstract double[] |
endPointsCorrelation()
Returns the x, y, and shortest-distance correlation (between 0 and 1) of how close the endpoints are given the length of the stroke. |
abstract boolean |
equals(java.lang.Object o)
Returns true only if the Stroke equals another Stroke |
abstract void |
extrapolateMissingValues()
Logitech's IO pen will drop any points that are on a straight line to save memory. |
abstract double |
getAverageRadius(int k,
boolean includeHooklets)
Returns the radius of the symbol, with smoothing factor k. |
abstract java.awt.geom.Point2D |
getCenterOfMass(boolean includeHooklets)
Returns the center of mass, (the average point) of all the Points in the Stroke |
abstract double[] |
getDirectionData(int k)
Creates an array with the direction from point to the next, averaging with k nearest neighbors. |
abstract double[] |
getDirectionDerivative(int k)
Calculates the derivative w/ respect to time (dt) of the directionality. |
abstract double[] |
getDirectionDerivativeRegression()
Stores the results of analyzing the linear regression of the directionality/dt. |
abstract double[] |
getDirectionRegression()
Stores the results of analyzing the linear regression of the directionality. |
abstract double |
getDistance()
Returns the distance between the first point and the last point. |
abstract long |
getEndOfStroke()
Returns the time (UNIX timestamp) that the stroke ended. |
abstract Point |
getFirstPoint()
Returns the first Point of the Stroke |
abstract int |
getIndexNumber()
All of the strokes downloaded from a pen are assigned a number in the order they were drawn, starting from 0. |
abstract java.lang.String |
getLabel()
Returns the label of the stroke |
abstract Point |
getLastPoint()
Returns the last Point of the Stroke |
abstract double |
getLength()
Returns the length of the stroke. |
abstract double |
getMaxXCoordinate()
Returns the largest X coordinate of the Stroke |
abstract double |
getMaxYCoordinate()
Returns the largest Y coordinate of the Stroke |
abstract double |
getMinXCoordinate()
Returns the smallest X coordinate of the Stroke. |
abstract double |
getMinYCoordinate()
Returns the smallest Y coordinate of the Stroke. |
abstract int |
getNumberOfNonHookletPoints()
Returns the number of points that are not hooklets within the stroke. |
abstract int |
getNumberOfPoints()
Returns the number of points within the stroke |
abstract Symbol |
getParentSymbol()
Returns the current parent Symbol (if any) of the Stroke |
abstract java.util.LinkedList<Point> |
getPointsByTimeStamp()
Returns a LinkedList of Points by time stamp in ascending order. |
abstract long |
getStartOfStroke()
Returns the time (UNIX timestamp) that the stroke started at. |
abstract boolean |
isHighlighted()
|
abstract boolean |
removePoint(Point point)
Removes a Point from the Stroke. |
abstract void |
setDirectionDerivativeRegression(double[] directionDerivative)
Stores the results of analyzing the linear regression of the directionality/dt. |
abstract void |
setDirectionRegression(double[] direction)
Stores the results of analyzing the linear regression of the directionality. |
abstract void |
setHighlighted(boolean highlight)
|
abstract void |
setIndexNumber(int strokeNumber)
Assigns the stroke a number based on how many strokes where drawn before it: If there were n Strokes drawn before, then the number is (n + 1) - 1. |
abstract void |
setLabel(java.lang.String label)
Sets a label for the stroke |
abstract void |
setParentSymbol(Symbol parent)
Sets the current parent Symbol of the Stroke, replacing the old parent Symbol |
| Methods inherited from class java.lang.Object |
|---|
getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface java.lang.Comparable |
|---|
compareTo |
| Constructor Detail |
|---|
public Stroke()
| Method Detail |
|---|
public abstract boolean addPoint(Point point)
point - public abstract boolean removePoint(Point point)
point - public abstract void clearPoints()
public abstract void setLabel(java.lang.String label)
label - public abstract java.lang.String getLabel()
public abstract int getIndexNumber()
public abstract void setIndexNumber(int strokeNumber)
strokeNumber - public abstract boolean isHighlighted()
public abstract void setHighlighted(boolean highlight)
highlight - public abstract long getStartOfStroke()
public abstract long getEndOfStroke()
public abstract java.util.LinkedList<Point> getPointsByTimeStamp()
public abstract boolean equals(java.lang.Object o)
equals in class java.lang.Objectpublic abstract double getMinXCoordinate()
public abstract double getMinYCoordinate()
public abstract double getMaxXCoordinate()
public abstract double getMaxYCoordinate()
public abstract int getNumberOfPoints()
public abstract int getNumberOfNonHookletPoints()
public abstract Point getFirstPoint()
public abstract Point getLastPoint()
public abstract double getLength()
public abstract double getDistance()
public abstract double[] endPointsCorrelation()
public abstract void setDirectionRegression(double[] direction)
direction - public abstract double[] getDirectionRegression()
public abstract void setDirectionDerivativeRegression(double[] directionDerivative)
directionDerivative - public abstract double[] getDirectionDerivativeRegression()
public abstract double[] getDirectionData(int k)
k - public abstract double[] getDirectionDerivative(int k)
k - used to offset the data gathering
public abstract java.awt.geom.Point2D getCenterOfMass(boolean includeHooklets)
public abstract double getAverageRadius(int k,
boolean includeHooklets)
public abstract void extrapolateMissingValues()
public abstract Symbol getParentSymbol()
public abstract void setParentSymbol(Symbol parent)
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||