com.sun.java.accessibility.util
Class SwingEventMonitor

java.lang.Object
  |
  +--com.sun.java.accessibility.util.AWTEventMonitor
        |
        +--com.sun.java.accessibility.util.SwingEventMonitor

public class SwingEventMonitor
extends AWTEventMonitor

SwingEventMonitor extends AWTEventMonitor by adding a suite of listeners conditionally installed on every Swing component instance in the Java Virtual Machine. The events captured by these listeners are made available through a unified set of listeners supported by SwingEventMonitor. With this, all the individual events on each of the AWT and Swing component instances are funnelled into one set of listeners broken down by category (see EventID for the categories).

This class depends upon EventQueueMonitor, which provides the base level support for capturing the top-level containers as they are created.

For JDK1.1 only, the EventQueueMonitor class needs to be in the CLASSPATH environment variable and the following line needs to be in the awt.properties file:

 AWT.EventQueueClass=com.sun.java.accessibility.util.EventQueueMonitor
 

For JDK1.2, EventQueueMonitor merely needs to be in the CLASSPATH. The best way for this to happen is to place the jaccess.jar file in the standard extensions directory (e.g., $JDKHOME/jre/lib/ext).

NOTE: Because this class extends AWTEventMonitor, it is not necessary to use this class and AWTEventMonitor at the same time. If you want to monitor both AWT and Swing components, you should use just this class.

See Also:
AWTEventMonitor

Field Summary
protected static javax.swing.event.EventListenerList listenerList
          The master list of all listeners registered by other classes.
protected static com.sun.java.accessibility.util.SwingEventMonitor.SwingEventListener swingListener
          The actual listener that is installed on the component instances.
 
Fields inherited from class com.sun.java.accessibility.util.AWTEventMonitor
actionListener, adjustmentListener, awtListener, componentListener, componentWithFocus, containerListener, focusListener, itemListener, keyListener, mouseListener, mouseMotionListener, textListener, windowListener
 
Constructor Summary
SwingEventMonitor()
           
 
Method Summary
static void addAncestorListener(javax.swing.event.AncestorListener l)
          Adds the specified listener to receive all Ancestor events on each component instance in the Java Virtual Machine as they occur.
static void addCaretListener(javax.swing.event.CaretListener l)
          Adds the specified listener to receive all Caret events on each component instance in the Java Virtual Machine as they occur.
static void addCellEditorListener(javax.swing.event.CellEditorListener l)
          Adds the specified listener to receive all CellEditor events on each component instance in the Java Virtual Machine as they occur.
static void addChangeListener(javax.swing.event.ChangeListener l)
          Adds the specified listener to receive all Change events on each component instance in the Java Virtual Machine as they occur.
static void addColumnModelListener(javax.swing.event.TableColumnModelListener l)
          Adds the specified listener to receive all TableColumnModel events on each component instance in the Java Virtual Machine as they occur.
static void addDocumentListener(javax.swing.event.DocumentListener l)
          Adds the specified listener to receive all Document events on each component instance in the Java Virtual Machine as they occur.
static void addInternalFrameListener(javax.swing.event.InternalFrameListener l)
          Adds the specified listener to receive all InternalFrame events on each component instance in the Java Virtual Machine as they occur.
static void addListDataListener(javax.swing.event.ListDataListener l)
          Adds the specified listener to receive all ListData events on each component instance in the Java Virtual Machine as they occur.
static void addListSelectionListener(javax.swing.event.ListSelectionListener l)
          Adds the specified listener to receive all ListSelection events on each component instance in the Java Virtual Machine as they occur.
static void addMenuListener(javax.swing.event.MenuListener l)
          Adds the specified listener to receive all Menu events on each component instance in the Java Virtual Machine as they occur.
static void addPopupMenuListener(javax.swing.event.PopupMenuListener l)
          Adds the specified listener to receive all PopupMenu events on each component instance in the Java Virtual Machine as they occur.
static void addPropertyChangeListener(java.beans.PropertyChangeListener l)
          Adds the specified listener to receive all PropertyChange events on each component instance in the Java Virtual Machine as they occur.
static void addTableModelListener(javax.swing.event.TableModelListener l)
          Adds the specified listener to receive all TableModel events on each component instance in the Java Virtual Machine as they occur.
