public class EventSource
extends java.lang.Object
EventSource is the superclass of Widget, and the vast majority of EventSources are Widgets.
Constructor and Description |
---|
EventSource()
Create a new EventSource.
|
Modifier and Type | Method and Description |
---|---|
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.
|
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)
Written by Peter Eastman.