It's Raining Books Sale
 
 

Recently Viewed clear list


Original Essays | September 17, 2014

Merritt Tierce: IMG Has My Husband Read It?



My first novel, Love Me Back, was published on September 16. Writing the book took seven years, and along the way three chapters were published in... Continue »
  1. $16.77 Sale Hardcover add to wish list

    Love Me Back

    Merritt Tierce 9780385538077

spacer
Qualifying orders ship free.
$8.50
List price: $39.95
Used Trade Paper
Ships in 1 to 3 days
Add to Wishlist
Qty Store Section
1 Local Warehouse Computer Languages- Java

More copies of this ISBN

Java 2D Graphics (Java Series)

by

Java 2D Graphics (Java Series) Cover

 

Synopses & Reviews

Publisher Comments:

One weakness of Java has been its graphics capabilities. Java 1.0 and 1.1 only included simple primitives for line drawing: lines could only be one pixel wide, they could only be solid, and there wasn't any good way to draw curves. Font management and color management were also weak. Java 2D (collectively called the "2D API") signals a major improvement in Java's graphics capabilities. It covers many of the classes in Java 1.2 that address graphics handling and improves on many weaknesses that were present in the previous versions of Java.

The 2D API allows you to produce high-quality, professional images on a screen or printer. Java 2D Graphics describes the 2D API from top to bottom, demonstrating how to set line styles and pattern fills as well as more advanced techniques of image processing and font handling. You'll see how to create and manipulate the three types of graphics objects: shapes, text, and images. Other topics include image data storage, color management, font glyphs, and printing.

Java 2D Graphics assumes no prior knowledge of graphics. Chock full of detailed explanations and examples, this book provides beginning Java programmers with a solid foundation in 2D graphics and helps more advanced programmers create and use high-quality images in their applications.

Topics covered in the book include:

  • The rendering pipeline
  • Shapes and paths
  • Geometry
  • Painting with solid colors, gradients, and textures
  • Stroking paths, including dashed lines
  • Transformations: translation, rotation, shearing, and scaling
  • Alpha compositing
  • Clipping
  • Rasterizing and antialiasing
  • Fonts and text
  • Font metrics
  • Glyphs
  • Colors and color spaces
  • sRGB and CIEXYZ
  • ICC color profiles
  • Images, image color models, and image data
  • Image processing
  • Image data storage
  • Graphics devices
  • Printing

Java 2D Graphics

Table of Contents

 

Preface

1. Introduction
     What Is Java 2D?
     What Can Java 2D Do?
     Relatives
     Genesis
     Where Do I Get a Graphics2D?
     File Formats
     Hello, 2D!

2. The Big Picture
     Graphics2D
     The Rendering Pipeline
     All About Alpha
     Compositing
     Coordinate Space

3. Geometry
     Points
     Shapes and Paths
     Lines and Curves
     Rectangles
     Ellipses and Arcs
     Constructive Area Geometry

4. Painting and Stroking
     Painting
     Stroking
     Overlap

5. Rendering
     Transforming
     Compositing
     Clipping
     Rendering Hints

6. Text
     Overview
     Drawing Text
     Fonts
     Font Metrics

7. Advanced Text Layout
     Using the TextLayout Class
     Getting Close to the Metal

8. Color
     If You're Not Too Picky-
     Physics and Physiology
     Color Spaces
     Profiles
     Putting It All Together

9. Images
     Overview
     Where Do Images Come From?
     Displaying Images
     Drawing on Images
     Double Buffering
     A Useful Class

10. Image Processing
     The New Model
     An Appetizer
     Predefined Operations
     Roll Your Own

11. Image Guts
     BufferedImage
     Color Models
     Rasters
     Sample Models
     Data Buffers
     A PNG Decoder

12. Devices
     The Local Graphics Environment
     The GraphicsDevice Class
     Device Configurations

13. Printing
     How Printing Works
     Controlling Printing
     Power Printing

14. Animation and Performance
     It's Tougher Than You Might Think
     See for Yourself
     Memory
     Optimizations

Java 2D Graphics

Index

 
[ A ], [ B ], [ C ], [ D ], [ E ], [ F ], [ G ], [ H ], [ I ], [ J ], [ K ], [ L ], [ M ], [ N ], [ O ], [ P ], [ Q ], [ R ], [ S ], [ T ], [ U ], [ V ], [ W ], [ X ],
2D API (Java 2D Application Programming Interface), xi, 1, 6
      animation, 304-305
      image processing, 201-202, 211-223
      output devices, 269
      Printing API, 275-277, 287

#LINK[ Top ]>#
Abstract Windowing Toolkit (see AWT)
Accessibility API, 5
acyclic gradients, 64
add( ), 56
addAttribute( ), 113
addImage( ), 189
addition (union) operator, 55
addRenderingHints( ), 107
Adobe Systems, Java 2D API, 6
advance of text, 110, 142
affine transformations, 81-83
AffineTransform class, 81-95
AffineTransformOp class, 216-218
aliasing and antialiasing, 4, 20
      rendering, 104
      XOR mode, 103
