- The Basic Java 2D Recipe
- Set the Graphics2D Context...
- ...and Render Something
- Rendering on Components
- Shape Primitives
- Graphics Stroking
- Fill Attributes and Painting
- Transparency and Compositing
- Coordinate Space Transformations
- Techniques for Graphical User Input
- Double Buffering
- Comprehensive Example: Kspace Visualization
In this chapter, we covered graphics programming in Java 2D, and you saw that the vast majority of graphics applications in Java 2D follow a basic three step recipeobtain a Graphics2D object, set the context, and render something. You should always consider the relationship between user space and device space when learning advanced features of the platform. The rest is straightforward but does require a knowledge of the vast array of state attributes that can be combined to produce the desired graphics effect as well as how to produce the necessary geometry.
We will next look into buffered imaging and the immediate mode imaging model, which, other than printing, forms the other major part of the Java 2D API.