fop 1.0

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
 void addEventListener(EventListener listener)
          Adds an event listener to the broadcaster.
 void broadcastEvent(Event event)
          Broadcasts an event.
 EventProducer getEventProducerFor(java.lang.Class 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

EventProducer getEventProducerFor(java.lang.Class 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

fop 1.0

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