Interface EventDispatcherInterface

  • All Known Implementing Classes:
    EventDispatcher

    public interface EventDispatcherInterface
    A class forwarding events from event sources to listeners.
    • Method Detail

      • addGameDataListener

        void addGameDataListener​(GameDataListener l)
        Adds a listener for game data events.
        Parameters:
        l - the listener to add.
        See Also:
        GameDataEvent
      • addPriorityGameDataListener

        void addPriorityGameDataListener​(GameDataListener l)
        Adds the given game-data listener to the front of all registered listeners. Warning: The order will change if another listener is added with priority.
      • removeGameDataListener

        boolean removeGameDataListener​(GameDataListener l)
        Removes the specified listener for game data events.
        Parameters:
        l - the listener to remove.
        Returns:
        true if this list contained the specified element.
        See Also:
        GameDataEvent
      • removeAllListeners

        boolean removeAllListeners​(java.lang.Object o)
        Removes the specified listener from all event queues
        Parameters:
        o - the listener to remove.
        Returns:
        true if one of the list contained the specified element.
      • fire

        void fire​(java.util.EventObject e,
                  boolean synchronous)
        Forwards an event to all registered listeners for this event type.

        If synchronous is false, the forwarding is done asynchronously in a separate dispatcher thread. If the fire method is called before the dispatcher thread has finished the previous request, it is stopped and starts forwarding the new event.

      • fire

        void fire​(java.util.EventObject e)
        Asynchronously forwards an event to all registered listeners for this event type.
      • getEventsFired

        int getEventsFired()
        Returns the number of events that were passed to this dispatcher for forwarding.
      • getEventsDispatched

        int getEventsDispatched()
        Returns the number of events that were actually forwarded to event listeners.