Documentation

The Java™ Tutorials

Trail: 2D Graphics二维图形

This trail introduces you to the Java 2D™ API and shows you how to display and print 2D graphics in your Java programs.本教程向您介绍Java 2D™API,并向您展示如何在Java程序中显示和打印2D图形。The trail is intended for developers who want to enrich their knowledge of the Java 2D API, as well as for beginners in computer graphics.本教程面向希望丰富Java2D API知识的开发人员以及计算机图形学初学者。Almost every section contains relevant examples to illustrate specific capabilities.几乎每一节都包含相关示例来说明特定功能。The Java 2D API enables you to easily perform the following tasks:Java 2D API使您能够轻松执行以下任务:

This chapter also explains less familiar concepts such as compositing.本章还解释了不太熟悉的概念,如合成。

This figure represents different graphics capabilities
Using 2D Graphics API to display complex charts使用2D图形API显示复杂图表
This figure represents the using of filtering operation
Using image-filtering operations使用图像滤镜操作

This chapter describes the concept of drawing on-screen and off-screen images, as well as surfaces and printer devices.本章介绍绘制屏幕和屏幕外图像的概念,以及曲面和打印机设备。This trail covers the most common uses of the Java 2D APIs and briefly describes some of the more advanced features.本教程介绍了Java2D API最常见的用法,并简要介绍了一些更高级的特性。

Overview of the Java 2D Graphics APIJava2D图形API概述 introduces the key Java 2D concepts and describes the Java 2D rendering model.介绍关键的Java 2D概念,并描述Java 2D渲染模型。This lesson is more conceptual than other lessons of this trail, it enables you to get deep into basic notions and classes descriptions.本课程比本课程的其他课程更具概念性,它使您能够深入了解基本概念和类描述。

Getting started with Graphics图形入门 uses a developed example to show you how to obtain a Graphics object and use it for common graphics rendering tasks.使用开发的示例演示如何获取图形对象并将其用于常见的图形渲染任务。

Working with Geometry使用几何图形 teaches you how to use APIs to draw graphic primitives and arbitrary shapes, and how to apply fancy strokes and fill styles.教您如何使用API绘制图形基本体和任意形状,以及如何应用奇特的笔划和填充样式。

Working with Text APIs使用文本API shows you how to effectively use text APIs, including how to create a Font object with desired attributes, measure text, and determine the names of the fonts available on your system.演示如何有效使用文本API,包括如何创建具有所需属性的字体对象、测量文本以及确定系统上可用字体的名称。

Working with Images处理图像 explains how to create a BufferedImage object, perform image-filtering operations, and draw on an image.说明如何创建BuffereImage对象、执行图像过滤操作以及绘制图像。

Printing打印 teaches you how to render 2D graphics to a printer, print complex documents, and use Print Services.教您如何向打印机渲染二维图形、打印复杂文档和使用打印服务。

Advanced topics in Java 2DJava 2D中的高级主题 explains how to perform transformations, clip the drawing region, composite overlapping graphics, specify rendering preferences, and control rendering quality.说明如何执行变换、剪裁绘图区域、合成重叠图形、指定渲染首选项以及控制渲染质量。


Previous page: Beginning of Tutorial
Next page: Overview of the Java 2D API Concepts