aligning text and graphics, 117
alpha channel, 21, 230
alpha compositing (see compositing)
alpha values, 21-22, 230, 239
      color models, 234
      of pixel samples, 236, 237
AlphaComposite class, 98-99
animation, 305-306, 310
      2D API, 304-305
      frame rate, 307
      images, 321-326
      shapes, 310-316
      text, 316-321
AnimationComponent class, 305-310
AnimationFrame class, 310
append( ), 38
Applet class, 181
applets, 181, 186
applications, obtaining images, 182
Arabic text, 111, 123-125, 142
arc angles, 54
Arc2D class, 52-54
arcs, 52-54
Area class, 55-56
arrays, xiv
arrow keys, moving caret through bidirectional text, 147
ascent of text, 109, 135, 142
attributed character iterator, 114
AttributedCharacterIterator interface, 113-117, 138
AttributedString( ), 113
AWT (Abstract Windowing Toolkit), 5
      paint( ), 293

#LINK[ Top ]>#
BandCombineOp class, 255-257
BandedSampleModel subclass, 258
baselines, 137, 142
      glyphs, 111
BasicStroke class, 73-78
bit masks, 242
BITMASK value, 68
blockingLoad( ), 198
BufferedImage class, 8, 66, 180, 193, 201-202, 211-223, 227
      components of, 228-230
      constants, 231
      constructors, 230-231
      memory usage, 326
BufferedImageOp interface, 201-202, 211-223
      writing image operators, 223-224
ByteLookupTable subclass, 218-220

#LINK[ Top ]>#
calculateFrameRate( ), 308
cancel( ), canceling print jobs, 283
carets, 145
      bidirectional text, 145-146
      moving, 147-150
      posture of, 150
      shapes of, 146-147
center baseline, 111
centerFrame( ), 198
character iterator, 114
CIEXYZ color space, 171-176
classes, 26
      class names, xiii
      Java 2D API, 1
clipping, 4, 81, 103
      clipping shapes, 17, 19
closePath( ), 38
CMY color space, 173
CMYK color space, 173
Color class, 61, 166, 167-170, 175
color models, 228-230, 241-245
      converting
            color to pixel samples, 238, 240-241
            pixel samples to color, 235-237, 239-240
      data types (see color models, transfer types)
      information about, retrieving, 234
      retrieving, 232, 272
      transfer types, 234, 248-250
            constants, 260
color palettes, 243-245
      designating, 231
color profiles, 175-176
      in Java 2D, 177
color spaces, 171, 172
      CIEXYZ, 171-176
      CMY, 173
      CMYK, 173
      constructing profiles for, 177
      converting, 174-175, 222-223
      grayscale, 173
      HSV, 173
      information about, retrieving, 234
      retrieving, 175
      RGB, 172, 173, 241-243
      sRGB, 172, 173, 175, 243
      types, 172-173
ColorConvertOp class, 222
ColorModel class, 69, 241-245
colors, 4, 19, 62, 170
      animation (see images, animating)
      buffered images, 231
      color components, 174
      color profiles (see color profiles)
      color spaces (see color spaces)
      compositing, 97, 99-103
      converting
            into grayscale, 175
            from pixel samples, 235-237, 240-241
            to pixel samples, 238, 239-240
      dithering, 105
      GIF images, 9
      JPEG images, 10
      lookup tables, 218-220
      of pixels, retrieving/setting, 232
      opaque, stroking and painting, 79
      Paint class, 17
      rendering, 106
      rendering hint for, 178
      RGB, 166, 167-168, 171
      screen devices, 170-171
      setting in Swing, 62, 64
      transparency modes, 68
      transparent, creating, 166-167
      values of, retrieving, 167
ColorSpace class, 172, 174-175
Component class, xiii, 7
ComponentColorModel subclass, 239-240
ComponentSampleModel subclass, 258-259
compositing, 3, 81, 95-96
      alpha, 96-98, 230
      rules, 17, 19, 22, 96, 98-103
            Porter-Duff, 96-98
computer monitors (see screen devices)
concatenate( ), 94
constructive area geometry, 54-56
contains( ), 29
control points, 31, 33
convolution operators, creating, 213
ConvolveOp class, 211-216
coverage values, 21
createBandedRaster( ), 252
createCompatibleDestImage( ), 223
createCompatibleDestRaster( ), 255
createCompatibleImage( ), 184, 274
createContext( ), 69
createGlyphVector( ), 158
createGraphics( ), 193
createImage( ), 184
      loading images from URLs, 182
