Emitrom, a company providing custom enterprise software application services, has recently released Lienzo 1.0 GA under the Apache Licence. Lienzo is a GWT library that implements a structured graphic toolkit in Java using the HTML5 Canvas as a back end. Lienzo builds upon the existing Canvas support of GWT (see demo) by offering a more advanced Java API geared towards rich animations, games, image processing etc.
Lienzo 1.0 offers the following graphic functions
- A Viewport with several layers grouped into scenes
- Zooming and panning of the viewport
- Several basic shapes (circle, line, triangle etc.)
- Basic (rotation, scale, position) and advanced/affine transformations for shapes
- CSS 3 color mappings
- Basic Text and Web font support
- Image Rendering
- Image Filters (e.g. Blur)
- Points and Vectors
- Experimental support for HTML5 video
- Saving the current canvas content to an image
- Event handling from mouse or touch screens
- Drag and Drop
- Animations with different tweening options
- Internationalization support
There is a live demo showing several examples (some animated as well) along with their source code.
The Canvas element of HTML 5 is typically scripted in JavaScript using a very low level set of methods that manage the GUI in immediate mode. The basic Java API offered by GWT is just a thin layer over the JavaScript API, so it is still low level for most Enterprise developers. Emitrom extends this basic API into a full Scene Graph managed in retained mode. This makes possible all the advanced features (such as animations) outlined above.
Lienzo can be extended to support other shapes apart from those already included. Emitrom also exposes the core Context2D Object that offers direct access to the low level methods of the HTML5 canvas. It is therefore possible to develop functionality that is not included in Lienzo by default or even easily port native JavaScript code from existing Canvas applications for those who need this capability.
Finally with the addition of extra libraries offered by Emitrom, Lienzo can also run on iOS, or on the desktop via Adobe Air, further enhancing the cross-platform development idea introduced by Flash4j.
For more information, see the User Manual and Javadocs. Commercial support options are also available.