About the Reviewer
Meera Subbarao has a Bachelors degree in Electronics and Communication Engineering and seventeen years of software programming experience around the globe, from Bangalore,India to Dubai,United Arab Emirates, to the United States. She has spent the past six years at DataSource, Inc. in Maryland and has been working on J2EE technologies exclusively for the last six years.  She is a Sun Certified Java Programmer as well as a Sun Certified Web Component Developer. Meera is also the Team Leader for the Javalobby/dzone book review team.
Spotlight Features

The Rich Engineering Heritage Behind Dependency Injection

Andrew McVeigh takes us on a tour of the rich heritage behind dependency injection, what it represents, and tells us why its here to stay.

NetBeans 6: Matisse Updates

NetBeans 6 delivers great updates to the Matisse GUI builder. Spend a few minutes with Roman Strobl and get an expert briefing on what's new and what has changed.

Introduction to Groovy Part 3

In this, the third and final installation of Andres' Introduction to Groovy series, you learn about how Groovy handles variable numbers of arguments, named parameters, currying, and more about Groovy operators. Including, some new operators.

Easier Custom Components with Swing Fuse

Swing Fuse (actually just Fuse), is a framework designed to make it easier to create your own custom desktop components. In this article, Daniel Spiewak shows you how to get started and provides sample source code you can download.

Benchmark Analysis: Guice vs Spring

Willam Louth shows how he uses JXInsight Probes to investigate probable performance issues with code bases that he is not familiar with. He also highlights possible pitfalls in creating a benchmark, as well as in the analysis of results.

Filthy Rich Clients



Author(s) Chet Haase, Romain Guy
Publisher Prentice Hall PTR
PubDate August 9, 2007
Reviewer Meera Subbarao
Purchase and help Javalobby






Table of Contents






One Minute Review

Positives
  • Plenty of code snippets
  • Code examples illustrate key concepts
  • In-depth coverage of graphics and GUI fundamentals, performance, images, advanced graphics, animation, etc.
Negatives
  • Some significant knowledge of math is required

Sections

Intent & Audience

The title says it all: 'Developing Animated and Graphical Effects for Desktop Java Applications'. This is not a book about Swing or even about Java. It doesn't tell you how to build a desktop Java application. Nor does it give you best practices for writing a desktop Java application. It will, however, help you to improve existing desktop Java applications.

The authors explain how to create "filthy rich" effects in your applications. Starting from fundamental graphics, GUI, and animation technology, they continue through sample code and algorithms for the effects themselves.

The reader must have some experience using Swing; this is not a primer on Swing. Also, some significant knowledge of math is required, although the authors try to explain along the way. The authors use detailed explanations and several examples as well as screen shots to illustrate key concepts.

back to top Back to top

Relevance of material

The authors intended this book for developers interested in building rich desktop applications using Swing and Java2D. Familiarity with Swing and expertise in Java is definitely needed to get much from it.

The authors try to illustrate animations and dynamic effects using screen shots in the book; these do not give you a clear picture of the effects. Readers building desktop applications will have to spend some time working the examples the authors have on their web site in order to get an idea.

back to top Back to top

Rating

Relevance
Readability
Overall

back to top Back to top

Chapter highlights

Part I. Graphics and GUI Fundamentals

Chapter 1. Desktop Java Graphics APIs: Swing, Java 2D, and AWT
In this chapter the authors explain very simply what AWT, Java 2D and Swing is. If you have a solid understanding of these technologies, you can easily skip this chapter.

Chapter 2. Swing Rendering Fundamentals
If you're writing desktop applications in Swing, you definitely need to understand the basics of Swing rendering. The authors cover topics like events, painting, rendering, double-buffering and threading. The section on Swing's threading model is very interesting; using the SwingWorker with which you can write multithreaded code that is easy to read and maintain.

Chapter 3. Graphics Fundamentals
You will need some background in matrix math to understand some sections in this chapter. In the first few sections the book presents the basics of how to get the Graphics object. Then it looks at some of the graphics state and methods in the Graphics and Graphics2D classes, like foreground and background color, clip, composite, paint, and many more.