createInterleavedRaster( ), 250-251
createInverse( ), 95
createJPEGDecoder( ), 183
createJPEGEncoder( ), 183
createPackedRaster( ), 253
createRaster( ), 254
createTransformedShape( ), 83
createWritableRaster( ), 254
cubic curves, 32, 33, 38, 42
CubicCurve2D class, 42-43
currentSegment( ), 33
cursors, 145
curves, 31, 33, 38, 39-47
curveTo, 38
cyclic gradients, 64

#LINK[ Top ]>#
dashed lines, 76-77
data buffers, 228
DataBuffer class, 259-260
DataBufferByte( ), 260
decode( ), 129
decodeAsBufferedImage( ), 183
defaultPage( ), 284
deleteChar( ), 157
deriveFont( ), 129
      confusion about, 132
descent of text, 109, 135, 142
Device Space, 23-24
DirectColorModel subclass, 241-243
dispose( ), 69
dithering, 105
double buffering, 195
      memory usage, 327
      in Swing, 198, 288
Double subclass
      Arc2D class, 54
      CubicCurve2D class, 43
      Ellipse2D class, 52
      Line2D class, 40
      Point2D class, 25, 27
      QuadCurve2D class, 42
      RoundRectangle2D class, 52
Drag and Drop API, 5
draw( ), 18, 28, 73, 141
      stroke, 17
drawGlyphVector( ), 157
drawImage( ), 18
      displaying images, 190-192
      image observer, 185-186
drawing surfaces, 17
drawString( ), 18, 110, 111-114, 115

#LINK[ Top ]>#
Eastman Kodak, role in developing Java 2D API, 6
edge detection, 214
Ellipse2D class, 52
ellipses, 52
encode( ), 184
end styles, 74
endpoints, 32-33, 39
environment (see graphics environment)
exclusive or operator, 55
exclusiveOr( ), 56
ext
      descent, 142

#LINK[ Top ]>#
file formats, 10
filenames, xiii
fill( ), 18, 28, 61
filling shapes, 3
filter( )
      image processing, 201-202, 223
      rasters, 254
flattened paths, 30
FlatteningPathIterator class, 30
flicker, eliminating, 195
Float subclass
      Arc2D class, 54
      CubicCurve2D class, 43
      Ellipse2D class, 52
      Line2D class, 40
      Point2D class, 25, 27
      QuadCurve2D class, 42
      RoundRectangle2D class, 51
Font class, 132-139
      constructor, 126
      methods for instantiating GlyphVectors, 158
font metrics, 109-110, 133
      retrieving, 133-139
font properties file, 128
FontMetrics class, 132
FontRenderContext class, 133-139, 140
fonts, 4, 109
      creating, 126
            from existing fonts, 129-132
            from system properties, 129
      current font, 109
      font hinting, 130
      information about, retrieving, 270
      installed, retrieving list of, 127
      Java 2 bug in, 124
      names of, 126, 127
      physical fonts, 128
      text attribute for, 116
      Type 1 and TrueType, 4
      (see also font metrics)
Fourier Transform, 215
frequency domain, 215
fromCIEXYZ( ), 175
fromRGB( ), 175

#LINK[ Top ]>#
GeneralPath class, 37-38
GeneralPath( ), 37
getAdvance( ), 142, 163
getAllFonts( ), 127, 270
getAlpha( ), 167
getAnchorRect( ), 67
getAscent( ), 135, 142
getAvailableFontFamilyNames( ), 127, 270
getBaseline( ), 142
getBaselineIndex( ), 137
getBaselineOffsets( ), 137, 142
getBestConfiguration( ), 272
getBlue( ), 167
getBounds( ), 28, 142, 246
getBounds2D( ), 28, 162, 224
getCaretShape( ), 147
getCaretShapes( ), 146-147
getCenterX( ), 48
getCenterY( ), 48
getCharIndex( ), 145
getColor1( ), 65
getColor2( ), 65
getColorComponents( ), 174, 175
getColorModel( ), 69, 232, 272
getColorSpace( ), 175, 234
getComponentSize( ), 234
getConfigurations( ), 271
getDataElements( ), 238, 249
getDefaultConfiguration(), 272
getDefaultScreenDevice( ), 270
getDefaultToolkit( ), 182
getDefaultTransform( ), 273
getDescent( ), 135, 142
getDevice( ), 272
getFamily( ), 126
getFont( ), 126, 129
getFontList( ), 126
getFontName( ), 126
getFontRenderContext(,), 133
getFrame( ), 84
getGlyphMetrics( ), 161
getGlyphOutline( ), 159
getGlyphPosition( ), 159
getGraphics( ), 193
getGreen( ), 167
getHeight( ), 48, 135, 180, 231, 246
      retrieving height of paper, 280
getImage( ), 67
      loading images from URLs, 181-182
