Package trackers
Class EyeTracker
java.lang.Object
trackers.EyeTracker
- All Implemented Interfaces:
com.intellij.openapi.Disposable
This class is the eye tracker.
-
Nested Class Summary
Nested classes/interfaces inherited from interface com.intellij.openapi.Disposable
com.intellij.openapi.Disposable.Default, com.intellij.openapi.Disposable.Parent -
Field Summary
FieldsModifier and TypeFieldDescription(package private) String(package private) intcom.intellij.openapi.editor.EditorThis variable is the handler for eye tracking data.(package private) DocumentThis variable is the XML document for storing the eye tracking data.(package private) String(package private) Elementprivate static booleanThis variable indicates whether the real-time data is transmitting.(package private) booleanThis variable indicates whether the tracking is started.(package private) com.intellij.psi.PsiElement(package private) String(package private) com.intellij.psi.PsiDocumentManager(package private) String(package private) Thread(package private) Process(package private) String(package private) String(package private) Element(package private) doubleThis variable indicates the sample frequency of the eye tracker.(package private) double(package private) double(package private) Element(package private) Rectangle(package private) com.intellij.openapi.editor.event.VisibleAreaListenerThe listener for the visible area used for filtering the eye tracking data. -
Constructor Summary
ConstructorsConstructorDescriptionThis is the default constructor.EyeTracker(String pythonInterpreter, double sampleFrequency, boolean isUsingMouse) This is the constructor for the eye tracker. -
Method Summary
Modifier and TypeMethodDescriptionvoiddispose()getASTStructureElement(com.intellij.psi.PsiElement psiElement) This method gets the AST structure element from the PSI element.getRawGazeElement(String message) This method gets the raw gaze xml element from the raw gaze data.private voidhandleElement(Element element) This method handles the element.voidThis method pauses the eye tracking.voidprocessRawData(String message) This method processes the raw data message from the eye tracker.voidThis method resumes the eye tracking.voidsetDataOutputPath(String dataOutputPath) voidsetDeviceIndex(int deviceIndex) This method sets the device index.voidsetEyeTrackerDataHandler(Consumer<Element> eyeTrackerDataHandler) static voidsetIsRealTimeDataTransmitting(boolean isRealTimeDataTransmitting) voidsetProjectPath(String projectPath) This method sets the project path.voidsetPythonInterpreter(String pythonInterpreter) voidThis method sets the Python script for the mouse eye tracker.voidThis method sets the Python script for the Tobii eye tracker.voidsetSampleFrequency(double sampleFrequency) voidstartTracking(com.intellij.openapi.project.Project project) This method starts the eye tracking.voidThis method stops the eye tracking.voidtrack()This method builds the Python process and redirects the output to thepythonOutputThreadto process.
-
Field Details
-
dataOutputPath
String dataOutputPath -
sampleFrequency
double sampleFrequencyThis variable indicates the sample frequency of the eye tracker. -
psiDocumentManager
com.intellij.psi.PsiDocumentManager psiDocumentManager -
editor
public com.intellij.openapi.editor.Editor editor -
eyeTracking
Document eyeTrackingThis variable is the XML document for storing the eye tracking data. -
root
Element root -
setting
Element setting -
gazes
Element gazes -
isTracking
boolean isTrackingThis variable indicates whether the tracking is started. -
screenWidth
double screenWidth -
screenHeight
double screenHeight -
projectPath
String projectPath -
filePath
String filePath -
lastElement
com.intellij.psi.PsiElement lastElement -
visibleArea
Rectangle visibleArea -
pythonProcess
Process pythonProcess -
pythonOutputThread
Thread pythonOutputThread -
pythonInterpreter
String pythonInterpreter -
pythonScriptTobii
String pythonScriptTobii -
pythonScriptMouse
String pythonScriptMouse -
deviceIndex
int deviceIndex -
isRealTimeDataTransmitting
private static boolean isRealTimeDataTransmittingThis variable indicates whether the real-time data is transmitting. -
eyeTrackerDataHandler
This variable is the handler for eye tracking data. -
visibleAreaListener
com.intellij.openapi.editor.event.VisibleAreaListener visibleAreaListenerThe listener for the visible area used for filtering the eye tracking data.
-
-
Constructor Details
-
EyeTracker
This is the default constructor.- Throws:
ParserConfigurationException
-
EyeTracker
public EyeTracker(String pythonInterpreter, double sampleFrequency, boolean isUsingMouse) throws ParserConfigurationException This is the constructor for the eye tracker.- Parameters:
pythonInterpreter- The path of the Python interpreter.sampleFrequency- The sample frequency of the eye tracker.isUsingMouse- Whether the mouse is used as the eye tracker.- Throws:
ParserConfigurationException
-
-
Method Details
-
startTracking
This method starts the eye tracking.- Parameters:
project- The project.- Throws:
IOException- The exception.
-
stopTracking
This method stops the eye tracking.- Throws:
TransformerException- The exception.
-
pauseTracking
public void pauseTracking()This method pauses the eye tracking. TheisTrackingvariable will be set tofalse. -
resumeTracking
public void resumeTracking()This method resumes the eye tracking. TheisTrackingvariable will be set totrue. -
processRawData
This method processes the raw data message from the eye tracker. It will filter the data, map the data to the specific source code element, and perform the upward traversal in the AST.- Parameters:
message- The raw data.
-
track
public void track()This method builds the Python process and redirects the output to thepythonOutputThreadto process. -
setProjectPath
This method sets the project path.- Parameters:
projectPath- The project path.
-
dispose
public void dispose()- Specified by:
disposein interfacecom.intellij.openapi.Disposable
-
getRawGazeElement
This method gets the raw gaze xml element from the raw gaze data.- Parameters:
message- The raw gaze data.- Returns:
- The raw gaze element.
-
getASTStructureElement
This method gets the AST structure element from the PSI element. It performs the upward traversal in the AST.- Parameters:
psiElement- The PSI element.- Returns:
- The AST structure element.
-
handleElement
This method handles the element.- Parameters:
element- The element.
-
setIsRealTimeDataTransmitting
public static void setIsRealTimeDataTransmitting(boolean isRealTimeDataTransmitting) -
setEyeTrackerDataHandler
-
setPythonInterpreter
-
setDataOutputPath
-
setSampleFrequency
public void setSampleFrequency(double sampleFrequency) -
setPythonScriptTobii
public void setPythonScriptTobii()This method sets the Python script for the Tobii eye tracker. -
setPythonScriptMouse
public void setPythonScriptMouse()This method sets the Python script for the mouse eye tracker. -
setDeviceIndex
public void setDeviceIndex(int deviceIndex) This method sets the device index.- Parameters:
deviceIndex- The device index.
-