All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class tea.set.EventMgr

java.lang.Object
   |
   +----tea.set.EventMgr

public class EventMgr
extends Object
EventMgr is used internally to handle the event listeners and event broadcasting. It is also used to work around a Java design flaw which makes adding new event listener type to a component impossible.

See Also:
TextEdit

Constructor Index

 o EventMgr(Component)
Create an EventMgr for the specified component.

Method Index

 o addListener(EventListener)
Add an event listener to the event manager.
 o broadcastEvent(AWTEvent)
Invoke all event listeners for this event.
 o postEvent(AWTEvent)
Post an event to the event listeners registered with this event manager.
 o processEvent(AWTEvent)
Process an event.
 o removeListener(EventListener)
Remove an event listener from the manager.

Constructors

 o EventMgr
 public EventMgr(Component comp)
Create an EventMgr for the specified component.

Parameters:
comp - component the event mgr works for.

Methods

 o addListener
 public long addListener(EventListener l)
Add an event listener to the event manager. The return value of this method is an event mask that should be enabled by the caller.

Parameters:
l - event listener.
Returns:
event mask.
 o removeListener
 public void removeListener(EventListener l)
Remove an event listener from the manager.

Parameters:
l - event listener.
 o processEvent
 public boolean processEvent(AWTEvent e)
Process an event. This method should be called by the processEvent() method of the owner component. It returns true if the event has been successfully processed. If it returns false, the caller should call super.processEvent() to further process the event.

Parameters:
e - event object.
Returns:
true if event has been processed.
 o broadcastEvent
 public void broadcastEvent(AWTEvent e)
Invoke all event listeners for this event.

Parameters:
e - event object.
 o postEvent
 public static synchronized void postEvent(AWTEvent e)
Post an event to the event listeners registered with this event manager.

Parameters:
e - event object.

All Packages  Class Hierarchy  This Package  Previous  Next  Index