static void addTreeExpansionListener(javax.swing.event.TreeExpansionListener l)
          Adds the specified listener to receive all TreeExpansion events on each component instance in the Java Virtual Machine as they occur.
static void addTreeModelListener(javax.swing.event.TreeModelListener l)
          Adds the specified listener to receive all TreeModel events on each component instance in the Java Virtual Machine as they occur.
static void addTreeSelectionListener(javax.swing.event.TreeSelectionListener l)
          Adds the specified listener to receive all TreeSelection events on each component instance in the Java Virtual Machine as they occur.
static void addUndoableEditListener(javax.swing.event.UndoableEditListener l)
          Adds the specified listener to receive all UndoableEdit events on each component instance in the Java Virtual Machine as they occur.
static void addVetoableChangeListener(java.beans.VetoableChangeListener l)
          Adds the specified listener to receive all VetoableChange events on each component instance in the Java Virtual Machine as they occur.
static void removeAncestorListener(javax.swing.event.AncestorListener l)
          Removes the specified listener so it no longer receives Ancestor events when they occur.
static void removeCaretListener(javax.swing.event.CaretListener l)
          Removes the specified listener so it no longer receives Caret events when they occur.
static void removeCellEditorListener(javax.swing.event.CellEditorListener l)
          Removes the specified listener so it no longer receives CellEditor events when they occur.
static void removeChangeListener(javax.swing.event.ChangeListener l)
          Removes the specified listener so it no longer receives Change events when they occur.
static void removeColumnModelListener(javax.swing.event.TableColumnModelListener l)
          Removes the specified listener so it no longer receives TableColumnModel events when they occur.
static void removeDocumentListener(javax.swing.event.DocumentListener l)
          Removes the specified listener so it no longer receives Document events when they occur.
static void removeInternalFrameListener(javax.swing.event.InternalFrameListener l)
          Removes the specified listener so it no longer receives InternalFrame events when they occur.
static void removeListDataListener(javax.swing.event.ListDataListener l)
          Removes the specified listener so it no longer receives ListData events when they occur.
static void removeListSelectionListener(javax.swing.event.ListSelectionListener l)
          Removes the specified listener so it no longer receives ListSelection events when they occur.
static void removeMenuListener(javax.swing.event.MenuListener l)
          Removes the specified listener so it no longer receives Menu events when they occur.
static void removePopupMenuListener(javax.swing.event.PopupMenuListener l)
          Removes the specified listener so it no longer receives PopupMenu events when they occur.
static void removePropertyChangeListener(java.beans.PropertyChangeListener l)
          Removes the specified listener so it no longer receives PropertyChange events when they occur.
static void removeTableModelListener(javax.swing.event.TableModelListener l)
          Removes the specified listener so it no longer receives TableModel events when they occur.
static void removeTreeExpansionListener(javax.swing.event.TreeExpansionListener l)
          Removes the specified listener so it no longer receives TreeExpansion events when they occur.
static void removeTreeModelListener(javax.swing.event.TreeModelListener l)
          Removes the specified listener so it no longer receives TreeModel events when they occur.
static void removeTreeSelectionListener(javax.swing.event.TreeSelectionListener l)
          Removes the specified listener so it no longer receives TreeSelection events when they occur.
static void removeUndoableEditListener(javax.swing.event.UndoableEditListener l)
          Removes the specified listener so it no longer receives UndoableEdit events when they occur.
static void removeVetoableChangeListener(java.beans.VetoableChangeListener l)
          Removes the specified listener so it no longer receives VetoableChange events when they occur.
 
Methods inherited from class com.sun.java.accessibility.util.AWTEventMonitor
addActionListener, addAdjustmentListener, addComponentListener, addContainerListener, addFocusListener, addItemListener, addKeyListener, addMouseListener, addMouseMotionListener, addTextListener, addWindowListener, getComponentWithFocus, removeActionListener, removeAdjustmentListener, removeComponentListener, removeContainerListener, removeFocusListener, removeItemListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeTextListener, removeWindowListener
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

listenerList

protected static javax.swing.event.EventListenerList listenerList
The master list of all listeners registered by other classes. This can only be publicly modified by calling the add or remove listener methods in this class.

swingListener

protected static com.sun.java.accessibility.util.SwingEventMonitor.SwingEventListener swingListener
The actual listener that is installed on the component instances. This listener calls the other registered listeners when an event occurs. By doing things this way, the actual number of listeners installed on a component instance is drastically reduced.
Constructor Detail

