org.apache.fop.events

## Interface EventBroadcaster

- All Known Implementing Classes:
    DefaultEventBroadcaster

      public interface EventBroadcaster

  The EventBroadcaster is the central relay point for events. It receives events from various parts of the application and forwards them to any registered EventListener.

- - ### Method Summary

    All Methods Instance Methods Abstract Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `addEventListener(EventListener listener)` Adds an event listener to the broadcaster.
    `void` | `broadcastEvent(Event event)` Broadcasts an event.
    `<T extends EventProducer> T` | `getEventProducerFor(java.lang.Class<T> clazz)` Returns an event producer instance for the given interface class.
    `boolean` | `hasEventListeners()` Indicates whether any listeners have been registered with the broadcaster.
    `void` | `removeEventListener(EventListener listener)` Removes an event listener from the broadcaster.

- - ### Method Detail

    - #### addEventListener

          void addEventListener(EventListener listener)

      Adds an event listener to the broadcaster. It is appended to the list of previously registered listeners (the order of registration defines the calling order).
      Parameters:
        `listener` - the listener to be added

    - #### removeEventListener

          void removeEventListener(EventListener listener)

      Removes an event listener from the broadcaster. If the event listener is not registered, nothing happens.
      Parameters:
        `listener` - the listener to be removed

    - #### hasEventListeners

          boolean hasEventListeners()

      Indicates whether any listeners have been registered with the broadcaster.
      Returns:
        true if listeners are present, false otherwise

    - #### broadcastEvent

          void broadcastEvent(Event event)

      Broadcasts an event. This method is usually called from within the observed component.
      Parameters:
        `event` - the event to be broadcast

    - #### getEventProducerFor

          <T extends EventProducer> T getEventProducerFor(java.lang.Class<T> clazz)

      Returns an event producer instance for the given interface class.
      Parameters:
        `clazz` - the Class object identifying an `EventProducer` interface
      Returns:
        the event producer instance

Copyright 1999-2015 The Apache Software Foundation. All Rights Reserved.