Public Member Functions | |
InkStroke () | |
InkStroke (Collection< PenSample > currentStrokeSamples, Units reference) | |
Copies the samples into our own arrays. | |
InkStroke (List< PenSample > stroke) | |
void | addSample (double x, double y, int force, long ts) |
void | addSample (PenSample penSample) |
double | getArea () |
Rectangle2D | getBounds () |
long | getDuration () |
PenSample | getEnd () |
Returns the last sample in this stroke (end-point). | |
long | getFirstTimestamp () |
Date | getFirstTimestampAsDate () |
int[] | getForceSamples () |
long | getLastTimestamp () |
Date | getLastTimestampAsDate () |
double | getMaxX () |
double | getMaxY () |
double | getMinX () |
double | getMinY () |
int | getNumSamples () |
Units | getReferenceUnit () |
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 (List< PenSample > newSamples) |
String | toString () |
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.
Definition at line 34 of file InkStroke.java.
Copies the samples into our own arrays.
The reference unit enables us to interpret the samples correctly.
currentStrokeSamples | ||
reference |
Definition at line 87 of file InkStroke.java.
References InkStroke.addSample().
void addSample | ( | PenSample | penSample | ) |
penSample |
Definition at line 120 of file InkStroke.java.
References PenSample.x, and PenSample.y.
void addSample | ( | double | x, | |
double | y, | |||
int | force, | |||
long | ts | |||
) |
x | ||
y | ||
force | ||
ts |
Definition at line 107 of file InkStroke.java.
Referenced by StrokeHandler.handleEvent(), InkStroke.InkStroke(), PenSimulator.mouseDragged(), PenSimulator.mousePressed(), and PenSimulator.mouseReleased().
double getArea | ( | ) |
Definition at line 133 of file InkStroke.java.
Referenced by InkUtils.getStrokeWithLargestArea().
Rectangle2D getBounds | ( | ) |
Definition at line 140 of file InkStroke.java.
Referenced by InkUtils.clusterStrokes(), InkUtils.getAllStrokesContainedWithin(), InkUtils.getAllStrokesOutside(), InkUtils.getStrokesPartlyOutside(), and SketchToPaperUI.translate().
long getDuration | ( | ) |
Definition at line 147 of file InkStroke.java.
References InkStroke.getFirstTimestamp(), and InkStroke.getLastTimestamp().
PenSample getEnd | ( | ) |
Returns the last sample in this stroke (end-point).
Definition at line 156 of file InkStroke.java.
Referenced by SketchToPaperUI.translate().
long getFirstTimestamp | ( | ) |
Definition at line 163 of file InkStroke.java.
Referenced by InkStroke.getDuration().
int [] getForceSamples | ( | ) |
Definition at line 174 of file InkStroke.java.
References InkStroke.getNumSamples().
Referenced by CalibrationEngine.alignInkStrokes().
long getLastTimestamp | ( | ) |
Date getLastTimestampAsDate | ( | ) |
double getMaxX | ( | ) |
double getMaxY | ( | ) |
double getMinX | ( | ) |
double getMinY | ( | ) |
int getNumSamples | ( | ) |
Definition at line 228 of file InkStroke.java.
Referenced by InkStroke.getForceSamples(), InkStroke.getTimeSamples(), InkStroke.getXSamples(), InkStroke.getXSamplesAsInts(), InkStroke.getYSamples(), InkStroke.getYSamplesAsInts(), and InkStroke.toString().
Units getReferenceUnit | ( | ) |
PenSample getStart | ( | ) |
Returns the first sample in this stroke (start-point).
Definition at line 248 of file InkStroke.java.
Referenced by SketchToPaperUI.translate().
long [] getTimeSamples | ( | ) |
Definition at line 255 of file InkStroke.java.
References InkStroke.getNumSamples().
Referenced by CalibrationEngine.alignInkStrokes().
double [] getXSamples | ( | ) |
Definition at line 271 of file InkStroke.java.
References InkStroke.getNumSamples().
Referenced by CalibrationEngine.alignInkStrokes().
int [] getXSamplesAsInts | ( | ) |
double [] getYSamples | ( | ) |
Definition at line 295 of file InkStroke.java.
References InkStroke.getNumSamples().
Referenced by CalibrationEngine.alignInkStrokes().
int [] getYSamplesAsInts | ( | ) |
void setBounds | ( | double | minStrokeX, | |
double | minStrokeY, | |||
double | maxStrokeX, | |||
double | maxStrokeY | |||
) |
minStrokeX | ||
minStrokeY | ||
maxStrokeX | ||
maxStrokeY |
Definition at line 322 of file InkStroke.java.
void setMaxX | ( | float | mxX | ) |
void setMaxY | ( | float | mxY | ) |
void setMinX | ( | float | mnX | ) |
void setMinY | ( | float | mnY | ) |