In my last post I described Apples gestures API. Up to date I´m developing a wrapper API. With this API you can add multitouch-listeners to any swing component. On any OS unlike Mac OS a GesturesNotSupportedException is thrown if you try to register a listener. So you can use the API in every application. If the Applications runs on a Mac it supports gestures.

Here is how:

try {
  GestureUtilities.add(panel, gestureRotationListener);
} catch (GesturesNotSupportedException e) {
  System.out.println("Gestures-API not Supported!");
}

Or you can just check if the Apple API is supported:

if(!GestureUtilities.isSupported()) {
  System.out.println("Gestures-API not Supported!");
}

I will add javadoc to the source and update the gestures demo next week. You can check out the source @ https://code.google.com/p/gestures-wrapper/.