|
ADK CVS | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
Interface meant to translate generic callbacks to specific method calls. It is a workaround for not having method pointers in Java (o dear!).
interface MyListener extends java.util.EventListener {
void myEventOccured(MyEvent event) { ... }
}
You can generate an event using the EventDispatcher and send it to the right
method using EventCallback.
// Send an event
EventDispatcher dispatcher = ...
dispatcher.fireEvent(new MyEvent(), new MyCallback());
// Inner class
private static class MyCallBack implements EventCallback {
public void eventFired(EventListener listener, EventObject event) {
((MyListener) listener).myEventOccured((MyEvent) event);
}
Ok, the mechanism is a bit strange, but once you have implemented it you
don't notice it anymore... ;-)
EventDispatcher| Method Summary | |
void |
eventFired(java.util.EventListener listener,
java.util.EventObject event)
Called by the EventDispatcher to send an event. |
| Method Detail |
public void eventFired(java.util.EventListener listener,
java.util.EventObject event)
listener - the event listener.event - the event being sent.
|
Copyright 2005, Tryllian Solutions B.V. | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||