Utilities

   

Sun provides several utilities that can help you discover just how accessible your JFC programs really are. These utilities are freely available and can be downloaded from the following address: http://java.sun.com/products/jfc/#download-access.

Follow the instructions for downloading and installation. Six utilities are included in the download: AccessibilityMonitor, AWTMonitor, Ferret, JavaMonitor, Linker, and Monkey.

The following sections provide a brief introduction to these utilities. For more information, consult the documentation that is included in the download.

AccessibilityMonitor

AccessibilityMonitor monitors all accessible property change events on all nontransient objects. This program automatically starts up when you run JFC programs.

Before AccessibilityMonitor can be used, you must do two things:

  1. Copy jaccess.jar and jaccess-examples.jar to your JRE's extensions directory. Under Windows 98, if you've installed SDK 1.3 to your c:\jdk1.3 directory, your extensions directory should be located at c:\Program Files\Javasoft\JRE\1.3\lib\ext.

  2. Create or modify the accessibility.properties file so that it includes the line assistive_technologies=AccessibilityMonitor. (The accessibility.properties file is located in the lib directory, one level above the JRE's ext directory.)

The next time you run a JFC program, AccessibilityMonitor 's main window will be displayed. For example, if you run AccessibilityDemo1 and click its button (after checking the Accessibility PropertyChange Events checkbox), AccessibilityMonitor displays information similar to that shown in Figure 17.2.

Figure 17.2. AccessibilityMonitor shows AccessibilityDemo1 's property change events.

graphics/17fig02.gif

AWTMonitor

AWTMonitor is an AWT program that extracts information common to AWT and Swing components . However, Swing is not required to use AWTMonitor. This program automati cally starts up when you run JFC programs.

Before AWTMonitor can be used, you must do two things:

  1. Copy jaccess.jar and jaccess-examples.jar to your JRE's extensions directory.

  2. Create or modify the accessibility.properties file so that it includes the line assistive_technologies=AWTMonitor.

The next time you run a JFC program, AWTMonitor 's main window will be displayed. For example, if you run AccessibilityDemo1 and move the mouse (after checking the Mouse checkbox), AWTMonitor displays information similar to that shown in Figure 17.3.

Figure 17.3. AWTMonitor shows Accessibility Demo1 's mouse events.

graphics/17fig03.gif

Ferret

Ferret tracks mouse movements, focus updates, and the movement of a caret in either a text field or a text area. This program automatically starts up when you run JFC programs.

Before Ferret can be used, you must do two things:

  1. Copy jaccess.jar and jaccess-examples.jar to your JRE's extensions directory.

  2. Create or modify the accessibility.properties file so that it includes the line assistive_technologies=Ferret.

The next time you run a JFC program, Ferret 's main window will be displayed. For example, if you run AccessibilityDemo8 (after choosing Track Caret from the Settings menu), Ferret displays caret information similar to that shown in Figure 17.4.

Figure 17.4. Ferret shows Accessibility Demo8 's caret information.

graphics/17fig04.gif

JavaMonitor

JavaMonitor is a Swing program that extracts all kinds of AWT and Swing information. This program automatically starts up when you run JFC programs.

Before JavaMonitor can be used, you must do two things:

  1. Copy jaccess.jar and jaccess-examples.jar to your JRE's extensions directory.

  2. Create or modify the accessibility.properties file so that it includes the line assistive_technologies=JavaMonitor.

The next time you run a JFC program, JavaMonitor 's main window will be displayed. For example, if you run AccessibilityDemo1 and click its button (after checking the Action checkbox in the AWT Events checkbox group from JavaMonitor 's main window), JavaMonitor displays information similar to that shown in Figure 17.5.

Figure 17.5. JavaMonitor shows Accessibility Demo1 's action events.

graphics/17fig05.gif

Linker

Linker captures accessible hypertext information. This program automatically starts up when you run JFC programs.

Before Linker can be used, you must do two things:

  1. Copy jaccess.jar and jaccess-examples.jar to your JRE's extensions directory.

  2. Create or modify the accessibility.properties file so that it includes the line assistive_technologies=Linker.

The next time you run a JFC program, Linker 's main window will be displayed. For example, if you run AccessibilityDemo4, load an HTML document, and press the F1 function key while the mouse is positioned over this document, Linker displays information similar to that shown in Figure 17.6.

Figure 17.6. Linker shows Accessibility Demo4 's hyperlink information.

graphics/17fig06.gif

Caution

Linker is a tricky program to use. For example, during the development of this chapter section, it took several attempts to obtain the hyperlink information. For each attempt, AccessibilityDemo4 was run and F1 was pressed, until the information (shown in Figure 17.6) was obtained. To achieve the desired results, you'll have to experiment with this program.


Monkey

Monkey "swings" through a JFC program's component hierarchy. The hierarchy is displayed as both a Component tree and as an Accessible tree in Monkey 's window. This program automatically starts up when you run JFC programs.

Before Monkey can be used, you must do two things:

  1. Copy jaccess.jar and jaccess-examples.jar to your JRE's extensions directory.

  2. Create or modify the accessibility.properties file so that it includes the line assistive_technologies=Monkey.

The next time you run a JFC program, Monkey 's main window will be displayed. For example, if you run AccessibilityDemo1, click the Refresh Trees menu item on Monkey 's File menu, expand the AccessibiltyDemo1 tree fully, and right-click the Press Me entry in the Accessible Tree hierarchy (selecting AccessibleAction Panel ), Monkey displays information similar to that shown in Figure 17.7.

Figure 17.7. Monkey 's main window shows Accessibility Demo1 's Component and Accessible trees.

graphics/17fig07.gif

Note

The small Action window appears because the AccessibleAction Panel menu item was selected from the pop-up menu that appeared when Press Me was right-clicked.


   


Special Edition Using Java 2 Standard Edition
Special Edition Using Java 2, Standard Edition (Special Edition Using...)
ISBN: 0789724685
EAN: 2147483647
Year: 1999
Pages: 353

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net