zinger.util
Class EventPropagator

java.lang.Object
  |
  +--zinger.util.EventPropagator
All Implemented Interfaces:
EventHandler, java.util.EventListener

public class EventPropagator
extends java.lang.Object
implements EventHandler

Propagates instances of EventObject through the chain of instances. Each node on the chain can have a group of listeners (EventHandler). The main idea is that listeners in the chain are grouped into the nodes, whose order specifies the order in which the groups are notified. Because this class implements the listener interface itself, its instances can be listeners too, therefore a tree can be created with no additional functionality.

See Also:
EventObject, EventHandler

Field Summary
protected  java.util.Set eventHandlers
           
protected  EventPropagator next
           
protected static ObjectRecycler SET_RECYCLER
           
 
Constructor Summary
EventPropagator()
           
 
Method Summary
 boolean addHandler(EventHandler handler)
           
 EventPropagator addNext()
           
 void handleEvent(java.util.EventObject ev)
           
protected  EventPropagator newPropagator()
           
 boolean removeHandler(EventHandler handler)
           
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, toString, wait, wait, wait
 

Field Detail

SET_RECYCLER

protected static final ObjectRecycler SET_RECYCLER

eventHandlers

protected java.util.Set eventHandlers

next

protected EventPropagator next
Constructor Detail

EventPropagator

public EventPropagator()
Method Detail

handleEvent

public void handleEvent(java.util.EventObject ev)
Specified by:
handleEvent in interface EventHandler

addHandler

public boolean addHandler(EventHandler handler)

removeHandler

public boolean removeHandler(EventHandler handler)

addNext

public EventPropagator addNext()

newPropagator

protected EventPropagator newPropagator()