|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object buoy.event.EventSource
public class EventSource
An EventSource is any object that can dispatch events. It maintains a list of "event links", which are methods to be called when specific types of events occur.
EventSource is the superclass of Widget, and the vast majority of EventSources are Widgets.
Constructor Summary | |
---|---|
EventSource()
Create a new EventSource. |
Method Summary | |
---|---|
void |
addEventLink(java.lang.Class eventType,
java.lang.Object target)
Create an event link from this object. |
void |
addEventLink(java.lang.Class eventType,
java.lang.Object target,
java.lang.reflect.Method method)
Create an event link from this object. |
void |
addEventLink(java.lang.Class eventType,
java.lang.Object target,
java.lang.String method)
Create an event link from this object. |
void |
dispatchEvent(java.lang.Object event)
Send out an object representing an event to every appropriate event link that has been added to this object. |
void |
removeEventLink(java.lang.Class eventType,
java.lang.Object target)
Remove an event link so that an object will no longer be notified of events of a particular type. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public EventSource()
Method Detail |
---|
public void addEventLink(java.lang.Class eventType, java.lang.Object target)
eventType
- the event class or interface which the target method wants to receivetarget
- the object to send the events topublic void addEventLink(java.lang.Class eventType, java.lang.Object target, java.lang.String method)
eventType
- the event class or interface which the target method wants to receivetarget
- the object to send the events tomethod
- the name of the method to invoke on the target object. The method must either take
no arguments, or take an object of class eventType (or any of its superclasses or
interfaces) as its only argument.public void addEventLink(java.lang.Class eventType, java.lang.Object target, java.lang.reflect.Method method)
eventType
- the event class or interface which the target method wants to receivetarget
- the object to send the events tomethod
- the method to invoke on the target object. The method must either take no
arguments, or take an object of class eventType (or any of its superclasses or
interfaces) as its only argument.public void removeEventLink(java.lang.Class eventType, java.lang.Object target)
eventType
- the event class or interface which should no longer be senttarget
- the object which was receiving the eventspublic void dispatchEvent(java.lang.Object event)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |