【文章內(nèi)容簡介】
rating 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。 a few geometric shapes such as ovals, arcs, and polygons。 and basic imagedrawing functionality. All that changed with the introduction of the Java 2D API, which contains a substantial feature set. The core of this API is provided by the class, which is a subclass of . The remainder of the API is provided by other packages within the hierarchy, including , , and . The class This class is a subclass of , the class that provided graphical capabilities prior to the Java 2 release. The reason for this arrangement: backwards patibility. Components are still rendered by calling their paint() method, which takes a Graphics object. In the current version of the language, though, the object is really a Graphics2D object. This means that a paint() method can either use the Graphics object as a Graphics object (using the old drawing methods) or cast it to a Graphics2D object. If it uses the second option, then any of the additional capabilities of the 2D API can be used. The package The package provides a number of classes relating to twodimensional geometry, such as Arc2D, Line2D, Rectangle2D, Ellipse2D, and CubicCurve2D. Each of these is an abstract class, plete with two nonabstract inner classes called Double and Float (which are subclasses of the abstract outer class). These classes allow the various geometric shapes to be constructed with coordinates of either double or float precision. For example, (x,y,w,h) will construct an ellipse bounded by a rectangle of width w and height h, at position (x,y), in which x, y, w, and h are all floatingpoint values. Also in this package is the AffineTransform class, which forms a core element of the 2D API. An affine transformation is one in which parallel lines remain parallel after the transformation. Examples of this type of transformation include such actions as translation, rotation, scaling, shearing, or any bination of these. Each transformation can be represented by a 3x3 matrix that specifies the mapping between source and destination points for the transformation. Instances of the AffineTransform class can be created directly from a matrix of floatingpoint values, although they are more usually created by specifying one or more translation, rotation, scaling, or shearing operations. Mostly doubleprecision values are used, and angles are measured in radians (not degrees as used by the Arc2D class). Text rendering The text capabilities of the Java 2D API are impressive. They include: Antialiasing and hinting for improved output quality The ability to use all the systeminstalled fonts The ability to apply the same operations (rotation, scaling, painting, clipping, and so on) to text as to graphic objects Support for adding embedded attributes to strings (such as font, size, weight, and even images) Support for bidirectional text (to enable righttoleft character runs like you would encounter in Arabic and Hebrew) Primary and secondary cursors that can navigate thr