【正文】
ialog 和 Frame)。 從簡(jiǎn)單到先進(jìn): Java 2D 在 Java2 平臺(tái)之前,語(yǔ)言中的圖形功能相當(dāng)簡(jiǎn)單,僅限于單像素厚度的實(shí)線;少數(shù)幾個(gè)幾何圖形(如橢圓、弧和多邊形);和基本的畫(huà)圖功能。這種類型的轉(zhuǎn)換示例包括如下的操作:平移、旋轉(zhuǎn)、縮放、剪切或者這些操作的組合。這種新的 API 正在由 Java Community Process 設(shè)計(jì)。 Advanced Imaging 這個(gè)規(guī)范所涵蓋的操作將提高用戶處理圖像的能力。 這些類允許各種幾何圖形建立在雙精度或浮點(diǎn)精度的坐標(biāo)系上。此包建立在數(shù)據(jù)傳輸?shù)臋C(jī)制上,提供了拖放功能,這些功能可以在一個(gè)單獨(dú)的 Java 應(yīng)用程序內(nèi)或兩個(gè) Java 應(yīng)用程序之間以一種平臺(tái)無(wú)關(guān)的方式執(zhí)行。 語(yǔ)言自身已經(jīng)變得不只是一種平臺(tái)了, GUI 也正在朝著在所有平臺(tái)上都有相同的外觀和行為這種方向轉(zhuǎn)變。例如 Swing 等各種技術(shù)都是作為可選的擴(kuò)展被引入的。ll explore this progression, examine the capabilities of the current version in detail, and finish by looking to the future to see what release will offer. Prior to the release of the Java 2 platform, the Abstract Window Toolkit (AWT) was the extent of the Java platform39。在本文中,我們將探究這個(gè)進(jìn)步,詳細(xì)審視當(dāng)前 版本的功能,最后展望一下未來(lái),看看發(fā)行版 會(huì)提供些什么。 AWT 只提供了有限的一套組件,是因?yàn)樽钚」帜阜椒ㄖ挥挟?dāng)一個(gè)特殊的組件或功能在每個(gè)平臺(tái)上都可用的時(shí)候才能夠被提供。 另外,您可以制作自己的 lookandfeel。如果使用第二種選擇,就可以使用 2D API 的所有附加功能。這個(gè)領(lǐng)域的其它 API 還有 Java 3D、 Advanced Imaging(高級(jí)圖像處理)、 Image I/O(圖像 I/O)、 Java Media Framework( JMF,Java 媒體框架)和 Speech(語(yǔ)音)。 Speech Java Speech API 允許開(kāi)發(fā)人員將語(yǔ)音技術(shù)整合到 Java applet 和應(yīng)用程序的用戶界面中。多數(shù)情況下是使用雙精度值,并且角度是用弧度來(lái)度量的(而不是 Arc2D 類中使用的度)。 API 的其它部分由 層次結(jié)構(gòu)中的其它包提供,包括、 和 。 建立這個(gè)橋梁的機(jī)制被稱為 可插式 LookandFeel(它很接近主題的概念,在 linux 社區(qū)中非常流行)。例如,在 UNIX 平臺(tái)上, 類是用窗口小部件 Motif PushButton 實(shí)現(xiàn)的。 a few geometric shapes such as ovals, arcs, and polygons。s take a look at an example. Enabling the disabled: Accessibility The JFC Accessibility API equips Java applications so they can be accessed by users of all abilities, including people with sight, hearing, or dexterityrelated difficulties. These might include the inability to discern visible or auditory cues or to operate a pointing device. Two of the most important features of accessibility support are screen readers and magnifiers. Screen readers allow users to interact with a GUI by creating an offscreen representation of the interface and passing this to a speech synthesizer or a Braille terminal. Screen magnifiers provide an enlarged window of the screen, typically from 2 to 16 times the normal size. They generally keep track of pointer movements and changes in input focus and adjust the enlarged view accordingly. In addition, techniques such as font smoothing may be used to create a clearer picture. The Java Accessibility Bridge Some host systems, such as Microsoft Windows, provide their own accessibility features. By default, Java applications do not fully support them. For example, with native applications the screen magnifier detects when the input focus is switched to a different user interface ponent, such as by using the Tab key, and it adjusts the portion of the screen that is being magnified to show the ponent that now has the input focus. However, Swing applications use lightweight ponents, which are treated as images by the operating system, instead of discrete ponents. This means the screen magnifier cannot track changes in input focus in the same way as with native applications. This is exactly the problem the Java Accessibility Bridge for Windows solves. It creates a map between events relating to lightweight ponents and native system events. By using the Bridge, Java applications that support the Accessibility API are then fully integrated with the Windows accessibility support. From primitive to advanced: Java 2D Before the Java 2 platform, graphical capabilities in the language were rather primitive, limited to solid lines of singlepixel thickness。 當(dāng)集成有優(yōu)先權(quán)時(shí) 在 JDK 首次發(fā)行時(shí),與本機(jī)平臺(tái)的集成被認(rèn)為具有優(yōu)先權(quán),于是 AWT 提供了一些組件,這些組件使用各平臺(tái)的本機(jī)組件(在 Java 編程術(shù)語(yǔ)中,這些被稱為重量級(jí)組件)來(lái)實(shí)現(xiàn)。相反,它通過(guò)提供一個(gè)可以返回本機(jī)平臺(tái)的橋梁,把兩種方法的精華部分結(jié)合起來(lái)了。 這個(gè) API的核心是由 類提供的,該類是 的一個(gè)子類。 AffineTransform 類的實(shí)例可以直接從一個(gè)