-1

I have created an experiment to evaluate various cursors( Bubble Cursor, Area Cursor). Although I have generated the response time and accuracy for each interaction I was interested in knowing user touch patterns and visualize it in heat maps. I could find several API's for iphone, javascript, etc. Since Java Swing package isn't meant to be for touch screen, I couldn't find a way to generate them. Only way I could thing of is to find the touch point pixels and then use some visual tools to generate heatmaps in x-y plane. Any better solution is much appreciated.

Community
  • 1
  • 1
PseudoAj
  • 5,234
  • 2
  • 17
  • 37

1 Answers1

2

Starting from this example, I added the following code to the mouse handler and dragged the mouse diagonally across the image to get the effect pictured below. For simplicity, I used darker() on each pass, but a transformation in HSB space may also be appealing, for example.

@Override
public void mouseMoved(MouseEvent e) {
    …
    Color color = new Color(img.getRGB(x, y));
    int c = color.darker().getRGB();
    img.setRGB(x, y, c);
    repaint();
    …
}

image

Alternatively, look at using JFreeChart with an XYBubbleRenderer or an XYShapeRenderer, seen here. Add a ChartMouseListener to highlight the selected bubble, as shown here for a StackedXYBarRenderer.

image

Also consider the prefuse visualization library. As the mouse moves over each entry in prefuse.demos.Congress, illustrated below, the highlight, tooltip and detail text change.

image

Community
  • 1
  • 1
trashgod
  • 203,806
  • 29
  • 246
  • 1,045
  • Bubblechart was a good resource. Now I could just create bubble corresponding to X,Y coordinates and adjust the size of bubble to the value of touch time. – PseudoAj Jun 13 '15 at 02:00
  • All three approaches use the same underlying mechanism; I've cited them in (roughly) increasing order of complexity; use `javax.swing.Timer` to pace the animation, for [example](http://stackoverflow.com/a/8616169/230513). – trashgod Jun 13 '15 at 15:42