Code Examples
A repository of 155 code examples for BeepBeep
plots.MouseHeatmap Class Reference

Displays the trail of the mouse pointer inside a heat map. More...

Static Public Member Functions

static void main (String[] args) throws InterruptedException
 

Static Protected Attributes

static int WIDTH = 320
 The width of the mouse playground.
 
static int HEIGHT = 200
 The height of the mouse playground.
 

Detailed Description

Displays the trail of the mouse pointer inside a heat map.

The program creates two windows: the first is the "mouse playground", which is a small empty frame where the mouse movements are recorded; the second is a window that displays a "heat map", which is a two-dimensional plot made of rectangular cells, where the color of each cell is associated to a numerical value. In the present case, each cell represents a rectangular zone of pixels in the mouse playground, and the numerical value for each zone is the total number of mouse events that occurred in that zone. The end result looks like the following screenshot:

Screenshot

One can see the heatmap update as the user moves the mouse in the playground. Colors that tend towards blue indicate that the mouse has not spent a lot of time in that zone, while red and yellow colors indicate the mouse has spent more time. The plot only updates when the mouse moves.

Definition at line 51 of file MouseHeatmap.java.


The documentation for this class was generated from the following file: