Java 2D: Graphics in Java 2

Anyone who has even lightly ventured into developing detailed graphical programs with the Abstract Windowing Toolkit (AWT) has quickly realized that the capabilities of the Graphics object are rather limited—not surprisingly, since Sun developed the AWT over a short period when moving Java from embedded applications to the World Wide Web. Shortcomings of the AWT include limited available fonts, lines drawn with a single-pixel width, shapes painted only in solid colors, and the inability to properly scale drawings prior to printing.

Java 2D is probably the second most significant addition to the Java 2 Platform, surpassed only by the Swing GUI components. The Java 2D API provides a robust package of drawing and imaging tools to develop elegant, professional, high-quality graphics. The following important Java 2D capabilities are covered in this chapter:
• Colors and patterns: graphics can be painted with color gradients and fill patterns.
• Transparent drawing: opaqueness of a shape is controlled through an alpha transparency value.
• Local fonts: all local fonts on the platform are available for drawing text.
• Explicit control of the drawing pen: thickness of lines, dashing patterns, and segment connection styles are available.
• Transformations of the coordinate system—translations, scaling, rotations, and shearing—are available.

Get pdf download Java 2D: Graphics in Java 2

Related Tutorial

Tags: , , , , , , , , , , , , , , , , , , ,

Comments

Leave a Reply