SwingEventMonitor

public SwingEventMonitor()
Method Detail

addAncestorListener

public static void addAncestorListener(javax.swing.event.AncestorListener l)
Adds the specified listener to receive all Ancestor events on each component instance in the Java Virtual Machine as they occur.

Note: this listener is automatically added to all component instances created after this method is called. In addition, it is only added to component instances that support this listener type.

Parameters:
l - the listener to add
See Also:
removeAncestorListener(javax.swing.event.AncestorListener)

removeAncestorListener

public static void removeAncestorListener(javax.swing.event.AncestorListener l)
Removes the specified listener so it no longer receives Ancestor events when they occur.
Parameters:
l - the listener to remove
See Also:
addAncestorListener(javax.swing.event.AncestorListener)

addCaretListener

public static void addCaretListener(javax.swing.event.CaretListener l)
Adds the specified listener to receive all Caret events on each component instance in the Java Virtual Machine as they occur.

Note: this listener is automatically added to all component instances created after this method is called. In addition, it is only added to component instances that support this listener type.

Parameters:
l - the listener to add
See Also:
removeCaretListener(javax.swing.event.CaretListener)

removeCaretListener

public static void removeCaretListener(javax.swing.event.CaretListener l)
Removes the specified listener so it no longer receives Caret events when they occur.
Parameters:
l - the listener to remove
See Also:
addCaretListener(javax.swing.event.CaretListener)

addCellEditorListener

public static void addCellEditorListener(javax.swing.event.CellEditorListener l)
Adds the specified listener to receive all CellEditor events on each component instance in the Java Virtual Machine as they occur.

Note: this listener is automatically added to all component instances created after this method is called. In addition, it is only added to component instances that support this listener type.

Parameters:
l - the listener to add
See Also:
removeCellEditorListener(javax.swing.event.CellEditorListener)

removeCellEditorListener

public static void removeCellEditorListener(javax.swing.event.CellEditorListener l)
Removes the specified listener so it no longer receives CellEditor events when they occur.
Parameters:
l - the listener to remove
See Also:
addCellEditorListener(javax.swing.event.CellEditorListener)

addChangeListener

public static void addChangeListener(javax.swing.event.ChangeListener l)
Adds the specified listener to receive all Change events on each component instance in the Java Virtual Machine as they occur.

Note: this listener is automatically added to all component instances created after this method is called. In addition, it is only added to component instances that support this listener type.

Parameters:
l - the listener to add
See Also:
removeChangeListener(javax.swing.event.ChangeListener)

removeChangeListener

public static void removeChangeListener(javax.swing.event.ChangeListener l)
Removes the specified listener so it no longer receives Change events when they occur.
Parameters:
l - the listener to remove
See Also:
addChangeListener(javax.swing.event.ChangeListener)

addColumnModelListener

public static void addColumnModelListener(javax.swing.event.TableColumnModelListener l)
Adds the specified listener to receive all TableColumnModel events on each component instance in the Java Virtual Machine as they occur.

Note: this listener is automatically added to all component instances created after this method is called. In addition, it is only added to component instances that support this listener type.

Parameters:
l - the listener to add
See Also:
removeColumnModelListener(javax.swing.event.TableColumnModelListener)

removeColumnModelListener

public static void removeColumnModelListener(javax.swing.event.TableColumnModelListener l)
Removes the specified listener so it no longer receives TableColumnModel events when they occur.
Parameters:
l - the listener to remove
See Also:
addColumnModelListener(javax.swing.event.TableColumnModelListener)

addDocumentListener

public static void addDocumentListener(javax.swing.event.DocumentListener l)
Adds the specified listener to receive all Document events on each component instance in the Java Virtual Machine as they occur.

Note: this listener is automatically added to all component instances created after this method is called. In addition, it is only added to component instances that support this listener type.

Parameters:
l - the listener to add
See Also:
removeDocumentListener(javax.swing.event.DocumentListener)

removeDocumentListener

public static void removeDocumentListener(javax.swing.event.DocumentListener l)
Removes the specified listener so it no longer receives Document events when they occur.
Parameters:
l - the listener to remove
See Also:
addDocumentListener(javax.swing.event.DocumentListener)

addListDataListener

