Event Adapters

Event adapters are objects that are interposed between event sources and event listeners. Adapters implement an event listener interface and decouple one or more event sources from one or more event listeners.

Figure 9-13 illustrates the relationships between an event source, adapter, and listener. The adapter class stands in as a listener for a particular event by implementing an appropriate listener interface. When the adapter receives an event, it forwards it to the listener. The adapter may choose to act upon the event either before the event is forwarded to the listener or afterwards. Some adapters may queue events for pending delivery, for instance, whereas others may filter events that are passed on to the listener.

Figure ...

Get Graphic Java™ 1.2, Volume I: AWT, Third Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.