hhreco.recognition
Class TimedStroke

java.lang.Object
  extended byhhreco.recognition.TimedStroke

public class TimedStroke
extends java.lang.Object

TimedStroke is a collection of points taken in the duration of a mouse pressed event and a mouse released event. A TimedStroke object contains basic stroke path information such as the points and the timestamps in the path.


Constructor Summary
TimedStroke()
          Construct a timed stroke object with an empty stroke path.
TimedStroke(int initSize)
          Construct a timed stroke object with an empty stroke path of the given initial size.
TimedStroke(TimedStroke in)
          Copy constructor for efficient copying of TimedStroke
 
Method Summary
 void addVertex(double x, double y, long timestamp)
          Add a pair of x, y coordinates in the stroke path and the corresponding timestamp.
 java.awt.geom.Rectangle2D getBounds2D()
          Get the bounds of the polyline in Rectangle2D.Double.
 long getTimestamp(int i)
          Return the timestamp of the point at the given index.
 int getVertexCount()
          Return the number of points in the stroke.
 double getX(int i)
          Return the x coordinate at the specified index.
 double getY(int i)
          Return the y coordinate at the specified index.
 void transform(java.awt.geom.AffineTransform at)
          Transform the polyline with the given transform.
 void translate(double x, double y)
          Translate the polyline with the given distance.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TimedStroke

public TimedStroke()
Construct a timed stroke object with an empty stroke path.


TimedStroke

public TimedStroke(TimedStroke in)
Copy constructor for efficient copying of TimedStroke


TimedStroke

public TimedStroke(int initSize)
Construct a timed stroke object with an empty stroke path of the given initial size.

Method Detail

addVertex

public void addVertex(double x,
                      double y,
                      long timestamp)
Add a pair of x, y coordinates in the stroke path and the corresponding timestamp.


getBounds2D

public java.awt.geom.Rectangle2D getBounds2D()
Get the bounds of the polyline in Rectangle2D.Double.


getX

public double getX(int i)
Return the x coordinate at the specified index.


getY

public double getY(int i)
Return the y coordinate at the specified index.


getTimestamp

public long getTimestamp(int i)
Return the timestamp of the point at the given index.


getVertexCount

public int getVertexCount()
Return the number of points in the stroke.


transform

public void transform(java.awt.geom.AffineTransform at)
Transform the polyline with the given transform.


translate

public void translate(double x,
                      double y)
Translate the polyline with the given distance.