getImageableHeight( ), 280
getImageableWidth( ), 280
getImageableX( ), 280
getImageableY( ), 280
getInsertionIndex( ), 145
getInstance( ), 98
      ColorSpace, retrieving, 173
      ICC_Profile class, instantiating, 177
getIterator( ), 113
getLeading( ), 135, 142
getLineMetrics( ), 132, 135
getLocalGraphicsEnvironment( ), 269
getLogicalBounds( ), 160
getLogicalHighlightShape( ), 151
getLSB( ), 163
getMaxX( ), 48
getMaxY( ), 48
getMinX( ), 48, 246
getMinY( ), 48, 246
getName( ), 126
getNextLeftHit( ), 147
getNextRightHit( ), 147
getNonClearingFrame( ), 198
getNormalizingTransform( ), 273
getNumColorComponents( ), 234
getNumComponents( ), 174, 234
getNumDataElements( ), 249
getNumGlyphs( ), 160
getOrientation( ), 280
getOutline( ), 142, 159
getPathIterator( ), 29-30
getPixel( ), 247
getPixels( ), 247
getPoint1( ), 65
getPoint2( ), 65
getPoint2D( ), 224
getPosition( ), 156
getPrinterJob( ), 282
getRaster( ), 69, 232
getRed( ), 167
getRenderingHint( ), 107
getRenderingHints( ), 107
      image operator, 224
getRGB( ), 232
getRGBColorComponents( ), 174
getRotateInstance( ), 88
getRSB( ), 163
getSample( ), 247
getSampleModelTranslateX( ), 247
getSampleModelTranslateY( ), 247
getSamples( ), 248
getScreenDevices( ), 270
getShearInstance( ), 92
getStrikethroughOffset( ), 139
getStrikethroughThickness( ), 139
getStringBounds( ), 133
      bug in, 134
getSubimage( ), 180
getTextureImage( ), 122
getTransferType( ), 249
getTranslateInstance( ), 84
getTransparency( ), 68
getType( ), 232, 271
getUnderlineOffset( ), 139
getUnderlineThickness( ), 139
getVisualBounds( ), 160
getVisualHighlightShape( ), 151
getWidth( ), 47, 179, 231, 246
      retrieving width of paper, 280
getWindingRule( ), 35, 37
getX( ), 27, 47
getY( ), 27, 47
GIF (Graphics Interchange Format), 9
      images, 181
GlyphMetrics class, 157, 161-164
glyphs, 108-110, 125, 157, 159, 160
      baselines, 111
      glyph codes, 158
      metrics of, 161-163
      rasterized, 112
      scaling, 130
      types of, 163-164
GlyphVector class, 157-161
GradientPaint class, 64-66
      acyclic and cyclic, 64
GradientPaint( ), 65
gradients, 64
GraphicAttribute class, 118-120
graphics
      aligning with text, 117
      embedding in text, 117-120
      primitives, 16
      (see also colors; images)
Graphics class, xiii, xiv
      displaying images with, 190-191
      rendering shapes, 28
graphics environment, 269-272
      creating images compatible with device configuration, 273-274
Graphics Interchange Format (see GIF)
Graphics2D class, xiii, xiv, 7-8, 16
      displaying images with, 191-192
      elements in, 17
GraphicsConfiguration class, 184, 271
GraphicsDevice class, 270, 270-271
GraphicsEnvironment class, 127, 269-270
grayscale color space, 173
grid fitting, 113

#LINK[ Top ]>#
hanging baseline, 111
hasAlpha( ), 234
Hebrew text, 123-125
highlighting text, 151-153
hit testing, 143-145
hitTextChar( ), 143
HSV color space, 173

#LINK[ Top ]>#
ICC_ColorSpace subclass, 177
ICC_Profile class, 177
identity kernels, 212
Image class, 8, 179-180, 193-194
imageable area (see printing, imageable area)
ImageFilter class, 202
ImageGraphicAttribute subclass, 118
ImageIcon class, 190
ImageObserver interface, 186
images, 4
      aliased and antialiased, 20
      animating, 321-326
      applets, 181, 186
      applications obtaining, 182
      blurring/sharpening, 211-216
      brightness of, 220-222
      buffered, 180, 183-184, 193, 211-223, 227-231
            creating, 198
            destination/source, 201-202, 223
            information about, retrieving, 231
      color (see colors)
      compatible with device configuration, creating, 273-274
      creating, 180, 184-185
            with Swing, 190
      displaying, 190-192
      double buffering, 195
            in Swing, 198
      as drawing surfaces, 193-194
      edges of, 213
      eliminating flicker, 195
      GIF, 181
      Graphics2D object, 8
      height/width, retrieving, 179
      image filtering, 201-202
      image observer, 185-186
            MediaTracker, 188-190
      image operators, writing, 223-224
      image processing, 4, 104, 106, 201-202, 211-223
            utilities for, 10
      JPEG, 181
            decoding/encoding, 183
      kernels, 212
      loading, 198
            with Swing, 190
            from URLs, 181-182
      lookup tables, 218-220
            adjusting brightness with, 221-222
      memory usage, 326-327
      pixels (see pixels)
      PNG, 261-268
      rasterizing, 19
      rescaling operators, 220-221
      thresholding, 223, 224
      transforming, 216-218
