borland.jbcl Packages borland.jbcl Class Hierarchy borland.jbcl.util
java.lang.Object +----borland.jbcl.util.EventMulticaster
Properties Methods
EventMulticaster is a multicaster for all user-defined events. All JBCL events, such as model and selection events, use EventMulticaster, which sends an event to all listeners. EventMulticaster maintains an array of listeners. The add(), remove(), and find() methods maintain this list.
The hasListeners() method determines whether any objects are listening for events. EventMulticaster has a dispatch() method and two specialized dispatch methods: exceptionDispatch(), which is used for events that can throw exceptions, and vetoableDispatch(), which is used for events that can decline an event.
See also: Standard Java events, Events in JBCL
public static final EventMulticaster add(borland.jbcl.util.EventMulticaster caster, java.util.EventListener listener)Adds an object to the array of listeners. It is used for efficiency to avoid allocating an EventMulticaster until there are listeners. The allocated EventMulticaster can be tested for null to see if there are any listeners, thereby improving efficiency again.
Parameters:
public final synchronized void add(java.util.EventListener listener)Adds an object to the array of listeners.
Parameters:
public final void dispatch(borland.jbcl.util.DispatchableEvent e)Sends a DispatchableEvent to all listeners. This method is a high-speed dispatcher that does not need to be synchronized.
Parameters:
public final void exceptionDispatch(borland.jbcl.util.ExceptionDispatch e)Sends an ExceptionDispatch event to all listeners. It is used for all events that can throw exceptions. This method is a high-speed dispatcher that does not need to be synchronized.
Parameters:
public int find(java.util.EventListener listener)Searches for the specified listener among the array of listening objects.
Parameters:
public final boolean hasListeners()Determines if there are any listeners for events. If the method returns true, one or more event listeners are present.
public static final EventMulticaster remove(borland.jbcl.util.EventMulticaster caster, java.util.EventListener listener)Removes the specified listening object from the array of event listeners. This remove() method is the counterpart of the the add() method that allocates an event multicaster and improves efficiency.
Parameters:
public final synchronized void remove(java.util.EventListener listener)Removes the specified listening object from the array of event listeners.
Parameters:
public final boolean vetoableDispatch(borland.jbcl.util.VetoableDispatch e)Sends a VetoableDispatch event to all listeners. It is used for all events that can throw VetoException and therefore decline the event. This method is a high-speed dispatcher that does not need to be synchronized.
vetoableDispatch() returns false if an event listener throws a VetoException. A return value of true indicates the listener accepted the event.
Parameters: