Skip Headers
Oracle® Java Access Bridge Installation and Application Developer's Guide
Release 2.0.2 for Microsoft Windows (32-Bit and 64-Bit)
  Go To Table Of Contents
Contents

Previous
Previous
 
Next
Next
 

3 Java Ferret Example

The Java Ferret example uses the Java Accessibility Utilities API to examine accessible information about the objects in the Java Virtual Machine. It enables you to select different methods for selecting the object to be examined:

Once an object has been selected for examination, Java Ferret displays the results of calling Java Accessibility API methods on that object.

The following topics are covered:

Setup

Install and configure Java Access Bridge as described in "Installing Java Access Bridge".

Trying It Out

After installing and configuring Java Access Bridge, any time you launch a Java application or applet, Java Access Bridge is automatically launched as well.

To use Java Ferret, launch the Java Ferret Windows application after launching a Java application. For example, to launch Java Ferret with the SwingSet2 demo Swing program, follow these steps:

  1. Run the Java application %JAVAHOME%\demo\jfc\SwingSet2\SwingSet2.jar, where %JAVAHOME% is where you installed the JDK or JRE.

  2. Run one of the following Windows applications, depending on how you installed and configured Java Access Bridge, where %JABHOME% is the directory in which you extracted the files for Java Access Bridge:

    • 64-bit Windows:

      • %JABHOME%\JavaFerret-64.exe: Tests Java Access Bridge as if it were a 64-bit Assistive Technology application

      • %JABHOME%\JavaFerret-32.exe: Tests Java Access Bridge as if it were a 32-bit Assistive Technology application

    • 32-bit Windows (legacy):

      • %JABHOME%\JavaFerret.exe

You now have two windows open: The SwingSet2 demo Java application window, and the Java Ferret window. Java Ferret has three menus: UpdateSettings, JavaEvents, and AccessibilityEvents. The items in these menus allow you to query Java applications in a variety of ways.

UpdateSettings Menu

This section covers the available options in the UpdateSettings menu.

Update from Mouse

Determines the x- and y-coordinates of the mouse (assuming the Java Ferret window is topmost) when the mouse has stopped moving, and then queries the Java Access Bridge for the accessible object underneath the mouse, dumping the output into the scrolling window.

Update with F2 (Mouse HWND)

Determines the x- and y-coordinates of the mouse (assuming the Java Ferret window is topmost), and then queries the Java Access Bridge for the accessible object of the HWND underneath the mouse, dumping the output into the scrolling window.

Update with F1 (Mouse Point)

Determines the x- and y-coordinates of the mouse (assuming the Java Ferret window is topmost), and then queries the Java Access Bridge for the accessible object underneath the mouse, dumping the output into the scrolling window.

JavaEvents Menu

This section covers the available options in the JavaEvents menu.

Track Mouse Events

Register with the Java Access Bridge all Java Mouse Entered events, and upon receiving one, query the object which was entered by the mouse and dump the output into the scrolling window.


Note:

If the mouse is moved quickly, there may be some delay before the displayed information is updated.

Track Focus Events

Register with Java Access Bridge all Java Focus Gained events, and upon receiving one, query the object which received the focus and dump the output into the scrolling window.

Track Caret Events

Register with Java Access Bridge all Java Caret Update events, and upon receiving one, query the object in which the caret was updated, and dump the output into the scrolling window.


Note:

Since objects that contain carets are virtually by definition objects which are rich text objects, this won't seem as responsive as the other event tracking options. In real use, one would make fewer calls of Java Access Bridge in Caret Update situations (for example, just get the new letter, word, sentence at the caret location), which would be significantly faster.

Track Menu Selected | Deselected | Canceled Events

Register with Java Access Bridge all Menu events, and upon receiving one, query the object in which the caret was updated, and dump the output into the scrolling window.

Track Popup Visible | Invisible | Cancelled Events

Register with Java Access Bridge all Popup Menu events, and upon receiving one, query the object in which the caret was updated, and dump the output into the scrolling window.

Track Shutdown Events

Register with Java Access Bridge to receive a Property Changed event when a Java application terminates.

AccessibilityEvents Menu

This section covers the available options in the AccessibilityEvents menu.


Note:

The options listed in the AccessibilityEvents menu are the most important for testing applications, especially for Assistive Technology applications.

Track Name Property Events

Register with Java Access Bridge all Java Property Changed events specifically on accessible objects in which the Name property has changed, and upon receiving one, dump the output into the scrolling window, along with information about the property that changed.

Track Description Property Events

Register with Java Access Bridge for all Java Property Changed events specifically on Accessible objects in which the Description property has changed, and upon receiving one, dump the output into the scrolling window, along with information about the property that changed.

Track State Property Events

Register with Java Access Bridge all Java Property Changed events specifically on accessible objects in which the State property has changed, and upon receiving one, dump the output into the scrolling window, along with information about the property that changed.

Track Value Property Events

Register with Java Access Bridge all Java Property Changed events specifically on accessible objects in which the Value property has changed, and upon receiving one, dump the output into the scrolling window, along with information about the property that changed.

Track Selection Property Events

Register with Java Access Bridge all Java Property Changed events specifically on accessible objects in which the Selection property has changed, and upon receiving one, dump the output into the scrolling window, along with information about the property that changed.

Track Text Property Events

Register with Java Access Bridge all Java Property Changed events specifically on Accessible objects in which the Text property has changed, and upon receiving one, dump the output into the scrolling window, along with information about the property that changed.

Track Caret Property Events

Register with Java Access Bridge all Java Property Changed events specifically on accessible objects in which the Caret property has changed, and upon receiving one, dump the output into the scrolling window, along with information about the property that changed.

Track Visible Data Property Events

Register with Java Access Bridge all Java Property Changed events specifically on accessible objects in which the VisibleData property has changed, and upon receiving one, dump the output into the scrolling window, along with information about the property that changed.

Track Child Property Events

Register with Java Access Bridge all Java Property Changed events specifically on accessible objects in which the Child property has changed, and upon receiving one, dump the output into the scrolling window, along with information about the property that changed.

Track ActiveDescendent Property Events

Register with Java Access Bridge all Java Property Changed events specifically on accessible objects in which the ActiveDescendent property has changed, and upon receiving one, dump the output into the scrolling window, along with information about the property that changed.

Track Table Model Change Property Events

Register with Java Access Bridge all Property Changed events specifically on accessible objects in which the TableModelChange property has changed, and upon receiving one, dump the output into the scrolling window, along with information about the property that changed.