imageUpdate( ), 186
IndexColorModel subclass, ??-245
indexColorModel subclass, 243-??
inner child classes, 26
inner classes, 26
insertChar( ), 157
intersect( ), 56
intersection operator, 55
intersects( ), 29
intersectsLine( ), 49
isAlphaPremultiplied( ), 232
isCyclic( ), 65
isDone( ), 33
isErrorID( ), 189
isLeadingEdge( ), 145
isLeftToRight( ), 143
iterator, 114

#LINK[ Top ]>#
jaggies, 20
JAI API, 5
Java 2D API, 6
Java 3D, 5
Java Advanced Imaging API, 5
Java Development Kit 1.2 (see JDK 1.2)
Java Foundation Classes (see JFC)
Java Media APIs, 5
Java Virtual Machine (JVM), 304
JColorChooser class (Swing), 62, 64
JDK (Java Development Kit) 1.2, xiii
JEditorPane class (Swing), 110
JFC (Java Foundation Classes), 5
join styles of line segments, 75
Joint Photographic Experts Group (see JPEG image format)
JPEG class, 184
JPEG image format, 10, 181, 183
JPEG package, 2, 183
JPEGCodec class, 183
JTextArea class (Swing), 110
JTextComponent class (Swing), 110
JTextField class (Swing), 110
justifying text, 117
JVM (Java Virtual Machine), 304

#LINK[ Top ]>#
Kernel class, 212
kernels, 212
KEY_COLOR_RENDERING, 178
Kodak Photo CDs, 173
Kodak, role in developing Java 2D API, 6

#LINK[ Top ]>#
leading of text, 109, 135, 142
left side bearing (LSB), 162
ligatures, 108
Line2D class, 39-40
LineBreakMeasurer class, 153-157
LineMetrics class, 132-139
lines, 31, 39-47
      appending to paths, 38
      dashed, 76-77
      end styles of, 74
      segments, joining, 75-76
lineTo( ), 38
local variables, distinguishing, xiv
lookup tables, adjusting brightness with, 221-222
LookupOp class, 219
LookupTable class, 218
LSB (left side bearing), 162

#LINK[ Top ]>#
makeBufferedImage( ), 198
MediaTracker class, 188-190
member variables, distinguishing, xiv
memory usage
      double buffering, 327
      images, 326-327
      in Swing, 327
mouse clicks, locating text in relation to, 143-145
moveTo( ), 38
MultiPixelPackedSampleModel class, 259

#LINK[ Top ]>#
next( ), 33
nextLayout( ), 154
nextOffset( ), 156

#LINK[ Top ]>#
objects, 23
OPAQUE value, 68
operators, 55, 56
outcode( ), 49
output devices, 16
      (see also printing)

#LINK[ Top ]>#
packages
      Java 2D API, 1
      JPEG, 2, 183
      print, 275
packed integers, 166
PackedColorModel subclass, 241
page orientation, 280-281
Pageable interface, 283, 301-302
pageDialog( ), 284
PageFormat class, 279-282
paint()
      casting, xiii
paint( ), 287
      animation, 306
      casting, 7
      highlighting text, 153
      rendering carets through TextLayout, 149
Paint interface, 17, 68-69
paintComponent( ), 7
PaintContext class, 68-69
painting, 59, 60-73
      stroking and, 79
Paper class, 282
Paper( ), 282
PathIterator interface, 30-37
paths, 29-30
      building, 37-38
      segments of, 31-34
performance tuning, 326-328
Photo CDs, 173
physical fonts, 128
pixel samples, 228
      alpha values of, 236, 237
      converting
            from color, 238, 239-240
            to color, 235-237, 240-241
      retrieving/setting, 247-248
            with transfer type, 249-250
PixelInterleavedSampleModel subclass, 258
pixels, 25, 179
      colors of, retrieving/setting, 232
      defined by, 21
      packed, 253-254, 259
      (see also colors)
PNG (Portable Network Graphics) image, loading with a palette, example of, 261-268
Point2D class, 25-27
points, 25
      locating, 27
      position of, setting, 26
Portable Network Graphics image (see PNG)
Porter-Duff rules for compositing, 96-98
PostScript, Java 2D API, 6
preConcatenate( ), 94
premultiplied alpha, 230, 232
print( ), 278-279, 283, 287
print package, 275
Printable interface, 277, 278-279, 294-298
printDialog( ), 284
PrinterJob class, 277, 282-283, 284
printers, 270
printing, 4, 282-283
      adding to existing application, 287
      dialog for, 284
      imageable area, 280, 281
      multiple pages, 294-298
            with different paper orientations and sizes, 301-302
      page orientation, 280
            setting, 281
      silent, 284
      transformation, 23
      User Space origin, 279
      (see also graphics environment)
Printing API, 275-277, 287

#LINK[ Top ]>#
QuadCurve2D class, 41-42
quadratic curves, 31, 32, 38, 41
quadTo( ), 38

#LINK[ Top ]>#
Raster class, 69, 245
      creating rasters, 254
            factory methods for, 250-254
      data transfer, 248-250
      subclasses of, 248
rasterizer, 6, 22
rasterizing, 19
      glyphs, 112
RasterOp interface, 254
      (see also BufferedImageOp interface)
rasters, 228-230, 245
      banded, 251-252
      creating, 250-254
      information about, retrieving, 246-247
      interleaved, 250-251
      packed, 252
      processing, 254-257
      retrieving, 232
      sample models, 228-230, 247, 251, 258-259
      (see also colors)
Rectangle class, 28, 50
Rectangle2D class, 28, 49, 66
rectangles, 47-52
      bounds of, setting, 48-49
RectangularShape class, 47-49
removeImage( ), 189
render( ), 306
rendering, 22
      rendering engine, 16
      rendering hints, 18, 19, 81, 104-107
            for color handling, 178
      rendering pipeline, 18-19
RenderingHints class, 104-107
RescaleOp class, 220-221
rescaling operators, 220
RGB color space, 166, 167-168, 172, 173, 241-243
right side bearing (RSB), 162
Roman baseline, 111
rotate( ), 88, 93, 95
rotation, 87-90
round rectangles, 50-52
RoundRectangle2D class, 50-52
RSB (right side bearing), 162
runtime platform, obtaining Toolkit subclass for, 182

#LINK[ Top ]>#
sample models (see rasters, sample models)
SampleModel class, 258-259
scale( ), 93, 95
scaling, 90-91
screen devices, 270, 271
      colors, 170-171
      creating images for, 185
      gradients, 65
      transformation, 23
      (see also graphics environment)
segment types, 31-34
setArc( ), 53
setArcByCenter( ), 54
setClip( ), 103, 104
setColor( ), 62
setComposite( ), 98
setCurve( ), 41-43
setDataElements( ), 249
setDoubleBuffered( ), 328
setFont( ), 109
setFrame( ), 48
setGlyphPosition( ), 161
setGlyphTransform( ), 161
setImageableArea( ), 282
setJobName( ), 283
setLine( ), 39
setLocation( ), 26
setOrientation( ), 281
setPageable( ), 283
setPaint( ), 61, 62, 73
setPaintMode( ), 101
setPaper( ), 281
setPixel( ), 248
setPixels( ), 248
setPosition( ), 156
setPrintable( ), 282
setRect( ), 49
setRenderingHint( ), 106
setRenderingHints( ), 106
setRGB( ), 232
setRoundRect( ), 51
setSample( ), 248
setSamples( ), 248
setSize( ), 282
setStroke( ), 73
setToRotation( ), 88
setToShear( ), 92
setToTranslation( ), 84
setTransform( ), 82
setXORMode( ), 101
Shape interface, 18, 28-38
ShapeGraphicAttribute subclass, 118
shapes, 2, 27-38
      animating, 310-316
      clipping, 103
      combining, 54-56
      filling, 19
      interiors of, 35-37
      moving, 83-87
      outlines of, 74, 78
      rasterizing, 19
      rendering, 19
      rotating, 87-90
      scaling, 90-91
      transforming, 19
shear( ), 92, 93, 95
shearing, 91-92
ShortLookupTable subclass, 218-220
showDialog( ) (Swing), 63
signal processing, 215
SinglePixelPackedSampleModel class, 259
sizeContainerToComponent( ), 198
spatial convolution, 211
spatial domain, 215
square brackets ([]), xiv
sRGB color space, 172, 173, 175, 243
static members, xiv
strikethrough text, 116, 138-139
Stroke class, 74
stroking, 3, 17, 59, 73-76, 77-78
      dashed lines, 76-77
      painting and, 79
style runs, 157
      (see also glyphs)
subpaths, 33
subtract( ), 56
subtraction operator, 55
Swing, 5
      colors, setting, 62, 64
      components in, 7
      double buffering, 198
      images, 190
      memory usage, 327
      printing, adding support to existing application, 287-293
      text rendering in, 110

#LINK[ Top ]>#
Taligent, development of Java 2D API, 7
text, 4, 153-157
      advance of, 110, 142
      aligning with graphics, 117
      animating, 316-321
      ascent, 109, 135, 142
      attributed character iterator, 114
      attributes, 114-117
      baselines, 111, 137, 142
      bidirectional, 111, 123-125, 142
            carets, 145-146, 147-150
      bounds of, 142
      centering, horizontally, 134
      character iterator, 114
      deleting characters, 157
      descent, 109, 135
      drawing, 111-125
      embedding graphics in, 117-120
      highlighting, 151-153
      inserting characters, 157
      justifying, 117
      leading, 109, 135, 142
      locating in relation to mouse clicks, 143-145
      rendering hints for, 106
      retrieving lines of, 154
      strikethrough, 138-139
      transforming, 120-122
      underline, 138-139
      (see also fonts)
TextAttribute class, 138
TextHitInfo class, 143-153
TextLayout class, 110, 140-142, 145-146, 151-153
      carets, moving, 147-150
      constructor, 141
      metrics, retrieving, 142-143
texture, 66
texture rectangle, 66
TexturePaint class, 66-68
thresholding, 223, 224
timeStep( ), 305
toCIEXYZ( ), 174
toRGB( ), 175
transfer types (see color models, transfer types)
transform( ), 82, 83
transformations, 3, 17, 19, 23, 29
      affine, 81-83
      compound, 93-94
      inverse, 95
      rotation, 87-90
      scaling, 90-91
      shearing, 91-92
      translation, 83-87
      on User Space, 95, 273
Transformers class, 84, 88, 92
translate( ), 84, 93, 95
translated rotations, 87, 89
translation, 83-87
TRANSLUCENT value, 68
Transparency interface, 68-69
transparency modes, 68
tristimulus theory, 170
Type 1 and TrueType fonts, 4
TYPE_HSV color space type, 173

#LINK[ Top ]>#
UI toolkit, 5
underline text, 116, 138-139
URLs, loading images from, 181-182
User Coordinate Space (see User Space)
User Space, 23-24, 84
      origin on printed page, 279
      transformations on, 95, 273
Utilities class, 198

#LINK[ Top ]>#
variables, distinguishing between, xiv
versions, Java 2D, xi, xiii, 5

#LINK[ Top ]>#
waitForID( ), 189
waitForImage( ), 198
web browsers, embedding graphics in text, 117
WIND_EVEN_ODD constant, 35
WIND_NON_ZERO constant, 36
winding rules, 35-37
WritableRaster subclass, 248, 249
      creating, 250

#LINK[ Top ]>#
XOR mode, 101-103

 END

Synopsis:

This text describes the 2D API, demonstrating how to set line styles and pattern fills. It shows how to create and manipulate the three types of graphics objects - shapes, text and images - and covers image data storage, colour management, font glyphs and printing.

Synopsis:

Appealing to all levels of Java programmers, "Java 2D" describes the 2D API from top to bottom, demonstrating how to set line styles and pattern fills as well as more advanced techniques of image processing and font handling. Readers will learn how to create and manipulate the three types of graphics objects: shapes, text, and images.

Synopsis:

One weakness of Java has been its graphics capabilities. Java 1.0 and 1.1 only included simple primitives for line drawing: lines could only be one pixel wide, they could only be solid, and there wasn't any good way to draw curves. Font management and color management were also weak. Java 2D (collectively called the "2D API") signals a major improvement in Java's graphics capabilities. It covers many of the classes in Java 1.2 that address graphics handling and improves on many weaknesses that were present in the previous versions of Java.The 2D API allows you to produce high-quality, professional images on a screen or printer. Java 2D Graphics describes the 2D API from top to bottom, demonstrating how to set line styles and pattern fills as well as more advanced techniques of image processing and font handling. You'll see how to create and manipulate the three types of graphics objects: shapes, text, and images. Other topics include image data storage, color management, font glyphs, and printing.Java 2D Graphics assumes no prior knowledge of graphics. Chock full of detailed explanations and examples, this book provides beginning Java programmers with a solid foundation in 2D graphics and helps more advanced programmers create and use high-quality images in their applications.Topics covered in the book include:

  • The rendering pipeline
  • Shapes and paths
  • Geometry
  • Painting with solid colors, gradients, and textures
  • Stroking paths, including dashed lines
  • Transformations: translation, rotation, shearing, and scaling
  • Alpha compositing
  • Clipping
  • Rasterizing and antialiasing
  • Fonts and text
  • Font metrics
  • Glyphs
  • Colors and color spaces
  • sRGB and CIEXYZ
  • ICC color profiles
  • Images, image color models, and image data
  • Image processing
  • Image data storage
  • Graphics devices
  • Printing

About the Author

Jonathan Knudsen is an author at O'Reilly & Associates. His books include The Unofficial Guide to Lego Mindstorms Robots, Java 2D Graphics, and Java Cryptography. He is the Courseware Writer for LearningPatterns.com.

Table of Contents

