The Rendering Pipeline
The original JDK 1.0 had a very simple mechanism for drawing shapes. You select color and paint mode, and call methods of the Graphics class such as drawRect or fillOval. The Java 2D API supports many more options.
You can easily produce a wide variety of shapes.
You have control over the stroke, the pen that traces shape boundaries.
You can fill shapes with solid colors, varying hues, and repeating patterns.
You can use transformations to move, scale, rotate, or stretch shapes.
You can clip shapes to restrict them to arbitrary areas.
You can select composition rules to describe how to combine the pixels of a new shape with existing pixels.
You can give rendering hints to make trade-offs between speed and drawing quality.
To ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access