|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectedu.mit.sketch.clocksketch.penIO.PenIO
public class PenIO
| Field Summary | |
|---|---|
static java.lang.String |
StrokeRandomID
|
static java.lang.String |
StrokeTimeStringID
|
| Constructor Summary | |
|---|---|
PenIO()
Empty constructor? |
|
| Method Summary | |
|---|---|
static double |
convertFromAnotoUnit(double auNum)
Converts a double from the Anoto unit (.3mm, w/ accuracty of 1/8th Anoto Unit) to millimeters |
static java.util.HashMap |
getClockSketchData(java.lang.String filePath)
This method is used to load metadata in the first version of the clocksketch file format. |
static java.util.LinkedList<Stroke> |
getData(java.lang.String filename)
This method loads the raw data the Anoto Pen Service dumps into a file and returns a LinkedList of PenStrokes. |
static java.lang.StringBuffer |
getDataContents(java.lang.String filename)
Returns the pen data as it is found in the file |
java.util.HashMap |
getXMLClockSketchData(org.jdom.Document doc)
Retrieves all the meta-data from the ClockSketch XML file as a HashMap with keys as PenTags or PenTags combinations |
org.jdom.Document |
getXMLDocument(java.lang.String rootLabel)
Creates a new XML Document |
java.util.List<PenDrawing> |
getXMLPenData(org.jdom.Document doc)
Parses the data in an XML document to create a Drawing. |
static void |
main(java.lang.String[] args)
|
static void |
makeSpreadsheetFile(java.util.ArrayList<double[][]> strokeData,
java.util.ArrayList<long[]> timeStampsData,
java.lang.String[] headers,
java.io.File file)
Deprecated, this would create a simple SpreadSheet for analyzing data (used to work on the classifier originally) |
org.jdom.Document |
openXMLDocument(java.net.URL url)
Given a URL, attempts to retrieve and parse the raw file, and return a document |
void |
setXMLClockSketchData(org.jdom.Document doc,
java.util.HashMap data)
|
void |
setXMLPenData(org.jdom.Document doc,
java.util.List<PenDrawing> drawings)
Converts the PenDrawing to an XML document, and also saves a field with the raw data. |
static void |
writeClockSketchFile(java.util.HashMap clockSketchData,
java.lang.String penData,
java.io.File fileToWrite)
This method was used to write meta data and payload information for the first version of the clocksketch file format. |
boolean |
writeXMLClockSketchFile(java.io.File file,
java.util.List<PenDrawing> drawings,
java.util.HashMap clockData)
|
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static java.lang.String StrokeTimeStringID
public static java.lang.String StrokeRandomID
| Constructor Detail |
|---|
public PenIO()
| Method Detail |
|---|
public static void main(java.lang.String[] args)
throws java.lang.Exception
java.lang.Exception
public org.jdom.Document openXMLDocument(java.net.URL url)
throws org.jdom.JDOMException,
java.io.IOException
url -
java.io.IOException
org.jdom.JDOMException
public boolean writeXMLClockSketchFile(java.io.File file,
java.util.List<PenDrawing> drawings,
java.util.HashMap clockData)
throws java.io.IOException
java.io.IOExceptionpublic org.jdom.Document getXMLDocument(java.lang.String rootLabel)
public void setXMLPenData(org.jdom.Document doc,
java.util.List<PenDrawing> drawings)
doc - drawings -
public void setXMLClockSketchData(org.jdom.Document doc,
java.util.HashMap data)
public java.util.List<PenDrawing> getXMLPenData(org.jdom.Document doc)
doc - public java.util.HashMap getXMLClockSketchData(org.jdom.Document doc)
doc - public static java.lang.StringBuffer getDataContents(java.lang.String filename)
filename -
public static java.util.LinkedList<Stroke> getData(java.lang.String filename)
throws java.io.FileNotFoundException
filename - - An absolute path used by new File() to load the data file
java.io.FileNotFoundExceptionPenStroke
public static java.util.HashMap getClockSketchData(java.lang.String filePath)
throws java.io.IOException
filePath -
java.io.IOException
public static void makeSpreadsheetFile(java.util.ArrayList<double[][]> strokeData,
java.util.ArrayList<long[]> timeStampsData,
java.lang.String[] headers,
java.io.File file)
strokeData - timeStampsData - headers - file -
public static void writeClockSketchFile(java.util.HashMap clockSketchData,
java.lang.String penData,
java.io.File fileToWrite)
clockSketchData - penData - fileToWrite - public static double convertFromAnotoUnit(double auNum)
auNum -
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||