|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object edu.stanford.hci.r3.pen.ink.InkStroke
public class InkStroke
Store ink strokes (multiple samples) in here.
We assume that the units in this stroke are consistent (one reference unit), and make sense to the client class that ends up using this stroke object. For example, if the units is in PatternDots, and the values are derived directly from the streaming PenListeners, we need to make sure that the stroke samples do not jump from one page tile to another. In that case, we would assume that the streamed samples come from one Anoto pattern tile, unless otherwise specified.
This software is distributed under the BSD License.
Constructor Summary | |
---|---|
InkStroke()
|
|
InkStroke(java.util.Collection<PenSample> currentStrokeSamples,
Units reference)
Copies the samples into our own arrays. |
|
InkStroke(java.util.List<PenSample> stroke)
|
Method Summary | |
---|---|
void |
addSample(double x,
double y,
int force,
long ts)
|
void |
addSample(PenSample penSample)
|
double |
getArea()
|
java.awt.geom.Rectangle2D |
getBounds()
|
long |
getDuration()
|
PenSample |
getEnd()
Returns the last sample in this stroke (end-point). |
long |
getFirstTimestamp()
|
java.util.Date |
getFirstTimestampAsDate()
|
int[] |
getForceSamples()
|
long |
getLastTimestamp()
|
java.util.Date |
getLastTimestampAsDate()
|
double |
getMaxX()
|
double |
getMaxY()
|
double |
getMinX()
|
double |
getMinY()
|
int |
getNumSamples()
|
Units |
getReferenceUnit()
|
java.util.List<PenSample> |
getSamples()
|
PenSample |
getStart()
Returns the first sample in this stroke (start-point). |
long[] |
getTimeSamples()
|
double |
getWidth()
|
double[] |
getXSamples()
|
int[] |
getXSamplesAsInts()
|
double[] |
getYSamples()
|
int[] |
getYSamplesAsInts()
|
void |
setBounds(double minStrokeX,
double minStrokeY,
double maxStrokeX,
double maxStrokeY)
|
void |
setMaxX(float mxX)
|
void |
setMaxY(float mxY)
|
void |
setMinX(float mnX)
|
void |
setMinY(float mnY)
|
void |
setSamples(java.util.List<PenSample> newSamples)
|
java.lang.String |
toString()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public InkStroke()
public InkStroke(java.util.Collection<PenSample> currentStrokeSamples, Units reference)
currentStrokeSamples
- reference
- public InkStroke(java.util.List<PenSample> stroke)
stroke
- Method Detail |
---|
public void addSample(double x, double y, int force, long ts)
x
- y
- force
- ts
- public void addSample(PenSample penSample)
penSample
- public double getArea()
public java.awt.geom.Rectangle2D getBounds()
public long getDuration()
public PenSample getEnd()
public long getFirstTimestamp()
public java.util.Date getFirstTimestampAsDate()
public int[] getForceSamples()
public long getLastTimestamp()
public java.util.Date getLastTimestampAsDate()
public double getMaxX()
public double getMaxY()
public double getMinX()
public double getMinY()
public int getNumSamples()
public Units getReferenceUnit()
public java.util.List<PenSample> getSamples()
public PenSample getStart()
public long[] getTimeSamples()
public double getWidth()
public double[] getXSamples()
public int[] getXSamplesAsInts()
public double[] getYSamples()
public int[] getYSamplesAsInts()
public void setBounds(double minStrokeX, double minStrokeY, double maxStrokeX, double maxStrokeY)
minStrokeX
- minStrokeY
- maxStrokeX
- maxStrokeY
- public void setMaxX(float mxX)
mxX
- the maxX to setpublic void setMaxY(float mxY)
mxY
- the maxY to setpublic void setMinX(float mnX)
mnX
- the minX to setpublic void setMinY(float mnY)
mnY
- the minY to setpublic void setSamples(java.util.List<PenSample> newSamples)
public java.lang.String toString()
toString
in class java.lang.Object
|
Copyright 2006 Stanford University | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |