资料下载网
首页 计算机 考试教辅
Programmer’s Guide to the Java 2D API pdf电子书免费下载,百度云
首页 > 计算机 > 计算机F > Programmer’s Guide to the Java 2D API pdf电子书免费下载,百度云

《Programmer’s Guide to the Java 2D API》pdf电子书免费下载


下载方式一:

百度网盘下载地址:https://pan.baidu.com/s/1pgjbPWRdHthEJiM8EGnknw
百度网盘密码:1111

下载方式二:

http://ziliaoshare.cn/Download/af_124138_pd_Programmer’sGuidetotheJava2DAPI.zip

 


Programmer’s Guide to the Java 2D API

作者:empty

页数:122

出版社:empty

《Programmer’s Guide to the Java 2D API》介绍

PrefaceThis guide describes the features provided by the Java2DAPI and illustrates howyou can use the Java2DAPI classes to enhance your applications.For additionalinformation about the Java2DAPIs, see:·The Java Tutorial, 2nd Volume.Available online at:The Java2D Sample Programs.Available online athttp://java.sun.com/products/java-media/2D/samp1es/index, htm 1·The Java2DDemo.Available from the Java2D websitehttp://java.sun.com/products/java-media/2D/index.htmlThis information in this guide is organized into seven chapters:Overview—introduces the packages and key classes in the Java2DAPlRendering with Graphics 2D—describes the Java2DAPI classes in thejava, awt package and howto setup the Graphics 2D rendering context.Geometries—describes the Java2DAPI classes in the java.awt.geompackage and howto define and manipulate 2D shapes and areasFonts and Text Layout—describes the Java2DAPI classes in thejava.awt.font package, howto specify and retrieve font information, andhowto display and manipulate inte mational text using the Java2Dtextlay-out APIs directly.

Imaging—describes the Java2DAPI classes in the java.awt, image,java.awt.image.codec, and java.awt.image, renderable packages andhowto display and manipulate images and offscreen buffersColor-describes the Java2DAPI classes in the java.awt.color packageand color management,Printing—deseribestheJava2DAPI classes in the java.awt.print pack-age and the Java2DAPI printing modelPref rce.Java2SDKSranif and Edit in 1.2Werriow

JavaTM2DAPI Overviewuse this coordinate system exclusively, all g come tries passed into Java2Drendering routines are specified in userspace.The JavaTM2DAPI enhances the graphics, text, and imaging capabilities of theAbstract Windowing Toolkit(AWT) , enabling the development of richer userinterfaces and new types of Java applicationsAlong with these richer graphics, font, and image APls.the Java2DAPI supportsenhanced color definition and composition, hit detection on arbitrary geometricshapes and text, and a uniform rendering model for printers and display devicesThe Java2DAPI also enables the creation of advanced graphics libraries, such asCAD-CAM libraries and graphics or imaging special effects libraries, as well asthe creation of image and graphic file read/write filters-When used in conjunction with the Java Media Framework and other Java MediaAPIs, the Java2DAPIscanbe used to create and display animations and othermultimedia presentations.The Java Animation and Java Media Framework APlsrelyon the Java2DAPI for rendering support.1.1Enh a need Graph ies, Text, and ImagingEarly versions of the AWT provided a simple rendering package suitable for ren-dering common HTML pages, but not full-featured enough for complex graphics,text, or imaging.As a simplified rendering package, the early AWT embodied spe-cific cases of more general rendering concepts.The Java2DAPI provides a moreflexible, full-featured rendering package by expanding the AWT to support moregeneral graphics and rendering operations.For example, through the Graphics class you can draw rectangles, ovals, andpolygons.Graphics 2D enhances the concept of geometric rendering by providinga mechanism for rendering virtually any gco metric shape.Similarly, with the Java2DAPIyoucandraw styled lines of any width and fill geometric shapes with vir-tually any texture.JavaIM2DAPIOverwiew.Jawa2SDKSr and and Edition 1.2WerriowGeometric shapes are provided through i plementation s of the Shape interface,for example Rectang1e2DandE11ipse2D.Curves and arcs are also specifcimplementations of Shape.Fil and pen styles are provided through implementations of the Paint andStroke interfaces, for example Basic Stroke, Gradient Paint, Texture Paintand Color.AffineTransform def nes linear transformations of 2D coordinates, in eludingscale, translate, rotate.and shear.Clip regions are defined by the same implementations of the Shape interface thatare used to deine general clipping regions, for example Rectang1e2DandGener-a1Path.Color composition is provided by implementations of the Composite interface,for example Alpha CompositeA Font is de in ed by collections of Glyphs, which are in tum defined by individ-ual Shapes.1.2Rendering ModelThe basic graphics rendering model has not changed with the addition of the Java2DAPIs.To render a graphic, you setup the graphics context and invoke a render-ing method on the Graphics object.The Java2DAPIclassGraphics2D extends Graphics to support more graphicsattributes and provide new rendering methods.Setting up a Graphics 2D context isdescribed in“Rendering with Graphics 2D on page 15.The Java2DAPI automatically compensates for differences in rendering devicesand provides a uniform rendering model across different types of devices.At thcapplication level, the rendering process is the same whether the target renderingdevice is a display or a printer.1.2.1Coordinate SystemsThe Java2DAPI maintains two coord nate systems:·Userspace is a device-independent, logical coordinate system.Applications

Rendering Model·Device space is a device-dependent coordinate system that varies accordingto the target rendering device.The Java2D system automatically performs the necessary conversions betweenuserspace and the device space of the target rendering device.Although the co or-dinate system for a monitor is very different from the coordinate system for aprinter, these differences arc invisible to applications.

1.2.1.1 UserSpaceAs shown in Figure 1-1, the userspace origin is located in the upper-left comer ofthe space, with x values increasing to the right andy values increasing downward.(0.0)Figure 1-1UserSpace Coordinate SystemUserspace represents a uni fom abstraction of all possible device coordinate sys-tems.The device space for a particular device might have the same origin anddirection as userspace, or it might be different.Regardless, userspace coordi-nates are automatically transformed into the appropriate device space when agraphic object is rendered.Often, the underlying platform device drivers are usedto perform this conversion.1.2.1.2 Device SpaceThe Java2DAPI defines three levels of configuration information that are main-tained to support the conversion from userspace to device space.This informationis encapsulated by three classes:·Graphics Environment·Graphics Device·Graphics Configuration

JavaIM2DAPIOverwiew.Jawa2SDKSr and and Edition 1.2WerriowThe Graphics Environment describes the collee tion of rendering devices vii bleto a Java application on a particular platform.Rendering devices include screens,printers, and image buffers.The Graphics Environment also includes a list of allof the available fonts on the platform.A Graphics Device describes an application-visible rendering device, such as ascreen or printer.Each possible configuration of the device is represented by aGraphics Configuration.For example, an SVGA display device can operate inseveral modes :640x480x 16 colors, 640x480x 256 colors, and 800x600x256col-ors.The SVGA screen is represented by a Graphics Device object and each ofthe modes is represented by a Graphics Configuration object.A Graphics Environment can contain oncor more Graphics Devices; in turn,cach Graphics Device can have one or more Graphics Configurations.Between them, the Graphics Environment, Graphics Device, and Graphics Con-figuration represent all of the information necessary for locating a renderingdevice or font on the Java platform and for converting coordinates from userspaceto device space.An application can access this information, but does not need toperform any transformations between userspace and device space.

1.2.2TransformsThe Java2DAPIhasa unified coordinate transformation model.All coordinatetransformations, including transformations from user to device space, arerepresented by AffineTransform objects.AffineTransform defines the rules formanipulating coordinates using matrices.You can add an AffineTransform to the graphics context to rotate, scale, trans-late, or shear agco metric shape, text, or image when it is rendered The addedtransform is applied to any graphic object rendered in that context.The transformis performed when userspace coordinates arc converted to device space coordi-nates1.2.3FontsA string is commonly thought of in terms of the characters that comprise thestring.When a string is drawn, its appearance is determined by the font that isselected.However, the shapes that the font uses to display the string don't alwayscorrespond to indivdual characters.For c xample, in pro fcs sional publi hing,certain combinations of two or more characters arc often replaced by a singleshape called a ligature.

Rendering ModelThe shapes that a font use store present the characters in the strng are calledgl phs.A font might representa character such as a lowercase a acute using mul-tiple glyphs, or represent certain character combinations such as the fi in final witha single glyph.In the Java2DAPI, a glyph is simply a Shape that can be manipu-lated and rendered in the same way as any other ShapeA font can be thought of as a collection of glyphs.A single font might have manyversions, such as heavy, medium, obli q uc, gothic, and regular.These different ver-sions are called faces.All of the faces in a font have a similar typographic dc signand can bc recognized as members of the same family.In other words, a collectionof glyphs with a particular style forms a font face, a collection of font faces formsa fontfamily, and a collection of font families forms the set of fonts availablewithin a particular Graphics Environment.In the Java2DAPI, fonts are specified by a name that describes a particular fontface—for example, Helvetica Bold.This is different from the JDK 1.1 software,in which fonts are described by logical names that map on to different font facesdepending on which font faces are available on a particular platform.For back-ward compatibility, the Java2DAPI supports the specification of fonts by logicalname as well as by font face name.Using the Java2DAPI, you can compose and render strings that contain multiplefonts of different famili cs, faces, sizes, and even languages.The appearance of thetext is kept logically separate from the layout of the text.Font objects are used tode seri be the appearance, and the layout information is stored in Text Layout andText AttributeSet objects.Keeping the font and layout information separatemakes it easier to use the same fonts in different layout configurations


《Programmer’s Guide to the Java 2D API》目录

Composites.

Backward Compatibility and Platform Independence . 8

Backward Compatibility.8

Platform Independence.10

The Java2DAPI Packages.10

Interfaces and Classes.15

Rendering Concepts.16

Rendering Process.17

Contl ling Rendering Qual y.17

Stroke Attributes.19

Fill Attributes.21

Clipping Paths.22

Transformations.23

Composite Attributes.25

Setting Up the Graphics 2D Context.27

Setting Rendering Hints.27

Specifying Stroke Atti but es.27

Specifying Fill Attributes.29

Geometries.

Fonts and Text Layout.

Setting the Clipping Path.

Setting the Graphics 2D Transform.

Specifying a Composition Style.

Rendering Graphics Primitives.

Drawing a Shape

Filling a Shape.

Rendering Text.

Rendering Images.

Defining Custom Composition Rules

Interfaces and Classes.

Geometry Concepts.

Constructive Area Geometry.

Bounds and Hit Testing.

Combining Areas to Create New Shapes

Creating a Custom Shape.

Interfaces and Classes

Font Concepts.

Text Layout Concepts.

Shaping Text.

Ordering Text.

Measuring and Positioning Text.

Supporting Text Manipulation.

Perform ig Text Layout in a Java Application

Managing Text Layout.

Laying Out Text.

Displaying Dual Care ts

Moving the Caret.

Hit Testing.

High ligh ng Selections.

Querying Layout Metrics.

Draw ig Text Across Mul ple Lines.

Implementing a Custom Text Layout Mechanism.

Creating Font Derivations.

Interfaces and Classes

Imaging Interfaces.

ImageData Classes.

Image Operation Classes.

Sample Model Classes.

ColorModel Classes.

Exception Classes.

Immediate Mode Imaging Concepts.

Terminology.

Using Buffered Images

Creating a Buf tered Image.

Drawing in an Offscreen Buffer

Manipu ating Buff red mage Data Directly

Filtering a BufferedImage.

Rendering a Buttered Image.

Managing and Manipulating Rasters.

Creating a Raster.

Parent and Child Rasters.

Operations on a Raster.

The Writable Raster Subclass.

ImageData and Data Buffers.

Extracting Pixel Data from a Sample Model

Color Models and Color Data.

Lookup Table.

Image Processing a

计算机


python
AI人工智能
javascript
计算机网络/服务器
数据库技术
计算机F

考试教辅


考研考博
英语四六级

沪ICP备18046276号-5