Class EventDispatcher

    • Field Detail

      • eventListeners

        protected java.util.Map<java.lang.String,​java.util.ArrayList<EventListener>> eventListeners
        Map of type to event listeners.
    • Constructor Detail

      • EventDispatcher

        public EventDispatcher()
    • Method Detail

      • addEventListener

        public void addEventListener​(java.lang.String type,
                                     EventListener listener)
        Adds a new event listener of type to dispatcher.
      • removeEventListener

        public void removeEventListener​(java.lang.String type,
                                        EventListener listener)
        Removes an event listener of type.
      • removeEventListeners

        public void removeEventListeners​(java.lang.String type)
        Removes all event listeners of type.
      • hasEventListener

        public java.lang.Boolean hasEventListener​(java.lang.String type,
                                                  EventListener listener)
        Checks if has an event listener.
      • invokeEvent

        public void invokeEvent​(IEvent event)
        Invokes the event
      • dispatchEvent

        public void dispatchEvent​(IEvent event)
        Sends a new event.
      • dispatchEventWith

        public void dispatchEventWith​(java.lang.String name)
        Sends a new event with type only.
      • dispatchEventWith

        public void dispatchEventWith​(java.lang.String type,
                                      java.lang.Boolean bubbles,
                                      java.lang.Object data)
        Sends a new event with values.
      • dispose

        public void dispose()
        Disposes the event dispatcher.