JavaFX Flickr Client

By Rakesh Menon, April 23, 2009

Mosaic is a client for Flickr. It uses Flickr's REST API (flickr.photos.search) to search and obtain pictures from Flickr based on its tags.

By default the images obtained from Flickr are scattered around the border of window. Image will be zoomed when its dragged from border towards center. If mouse is moved out of Image, size is restored and image is moved towards border of window.

Do not use the api-key used by this sample. Obtain your own key from flickr.com

Understanding the Code

HttpRequest is used to search for specified tag and fetch image metadata using flickr.photos.search API. The information is obtained in XML format which is parsed using PhotoPullParser.

The image is rotated and translated at the same time using TranslateTransition and RotateTransition animation APIs. These two animations are executed at the same time using ParallelTransition API.

When the image is dragged towards the center, scale factor of image node is calculated based on the distance from border towards the center. Scale is increased as the distance between center and image location is reduced.

If you are using proxy-server for connecting to internet, please follow setup as specified in "Java Networking and Proxies".

References