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
Modifier and TypeFieldDescription(package private) String
(package private) int
com.intellij.openapi.editor.Editor
This variable is the handler for eye tracking data.(package private) Document
This variable is the XML document for storing the eye tracking data.(package private) String
(package private) Element
private static boolean
This variable indicates whether the real-time data is transmitting.(package private) boolean
This 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) double
This 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.VisibleAreaListener
The listener for the visible area used for filtering the eye tracking data. -
Constructor Summary
ConstructorDescriptionThis is the default constructor.EyeTracker
(String pythonInterpreter, double sampleFrequency, boolean isUsingMouse) This is the constructor for the eye tracker. -
Method Summary
Modifier and TypeMethodDescriptionvoid
dispose()
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 void
handleElement
(Element element) This method handles the element.void
This method pauses the eye tracking.void
processRawData
(String message) This method processes the raw data message from the eye tracker.void
This method resumes the eye tracking.void
setDataOutputPath
(String dataOutputPath) void
setDeviceIndex
(int deviceIndex) This method sets the device index.void
setEyeTrackerDataHandler
(Consumer<Element> eyeTrackerDataHandler) static void
setIsRealTimeDataTransmitting
(boolean isRealTimeDataTransmitting) void
setProjectPath
(String projectPath) This method sets the project path.void
setPythonInterpreter
(String pythonInterpreter) void
This method sets the Python script for the mouse eye tracker.void
This method sets the Python script for the Tobii eye tracker.void
setSampleFrequency
(double sampleFrequency) void
startTracking
(com.intellij.openapi.project.Project project) This method starts the eye tracking.void
This method stops the eye tracking.void
track()
This method builds the Python process and redirects the output to thepythonOutputThread
to 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. TheisTracking
variable will be set tofalse
. -
resumeTracking
public void resumeTracking()This method resumes the eye tracking. TheisTracking
variable 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 thepythonOutputThread
to process. -
setProjectPath
This method sets the project path.- Parameters:
projectPath
- The project path.
-
dispose
public void dispose()- Specified by:
dispose
in 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.
-