Pure JFC 2D Graphics and Imaging

Pure JFC 2D Graphics and Imaging

by Satyaraj Pantham

Paperback

$29.45 $34.99 Save 16% Current price is $29.45, Original price is $34.99. You Save 16%.

Product Details

ISBN-13: 9780672316692
Publisher: Sams
Publication date: 12/08/1999
Series: Pure Series
Pages: 384
Product dimensions: 5.90(w) x 8.90(h) x 0.90(d)

About the Author

Dr. Satya R. Pantham has eight years of experience as a professional software developer. He is a consultant for Sun/JavaSoft where he worked closely with the JFC development team and created commercial e-mail software with Java and JFC. He is also the author of Pure JFC Swing.

Table of Contents

Introduction1
1Fundamentals of Java 2D3
Java 2D Graphics Model4
User and Device Coordinate Spaces5
User Space5
Device Space6
Creating the Graphics Context6
Hello! Graphics World! Example7
Code Analysis10
Modifying Graphics Attributes10
Specifying Stroke Types11
Specifying Fill Patterns12
Specifying Transforms13
Specifying Clipping Shapes15
Clipping Example15
Specifying Rendering Hints19
Specifying Composition Types20
Compositing Example21
2Color Handling29
Colors and Color Spaces30
Creating the Instances of a Color30
Readily Supported Colors31
Retrieving the Components of a Color32
Retrieving Colors and Color Spaces33
Creating a Color from Hue, Saturation, and Brightness33
Controlling the Brightness and Darkness of a Color34
RGB and HSB Color Conversions34
Demonstration of Colors Example34
Painting with Color Patterns39
Working with Gradient Paint Patterns40
Creating Gradient Paint Pattern Objects40
Gradient Paint Example41
Working with Texture Paint Patterns47
Creating Texture Paint Pattern Objects47
Texture Paint Example47
Color Management51
Accurately Reproducing Colors on Output Devices52
3Geometric Shapes: Lines and Rectangles53
The Shape Interface53
Iteration Objects for Boundary Data54
Determining Whether a Point Is Inside or Outside a Shape54
Defining Points in 2D55
Drawing Lines in 2D56
Creating Line Segments56
Line Drawing Example57
Working Further with Lines63
Redefining a Line Segment63
Retrieving Coordinates or Points64
Distance from a Point to a Line64
Locating a Point Relative to a Line64
Retrieving Boundaries65
Testing Intersections66
Retrieving the Shape Outline Object66
Testing the Equality of Lines66
Drawing Rectangles in 2D67
Creating Instances of Rectangles67
2D Rectangle Example68
Working Further with Rectangles72
Redefining a Rectangle73
Retrieving the Rectangle Parameters73
Unions and Intersections of Rectangles73
Position of a Point Relative to a Rectangle74
Adding a Point to a Rectangle74
Testing Whether a Point or Rectangle Is Inside75
Testing Equality of Rectangles75
Retrieving Boundaries of a Rectangle75
Testing Intersection with a Line75
Retrieving the Outline Iterator76
Drawing Rectangles with Rounded Corners76
Creating Rectangles with Rounded Corners77
Working Further with Rounded Rectangles77
Redefining a Round Rectangle78
Retrieving the Geometric Parameters78
Retrieving the Bounds78
Testing Whether a Point or Rectangle Is Inside79
Retrieving the Boundary Path Data79
Testing Intersection with a Rectangle79
Rounded Rectangle Drawing Example79
4Geometric Shapes: Curves, Arcs, and Ellipses87
Drawing Quadratic Curves87
Creating Quadratic Curves88
Working Further with Quadratic Curves88
Redefining a Quadratic Curve88
Retrieving Points or Coordinates of a Curve89
Retrieving the Flatness Index of a Curve89
Solving for the Roots of a Quadratic Curve91
Subdividing a Curve91
Retrieving Boundaries and the Outline Iteration Object92
Testing the Containment or Intersection92
An Interactive Quadratic Curve Example93
Drawing Cubic Curves98
Creating Cubic Curves98
Working with Cubic Curve Operations99
Redefining a Cubic Curve99
Retrieving the Coordinates99
Testing Containment and Intersections100
Retrieving the Flatness Index100
Solving for Roots of a Cubic Curve101
Subdividing a Cubic Curve101
Retrieving Boundaries of a Cubic Curve101
Cubic Curve Drawing Example102
Drawing Ellipses and Circles110
Circles111
Creating Ellipses111
Working with Ellipse Operations111
Redefining an Ellipse112
Retrieving the Coordinates of an Ellipse112
Testing Containment and Intersections112
Retrieving the Bounding Rectangle of an Ellipse113
Retrieving the Outline Information113
Retrieving the Center of the Bounding Rectangle113
Interactive Ellipse Example113
Drawing Open Arcs, Chords, and Pies119
Creating Open, Chord, and Pie Type Arcs121
Interactive Arc Example121
Working with Arc Operations129
Redefining an Arc129
Retrieving the Parameters of the Arc130
Testing the Containment and Intersection130
Retrieving the Bounding Box of an Arc131
5General Paths and Composite Shapes133
Drawing General Paths133
Winding Rules134
Constructing a General Path136
Retrieving Boundaries of a General Path137
Testing Containment and Intersection137
General Path Example137
Composite Shapes144
Creating the Instances of the Area Class145
Applying Constructive Area Geometry145
Testing for the Type of Shape146
Testing Containment and Intersection146
Retrieving Boundaries147
Retrieving the Path Iterator of a Shape147
Composite Shapes Example147
6Platform Fonts and Text Layout155
Working with Fonts156
Font Terminology156
Creating Fonts158
Retrieving Various Font Names158
Retrieving Platform Fonts158
Deriving New Fonts from the Given Font159
Platform Fonts Example160
Laying Out Text164
Shaping, Ordering, and Positioning Text164
Creating TextLayout Instances165
Rendering Text166
Text Layout Example166
Detecting User Inputs over Text172
Displaying and Moving Carets172
Retrieving Measurement Information173
Finding the Direction of the Text Layout174
Retrieving the Bounds of the Text Layout174
Retrieving Character Information174
Selecting Text by Highlighting175
Hit Testing, Carets, and Highlighting Example176
Working with Text and Graphic Attributes180
Using Text Attributes181
Using Graphic Attributes181
Using Text and Graphic Attributes Example183
Creating Paragraphs by Wrapping Text187
Wrapping Text Example188
7Buffered Imaging191
Anatomy of a Buffered Image191
Retrieving Data, Image Type, and Color Model193
Retrieving the Dimensions of a Buffered Image193
Retrieving a Portion of the BufferedImage194
Image Data Management Using a Raster194
Color Models195
Working with Buffered Images195
Creating a Buffered Image195
Painting on a Buffered Image197
Displaying a Buffered Image198
Buffered Image Example198
Accessing Raster/Data Buffer Example203
Using the Buffered Image208
Replicating the Buffered Image: An Example208
Animation Using the Buffered Image: An Example211
8Image Processing219
Buffered Image and Raster Operations220
Filtering Operations Using Look-Up Tables221
Creating Look-Up Tables222
Creating and Using a Look-Up Operation Filter223
Look-Up Table Example224
Using Rescaling Filters232
Creating and Working with a Rescale Filter233
Rescaling Filter Example234
Using Color Conversion Filters239
Creating and Working with Color Conversion Filters240
Color Conversion Filter Example241
Using Convolution Filters246
Creating a Convolution Kernel247
Creating and Working with Convolution Filters247
Convolved Image Example249
Using Affine Transform Filters256
Creating and Working with an Affine Transform Filter256
Affine Transform Filter Example257
Using Band Combine Filters264
Creating and Working with Band Combine Filters264
Band Combine Filter Example265
9Printing273
Mechanism of Printing274
Creating the Printer Graphics Context275
Working with Page Formats276
Controlling a Printing Job277
A Single-Format Printing Example279
Printing a Book (Multi-Format) Document286
Creating and Working with Books287
Assigning a Book to a Printer Job Control288
An Interactive Drawing Book Example288
10Inheritance Hierarchies and API Quick Reference297
Inheritance Hierarchy Diagrams298
Package Name: java.awt299
Package Name: java.awt.color300
Package Name: java.awt.geom301
Package Name: java.awt.font302
Package Name: java.awt.image303
Package Name: java.awt.image.renderable304
Package Name: java.awt.print304
Selected API Quick Reference304
Package Name: java.awt305
Package Name: java.awt.geom319
Package Name: java.awt.font337
Package Name: java.awt.image341
Package Name: java.awt.print346
Index349

Customer Reviews

Most Helpful Customer Reviews

See All Customer Reviews