public static void addListDataListener(javax.swing.event.ListDataListener l)
Adds the specified listener to receive all ListData events on each component instance in the Java Virtual Machine as they occur.

Note: this listener is automatically added to all component instances created after this method is called. In addition, it is only added to component instances that support this listener type.

Parameters:
l - the listener to add
See Also:
removeListDataListener(javax.swing.event.ListDataListener)

removeListDataListener

public static void removeListDataListener(javax.swing.event.ListDataListener l)
Removes the specified listener so it no longer receives ListData events when they occur.
Parameters:
l - the listener to remove
See Also:
addListDataListener(javax.swing.event.ListDataListener)

addListSelectionListener

public static void addListSelectionListener(javax.swing.event.ListSelectionListener l)
Adds the specified listener to receive all ListSelection events on each component instance in the Java Virtual Machine as they occur.

Note: this listener is automatically added to all component instances created after this method is called. In addition, it is only added to component instances that support this listener type.

Parameters:
l - the listener to add
See Also:
removeListSelectionListener(javax.swing.event.ListSelectionListener)

removeListSelectionListener

public static void removeListSelectionListener(javax.swing.event.ListSelectionListener l)
Removes the specified listener so it no longer receives ListSelection events when they occur.
Parameters:
l - the listener to remove
See Also:
addListSelectionListener(javax.swing.event.ListSelectionListener)

addMenuListener

public static void addMenuListener(javax.swing.event.MenuListener l)
Adds the specified listener to receive all Menu events on each component instance in the Java Virtual Machine as they occur.

Note: this listener is automatically added to all component instances created after this method is called. In addition, it is only added to component instances that support this listener type.

Parameters:
l - the listener to add
See Also:
removeMenuListener(javax.swing.event.MenuListener)

removeMenuListener

public static void removeMenuListener(javax.swing.event.MenuListener l)
Removes the specified listener so it no longer receives Menu events when they occur.
Parameters:
l - the listener to remove
See Also:
addMenuListener(javax.swing.event.MenuListener)

addPopupMenuListener

public static void addPopupMenuListener(javax.swing.event.PopupMenuListener l)
Adds the specified listener to receive all PopupMenu events on each component instance in the Java Virtual Machine as they occur.

Note: this listener is automatically added to all component instances created after this method is called. In addition, it is only added to component instances that support this listener type.

Parameters:
l - the listener to add
See Also:
removePopupMenuListener(javax.swing.event.PopupMenuListener)

removePopupMenuListener

public static void removePopupMenuListener(javax.swing.event.PopupMenuListener l)
Removes the specified listener so it no longer receives PopupMenu events when they occur.
Parameters:
l - the listener to remove
See Also:
addPopupMenuListener(javax.swing.event.PopupMenuListener)

addTableModelListener

public static void addTableModelListener(javax.swing.event.TableModelListener l)
Adds the specified listener to receive all TableModel events on each component instance in the Java Virtual Machine as they occur.

Note: this listener is automatically added to all component instances created after this method is called. In addition, it is only added to component instances that support this listener type.

Parameters:
l - the listener to add
See Also:
removeTableModelListener(javax.swing.event.TableModelListener)

removeTableModelListener

public static void removeTableModelListener(javax.swing.event.TableModelListener l)
Removes the specified listener so it no longer receives TableModel events when they occur.
Parameters:
l - the listener to remove
See Also:
addTableModelListener(javax.swing.event.TableModelListener)

addTreeExpansionListener

public static void addTreeExpansionListener(javax.swing.event.TreeExpansionListener l)
Adds the specified listener to receive all TreeExpansion events on each component instance in the Java Virtual Machine as they occur.

Note: this listener is automatically added to all component instances created after this method is called. In addition, it is only added to component instances that support this listener type.

Parameters:
l - the listener to add
See Also:
removeTreeExpansionListener(javax.swing.event.TreeExpansionListener)

removeTreeExpansionListener

public static void removeTreeExpansionListener(javax.swing.event.TreeExpansionListener l)
Removes the specified listener so it no longer receives TreeExpansion events when they occur.
Parameters:
l - the listener to remove
See Also:
addTreeExpansionListener(javax.swing.event.TreeExpansionListener)

addTreeModelListener