CopyrightPrefaceChapter 1: IntroductionChapter 2: The Big PictureChapter 3: GeometryChapter 4: Painting and StrokingChapter 5: RenderingChapter 6: TextChapter 7: Advanced Text LayoutChapter 8: ColorChapter 9: ImagesChapter 10: Image ProcessingChapter 11: Image GutsChapter 12: DevicesChapter 13: PrintingChapter 14: Animation and PerformanceChapter 15: Color GalleryColophon

Product Details

ISBN:
9781565924840
Author:
Knudsen, Jonathan B.
Publisher:
O'Reilly Media
Author:
Knudsen, Jonathan B.
Location:
Beijing
Subject:
Programming Languages - General
Subject:
Computer Graphics - General
Subject:
Computer graphics
Subject:
Computers
Subject:
Java (Computer program language)
Subject:
Programming Languages - Java
Subject:
Java
Subject:
Books; Computers & Internet; Internet & World Wide Web; Scripting & Programming; Java
Subject:
Books; Computers & Internet; Internet & World Wide Web; Scripting & Programming; Java; General
Subject:
Books; Computers & Internet; Internet & World Wide Web; Scripting & Programming; Java; Introduction
Subject:
Books; Computers & Internet; Internet & World Wide Web; Scripting & Programming; Java; Reference
Subject:
2D API;Java 2D Graphics;programming,
Subject:
Graphics-General
Copyright:
Edition Number:
1st ed.
Edition Description:
Print PDF
Series:
Java Series
Series Volume:
93-R027
Publication Date:
19990531
Binding:
TRADE PAPER
Language:
English
Illustrations:
Yes
Pages:
368
Dimensions:
9.19 x 7 x 0.74 in 1.28 lb

Other books you might like

  1. Sweet Life: Erotic Fantasies for Couples Used Trade Paper $6.95
  2. Design Patterns: Elements of...
    Used Hardcover $41.00
  3. Java in a Nutshell 3RD Edition Used Trade Paper $1.00
  4. Palm Os Programming 2ND Edition the... Used Trade Paper $2.25
  5. The complete tales and poems of... Used Hardcover $5.50
  6. Learning Wireless Java New Trade Paper $40.95

Related Subjects

Computers and Internet » Computer Languages » Java
Computers and Internet » Graphics » General
History and Social Science » Archaeology » General
History and Social Science » Politics » General

Java 2D Graphics (Java Series) Used Trade Paper
0 stars - 0 reviews
$8.50 In Stock
Product details 368 pages O'Reilly & Associates - English 9781565924840 Reviews:
"Synopsis" by , This text describes the 2D API, demonstrating how to set line styles and pattern fills. It shows how to create and manipulate the three types of graphics objects - shapes, text and images - and covers image data storage, colour management, font glyphs and printing.
"Synopsis" by ,
Appealing to all levels of Java programmers, "Java 2D" describes the 2D API from top to bottom, demonstrating how to set line styles and pattern fills as well as more advanced techniques of image processing and font handling. Readers will learn how to create and manipulate the three types of graphics objects: shapes, text, and images.
"Synopsis" by ,

One weakness of Java has been its graphics capabilities. Java 1.0 and 1.1 only included simple primitives for line drawing: lines could only be one pixel wide, they could only be solid, and there wasn't any good way to draw curves. Font management and color management were also weak. Java 2D (collectively called the "2D API") signals a major improvement in Java's graphics capabilities. It covers many of the classes in Java 1.2 that address graphics handling and improves on many weaknesses that were present in the previous versions of Java.The 2D API allows you to produce high-quality, professional images on a screen or printer. Java 2D Graphics describes the 2D API from top to bottom, demonstrating how to set line styles and pattern fills as well as more advanced techniques of image processing and font handling. You'll see how to create and manipulate the three types of graphics objects: shapes, text, and images. Other topics include image data storage, color management, font glyphs, and printing.Java 2D Graphics assumes no prior knowledge of graphics. Chock full of detailed explanations and examples, this book provides beginning Java programmers with a solid foundation in 2D graphics and helps more advanced programmers create and use high-quality images in their applications.Topics covered in the book include:

  • The rendering pipeline
  • Shapes and paths
  • Geometry
  • Painting with solid colors, gradients, and textures
  • Stroking paths, including dashed lines
  • Transformations: translation, rotation, shearing, and scaling
  • Alpha compositing
  • Clipping
  • Rasterizing and antialiasing
  • Fonts and text
  • Font metrics
  • Glyphs
  • Colors and color spaces
  • sRGB and CIEXYZ
  • ICC color profiles
  • Images, image color models, and image data
  • Image processing
  • Image data storage
  • Graphics devices
  • Printing

spacer
spacer
  • back to top
Follow us on...




Powell's City of Books is an independent bookstore in Portland, Oregon, that fills a whole city block with more than a million new, used, and out of print books. Shop those shelves — plus literally millions more books, DVDs, and gifts — here at Powells.com.