When I read Jan Köhnlein’s post about multitouch gestures support in their graph viewer, I was thinking, these gestures would be a nice addition to the Zest visualization library. In addition to that, it could be my first new feature as a Zest committer, so I opened bug 371152.
So I looked into the multitouch API in SWT (btw. it is really to use, check snippet 353). Luckily, only a gesture listener had to be added, that is already supported by the Zest graph widget.
I thought about what gestures could be universally supported in the Zest graph, and found that scrolling is already supported, magnification is easy to implement, and for rotation I found a possible use.
Today, I finished the implementation, and created a short video presentation that shows the features in action. See the Youtube video: http://youtu.be/cVVxOIwHN7s
Additionally, it is possible to replace the built-in gestures by creating the graph with a specific style bit, and adding other gesture listeners manually as below:
//Disabling default gestures Graph graph = new Graph(parent, ZestStyles.GESTURES_DISABLED); //Adding own gesture listener graph.addGestureListener(new GestureListener() { public void gesture(GestureEvent e) { switch (e.detail) { // Do nothing } } });
I believe the base implementation of the gesture support is useful, but I am open to change it if someone has a better idea.