Class AWTEventMonitor
- Direct Known Subclasses:
SwingEventMonitor
The AWTEventMonitor implements a suite of listeners that are
conditionally installed on every AWT component instance in the Java
Virtual Machine. The events captured by these listeners are made
available through a unified set of listeners supported by AWTEventMonitor.
With this, all the individual events on each of the AWT component
instances are funneled 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.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic voidAdds the specified listener to receive allACTIONevents on each component instance in the Java Virtual Machine when they occur.static voidAdds the specified listener to receive allADJUSTMENTevents on each component instance in the Java Virtual Machine when they occur.static voidAdds the specified listener to receive allCOMPONENTevents on each component instance in the Java Virtual Machine as they occur.static voidAdds the specified listener to receive allCONTAINERevents on each component instance in the Java Virtual Machine as they occur.static voidAdds the specified listener to receive allFOCUSevents on each component instance in the Java Virtual Machine when they occur.static voidAdds the specified listener to receive allITEMevents on each component instance in the Java Virtual Machine when they occur.static voidAdds the specified listener to receive allKEYevents on each component instance in the Java Virtual Machine when they occur.static voidAdds the specified listener to receive allMOUSEevents on each component instance in the Java Virtual Machine when they occur.static voidAdds the specified listener to receive all mouseMOTIONevents on each component instance in the Java Virtual Machine when they occur.static voidAdds the specified listener to receive allTEXTevents on each component instance in the Java Virtual Machine when they occur.static voidAdds the specified listener to receive allWINDOWevents on each component instance in the Java Virtual Machine when they occur.static ComponentReturns the component that currently has keyboard focus.static voidRemoves the specified listener so it no longer receivesACTIONevents when they occur.static voidRemoves the specified listener so it no longer receivesADJUSTMENTevents when they occur.static voidRemoves the specified listener so it no longer receivesCOMPONENTevents when they occur.static voidRemoves the specified listener so it no longer receivesCONTAINERevents when they occur.static voidRemoves the specified listener so it no longer receivesFOCUSevents when they occur.static voidRemoves the specified listener so it no longer receivesITEMevents when they occur.static voidRemoves the specified listener so it no longer receivesKEYevents when they occur.static voidRemoves the specified listener so it no longer receivesMOUSEevents when they occur.static voidRemoves the specified listener so it no longer receivesMOTIONevents when they occur.static voidRemoves the specified listener so it no longer receivesTEXTevents when they occur.static voidRemoves the specified listener so it no longer receivesWINDOWevents when they occur.Methods declared in class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitModifier and TypeMethodDescriptionprotected Objectclone()Answers a new instance of the same class as the receiver, whose slots have been filled in with the values in the slots of the receiver.booleanCompares the argument to the receiver, and answers true if they represent the same object using a class specific comparison.protected voidfinalize()Deprecated, for removal: This API element is subject to removal in a future version.May cause performance issues, deadlocks and hangs.getClass()Answers the unique instance of java.lang.Class which represents the class of the receiver.inthashCode()Answers an integer hash code for the receiver.final voidnotify()Causes one thread which iswaiting on the receiver to be made ready to run.final voidCauses all threads which arewaiting on the receiver to be made ready to run.toString()Answers a string containing a concise, human-readable description of the receiver.final voidwait()Causes the thread which sent this message to be made not ready to run pending some change in the receiver (as indicated bynotifyornotifyAll).final voidwait(long time) Causes the thread which sent this message to be made not ready to run either pending some change in the receiver (as indicated bynotifyornotifyAll) or the expiration of the timeout.final voidwait(long time, int frac) Causes the thread which sent this message to be made not ready to run either pending some change in the receiver (as indicated bynotifyornotifyAll) or the expiration of the timeout.
-
Constructor Details
-
AWTEventMonitor
public AWTEventMonitor()Constructs anAWTEventMonitor.
-
-
Method Details
-
getComponentWithFocus
Returns the component that currently has keyboard focus. The return value can be null.- Returns:
- the component that has keyboard focus
-
addComponentListener
Adds the specified listener to receive allCOMPONENTevents 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:
-
removeComponentListener
Removes the specified listener so it no longer receivesCOMPONENTevents when they occur.- Parameters:
l- the listener to remove- See Also:
-
addContainerListener
Adds the specified listener to receive allCONTAINERevents 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:
-
removeContainerListener
Removes the specified listener so it no longer receivesCONTAINERevents when they occur.- Parameters:
l- the listener to remove- See Also:
-
addFocusListener
Adds the specified listener to receive allFOCUSevents on each component instance in the Java Virtual Machine when 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:
-
removeFocusListener
Removes the specified listener so it no longer receivesFOCUSevents when they occur.- Parameters:
l- the listener to remove- See Also:
-
addKeyListener
Adds the specified listener to receive allKEYevents on each component instance in the Java Virtual Machine when 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:
-
removeKeyListener
Removes the specified listener so it no longer receivesKEYevents when they occur.- Parameters:
l- the listener to remove- See Also:
-
addMouseListener
Adds the specified listener to receive allMOUSEevents on each component instance in the Java Virtual Machine when 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:
-
removeMouseListener
Removes the specified listener so it no longer receivesMOUSEevents when they occur.- Parameters:
l- the listener to remove- See Also:
-
addMouseMotionListener
Adds the specified listener to receive all mouseMOTIONevents on each component instance in the Java Virtual Machine when 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:
-
removeMouseMotionListener
Removes the specified listener so it no longer receivesMOTIONevents when they occur.- Parameters:
l- the listener to remove- See Also:
-
addWindowListener
Adds the specified listener to receive allWINDOWevents on each component instance in the Java Virtual Machine when 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:
-
removeWindowListener
Removes the specified listener so it no longer receivesWINDOWevents when they occur.- Parameters:
l- the listener to remove- See Also:
-
addActionListener
Adds the specified listener to receive allACTIONevents on each component instance in the Java Virtual Machine when 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:
-
removeActionListener
Removes the specified listener so it no longer receivesACTIONevents when they occur.- Parameters:
l- the listener to remove- See Also:
-
addAdjustmentListener
Adds the specified listener to receive allADJUSTMENTevents on each component instance in the Java Virtual Machine when 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:
-
removeAdjustmentListener
Removes the specified listener so it no longer receivesADJUSTMENTevents when they occur.- Parameters:
l- the listener to remove- See Also:
-
addItemListener
Adds the specified listener to receive allITEMevents on each component instance in the Java Virtual Machine when 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:
-
removeItemListener
Removes the specified listener so it no longer receivesITEMevents when they occur.- Parameters:
l- the listener to remove- See Also:
-
addTextListener
Adds the specified listener to receive allTEXTevents on each component instance in the Java Virtual Machine when 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:
-
removeTextListener
Removes the specified listener so it no longer receivesTEXTevents when they occur.- Parameters:
l- the listener to remove- See Also:
-