PenProfile 2.x

com.livescribe.geom
Class Stroke

java.lang.Object
  extended by com.livescribe.geom.Shape
      extended by com.livescribe.geom.Stroke

public class Stroke
extends Shape

This class describes a stroke, or series of points. This is similar to a polyline but not the same because it contains other information such as time.


Field Summary
 
Fields inherited from class com.livescribe.geom.Shape
COORD_MAX, COORD_MIN, INTERSECT_CLIP, INTERSECT_EXTERNAL, INTERSECT_INTERNAL1, INTERSECT_INTERNAL2, SHAPE_COMPOSITE, SHAPE_ELLIPSE, SHAPE_LINESEGMENT, SHAPE_POINT, SHAPE_POLYGON, SHAPE_POLYLINE, SHAPE_RECTANGLE, SHAPE_STROKE, type, vertex
 
Constructor Summary
Stroke()
          Creates a new stroke having no points.
Stroke(int n)
          Creates a new stroke having n points set to (0,0).
Stroke(int[] v)
          Creates a new stroke having the specified points.
 
Method Summary
static long getCoordinateTime(long startTime, int index)
          Calculates a specific coordinate's time.
 long getEndTime(long startTime)
          Gets the stroke's end time.
 long getRelativeCoordinateTime(long endTime, int index)
          Gets the coordinate time in relation to the stroke's end time.
 String toString()
          Returns a string representation of this object.
 
Methods inherited from class com.livescribe.geom.Shape
contains, getBoundingBox, getNumberofVertices, getNumberOfVertices, getSize, getType, getUnion, getX, getXY, getY, intersectsWith, setVertexArray, setX, setXY, setXY, setY
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Stroke

public Stroke()
Creates a new stroke having no points.

The internal Shape.vertex array is set to null.


Stroke

public Stroke(int n)
Creates a new stroke having n points set to (0,0).

Parameters:
n - the number of points

Stroke

public Stroke(int[] v)
Creates a new stroke having the specified points. The array should contain an even number of elements.

Parameters:
v - the vertex array
Method Detail

getCoordinateTime

public static long getCoordinateTime(long startTime,
                                     int index)
Calculates a specific coordinate's time.

Parameters:
startTime - the absolute start time
index - the coordinate index
Returns:
the computed time.

getRelativeCoordinateTime

public long getRelativeCoordinateTime(long endTime,
                                      int index)
Gets the coordinate time in relation to the stroke's end time.

Parameters:
endTime - the end time
index - coordinate index
Returns:
the computed time.

getEndTime

public long getEndTime(long startTime)
Gets the stroke's end time.

Parameters:
startTime - the start time of the stroke
Returns:
the computed end time.

toString

public String toString()
Returns a string representation of this object.

Overrides:
toString in class Shape
Returns:
a string representation of this object.

PenProfile 2.x

Copyright © 2010 Livescribe Inc. All Rights Reserved.
Confidential and subject to NDA.