public static void addTreeModelListener(javax.swing.event.TreeModelListener l)
Adds the specified listener to receive all TreeModel events on each component instance in the Java Virtual Machine as they occur.

Note: this listener is automatically added to all component instances created after this method is called. In addition, it is only added to component instances that support this listener type.

Parameters:
l - the listener to add
See Also:
removeTreeModelListener(javax.swing.event.TreeModelListener)

removeTreeModelListener

public static void removeTreeModelListener(javax.swing.event.TreeModelListener l)
Removes the specified listener so it no longer receives TreeModel events when they occur.
Parameters:
l - the listener to remove
See Also:
addTreeModelListener(javax.swing.event.TreeModelListener)

addTreeSelectionListener

public static void addTreeSelectionListener(javax.swing.event.TreeSelectionListener l)
Adds the specified listener to receive all TreeSelection events on each component instance in the Java Virtual Machine as they occur.

Note: this listener is automatically added to all component instances created after this method is called. In addition, it is only added to component instances that support this listener type.

Parameters:
l - the listener to add
See Also:
removeTreeSelectionListener(javax.swing.event.TreeSelectionListener)

removeTreeSelectionListener

public static void removeTreeSelectionListener(javax.swing.event.TreeSelectionListener l)
Removes the specified listener so it no longer receives TreeSelection events when they occur.
Parameters:
l - the listener to remove
See Also:
addTreeSelectionListener(javax.swing.event.TreeSelectionListener)

addUndoableEditListener

public static void addUndoableEditListener(javax.swing.event.UndoableEditListener l)
Adds the specified listener to receive all UndoableEdit events on each component instance in the Java Virtual Machine as they occur.

Note: this listener is automatically added to all component instances created after this method is called. In addition, it is only added to component instances that support this listener type.

Parameters:
l - the listener to add
See Also:
removeUndoableEditListener(javax.swing.event.UndoableEditListener)

removeUndoableEditListener

public static void removeUndoableEditListener(javax.swing.event.UndoableEditListener l)
Removes the specified listener so it no longer receives UndoableEdit events when they occur.
Parameters:
l - the listener to remove
See Also:
addUndoableEditListener(javax.swing.event.UndoableEditListener)

addInternalFrameListener

public static void addInternalFrameListener(javax.swing.event.InternalFrameListener l)
Adds the specified listener to receive all InternalFrame events on each component instance in the Java Virtual Machine as they occur.

Note: this listener is automatically added to all component instances created after this method is called. In addition, it is only added to component instances that support this listener type.

Parameters:
l - the listener to add
See Also:
removeInternalFrameListener(javax.swing.event.InternalFrameListener)

removeInternalFrameListener

public static void removeInternalFrameListener(javax.swing.event.InternalFrameListener l)
Removes the specified listener so it no longer receives InternalFrame events when they occur.
Parameters:
l - the listener to remove
See Also:
addInternalFrameListener(javax.swing.event.InternalFrameListener)

addPropertyChangeListener

public static void addPropertyChangeListener(java.beans.PropertyChangeListener l)
Adds the specified listener to receive all PropertyChange events on each component instance in the Java Virtual Machine as they occur.

Note: this listener is automatically added to all component instances created after this method is called. In addition, it is only added to component instances that support this listener type.

Parameters:
l - the listener to add
See Also:
removePropertyChangeListener(java.beans.PropertyChangeListener)

removePropertyChangeListener

public static void removePropertyChangeListener(java.beans.PropertyChangeListener l)
Removes the specified listener so it no longer receives PropertyChange events when they occur.
Parameters:
l - the listener to remove
See Also:
addPropertyChangeListener(java.beans.PropertyChangeListener)

addVetoableChangeListener

public static void addVetoableChangeListener(java.beans.VetoableChangeListener l)
Adds the specified listener to receive all VetoableChange events on each component instance in the Java Virtual Machine as they occur.

Note: this listener is automatically added to all component instances created after this method is called. In addition, it is only added to component instances that support this listener type.

Parameters:
l - the listener to add
See Also:
removeVetoableChangeListener(java.beans.VetoableChangeListener)

removeVetoableChangeListener

public static void removeVetoableChangeListener(java.beans.VetoableChangeListener l)
Removes the specified listener so it no longer receives VetoableChange events when they occur.
Parameters:
l - the listener to remove
See Also:
addVetoableChangeListener(java.beans.VetoableChangeListener)