Package ucar.unidata.util
Class ListenerManager
java.lang.Object
ucar.unidata.util.ListenerManager
Helper class for event listeners.
- Version:
- $Id: ListenerManager.java,v 1.16 2006/05/05 19:19:35 jeffmc Exp $
- Author:
- John Caron
-
Constructor Summary
ConstructorsConstructorDescriptionListenerManager
(String listener_class, String event_class, String method_name) Constructor. -
Method Summary
Modifier and TypeMethodDescriptionvoid
Add a listener.boolean
_more_void
Remove a listener.void
sendEvent
(EventObject event) Send an event to all registered listeners.void
Send an event to all registered listeners, except the named one.
-
Constructor Details
-
ListenerManager
Constructor.- Parameters:
listener_class
- the name of the EventListener class, eg "ucar.unidata.ui.UIChangeListener"event_class
- the name of the Event class, eg "ucar.unidata.ui.UIChangeEvent"method_name
- the name of the EventListener method, eg "processChange".This method must have the signature public void method_name( event_class e)
-
-
Method Details
-
addListener
Add a listener.- Parameters:
l
- listener: must be of type "listener_class"
-
removeListener
Remove a listener.- Parameters:
l
-
-
hasListeners
public boolean hasListeners()_more_- Returns:
- _more_
-
sendEvent
Send an event to all registered listeners. If an exception is thrown, remove the Listener from the list- Parameters:
event
- the event to be sent: public void method_name( event_class event)
-
sendEventExcludeSource
Send an event to all registered listeners, except the named one.- Parameters:
event
- the event to be sent: public void method_name( event_class event)
-