Preview: Multitouch gestures in swing
#General
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/.
Hendrik Ebbers
Hendrik Ebbers is the founder of Open Elements. He is a Java champion, a member of JSR expert groups and a JavaOne rockstar. Hendrik is a member of the Eclipse JakartaEE working group (WG) and the Eclipse Adoptium WG. In addition, Hendrik Ebbers is a member of the Board of Directors of the Eclipse Foundation.