Chapter 4. Images
This chapter begins by explaining a few distinct image types, which correspond to specific classes in the JDK: java.awt.Image, java.awt.VolatileImage, and java.awt.image.BufferedImage. The next few sections explain about image scaling and quality versus performance.

Chapter 5. Performance
It is always good to know what is causing your application to slow down; even more so to know the techniques you can use to speed up your application. The authors have provided tiny bits of information throughout the book, but this chapter goes in detail in explaining some techniques. To quote just a few tips here: "use the clip," "use compatible images," "managed images," "intermediate images." This is an important chapter.

back to top Back to top

Part II. Advanced Graphics Rendering

Chapter 6. Composites
This is a tough chapter to understand. A composite is an instance of the interface java.awt.Composite and can be set on a Graphics2D by calling setComposite method. The authors explain the only implementation of Composite (java.awt.AlphaComposite) and the 12 rules as described by T. Porter and T. Duff. All the rules are based on mathematical equations.

Chapter 7. Gradients
If you want to create good-looking user interfaces, this chapter will help you a great deal in using the gradients offered by the Java platform. The authors introduce the new classes introduced in Java SE 6, which should help you create cool graphical effects.

Chapter 8. Image Processing
This chapter begins by showing you how to use a BufferedImageOp to process an image. Next, you see how to use AffineTransformOp filter to reduce the size of the original image by 50%, followed by how to use ColorConvertOp to create a grayscale version of an image. Later sections cover other types of BufferedImageOp like: ConvoleOp, LookupOp, RescaleOp. The chapter concludes with a note about filter performance.

Chapter 9. Glass Pane
In this chapter, you see how to put custom paintings on to your glass pane, how to intercept mouse and keyboard events and prevent them from being dispatched to the other components. It is surprising to see how easy it is to use a glass pane in our applications.

Chapter 10. Layered Panes
The previous chapter showed you how to create a glass pane, but these suffer from some limitations. This chapter covers those limitations and shows you how to use JLayeredPane. It also provides tips on when to use a glass pane and when to use a layered pane.

Chapter 11. Repaint Manager
To quote from the book, "the role of the RepaintManager is to optimize the repaint processing of Swing components". This chapter focuses on the RepaintManager and how you can use it to create advanced visual effects.

back to top Back to top

Part III. Animation

Chapter 12. Animation Fundamentals
The authors give you a solid understanding of animation is this chapter. They start with fundamental concepts, followed by explaining what frame-based animation is. Next they show the various categories of timing functionality, along with how these facilities are provided by Java, and resolution. The final sections discuss how to animate your Swing application: they cover animating graphics and animating GUIs.

Chapter 13. Smooth Moves
This chapter covers techniques that can help you create smooth, realistic, and effective animations. There are many tips in this chapter which will help you to identify and fix some frequent problems you see in animation.

Chapter 14. Timing Framework: Fundamentals
The Timing Framework is a set of utility classes, and this chapter explains several key concepts and properties within the central classes in this framework.

Chapter 15. Timing Framework: Advanced
Chapter 14 covered the core features of the Timing Frameworks. Advanced features like triggers and property setters are covered in this chapter.

back to top Back to top

Part IV. Effects

Chapter 16. Static Effects
Blur, reflection, drop shadows, highlights, and sharpening are non-animated graphical effects you can apply to make your application look better.

Chapter 17. Dynamic Effects
The authors present a variety of dynamic (animated) effects you can use in your applications. They cover effects like motion, fading, pulse, spring, and morphing.

Chapter 18. Animated Transitions
This chapter introduces a library called Animated Transitions. It discusses several example applications that show what the library can do. The code examples on this library are downloadable from the book's web site.

Chapter 19. Birth of a Filthy Rich Client
This final chapter discusses Aerith (a Swing mash-up application). It covers how to run Aerith, and how to define Aerith's workflow: once you have the workflow on paper, proceed to the next step, the vision. Once you have the workflow and the vision, you can start designing each screen individually. Next, the authors show how to create mockup and how to go from mockup to code.

back to top Back to top

Resources