borland.jbcl Packages  borland.jbcl Class Hierarchy  borland.jbcl.util 

KeyMulticaster class

java.lang.Object
   +----borland.jbcl.util.KeyMulticaster

About the KeyMulticaster class

Properties  Methods  

Implements KeyListener, EventListener

A class that dispatches focus events to multiple listeners. KeyMulticaster maintains an array of listeners. The add(), remove(), and find() methods maintain this list.

The hasListeners() method determines whether any objects are listening for key events. The dispatch() method sends a key event to all listeners.

See also: Standard Java events, Events in JBCL


KeyMulticaster properties

*Read-only properties **Write-only properties

Properties implemented in java.lang.Object

KeyMulticaster methods

Methods implemented in this class

Methods implemented in java.lang.Object


KeyMulticaster methods

add(java.awt.event.KeyListener)

  public final synchronized void add(java.awt.event.KeyListener listener)
Adds an object to the array of listeners.

Parameters:

listener
The object that is added to the list of listeners for key events.

dispatch(java.awt.event.KeyEvent)

  public final void dispatch(java.awt.event.KeyEvent e)
Sends a key event to all listeners. Which method is called in the listener depends on the type of key event. For example, a KeyEvent.KEY_PRESSED event results in a call to the keyPressed event in the listening object. This method is a high-speed dispatcher that does not need to be synchronized.

Parameters:

e
The key event sent to all listeners.

find(java.awt.event.KeyListener)

  public int find(java.awt.event.KeyListener listener)
Searches for the specified listener among the array of listening objects.

Parameters:

listener
The object you are searching for in the list of listeners.

hasListeners()

  public final boolean hasListeners()
Determines if there are any listeners for key events. If the method returns true, one or more listeners are present.

remove(java.awt.event.KeyListener)

  public final synchronized void remove(java.awt.event.KeyListener listener)
Removes the specified listening object from the array of listeners for key events.

Parameters:

listener
The listening object that is removed from the array of listeners.