Comprehensive 2D Graphics Coverage

Complete coverage of the Java 2D API, from bitmaps to three-dimensional rendering and everything in between.


If you’re doing user interface design, you’re likely to get a lot out of this book. Focussed on the graphical elements of the Java Foundation Classes, this book covers the Java 2D API more aggressively than any other book. Handling transforms, textures, bitmaps and even three dimensional operations, is the domain of graphically-intensive applications. If you’re developing applications that manipulate fonts, transform bitmaps or rotate shapes in two or three dimensions, you’ll want to run to the store and get your hands on this book immediately.

This books centers primarily on the Java 2D API, starting with a quick introduction and a high-level overview in Chapters 1 and 2. Chapter 3 dives into points, coordinates and transforms. The transforms available in the JFC are powerful and flexible but difficult for many to understand. This chapter helps clarify the critical concepts and makes these important ideas accessible, laying a solid foundation for many of the effects made possible by the 2D API. Chapter 4 looks at colors and texture rendering, covering color models and gradients. Chapter 5 uses the transform information from Chapter 3 and expands on it to explore rotation in two dimensions.

Among the new features made possible in the Java 2D Graphics API, are the line stroke control that lets you set the width, ends and style for drawing edges. These concepts are explored in Chapter 6 which uses the line drawing capabilities to demonstrate basic functionality. Chapter 7 looks at shapes and curves. The Shape object is the basis for many new 2D capabilities, with support for different types of curves, which allow programmers to create complex shapes that can be rendered or used as clipping regions interchangeably. Text handling is much enhanced in Java 2 and Chapter 8 concentrates on the many new variations made possible by the 2D API.

Chapter 9 looks at animation. This coverage is a bit shallow but its nice to see a working example to solidify the major concepts. Chapter 10 introduces plotting and graphing. Chapter 11 focusses on bitmap images, scaling and composites, with chapter 12 exploring mouse events. I found the mouse chapter a little out of place but it doesn’t much detract from the value of the rest of the book. The next 4 chapters develop a set of 3-dimensional classes, which start with basic mathematics and wire frames, and move on to hidden line elimination and perspective. Chapter 17 closes the book with a quick look at the Advanced Imaging API.

The 3d and Imaging API coverage did not provide much value in my mind, but the price of the book may be justified by the 3D Graphics API coverage in the earlier chapters. If you plan to develop graphic-intensive applications, this is still a good investment. The 3D coverage is interesting, albeit superfluous with the recent release of the 3D API, but it exposes the basic concepts in a lucid and informative manner. The Advanced Imaging API was incomplete when the final chapter was written, so you probably won’t find it very useful. As a whole, this is a good buy for Java graphic programmers and an interesting read if you just like to dabble in the visual arts.