Class EventManager

    • Constructor Summary

      Constructors 
      Constructor Description
      EventManager()  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      protected void addListenerObject​(java.lang.Object listener)
      Adds a listener to this manager that will be notified when this manager's state changes.
      protected void clearListeners()
      Clears all of the listeners from the listener list.
      protected java.lang.Object[] getListeners()
      Returns an array containing all the listeners attached to this event manager.
      protected boolean isListenerAttached()
      Whether one or more listeners are attached to the manager.
      protected void removeListenerObject​(java.lang.Object listener)
      Removes a listener from this manager.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • EventManager

        public EventManager()
    • Method Detail

      • addListenerObject

        protected final void addListenerObject​(java.lang.Object listener)
        Adds a listener to this manager that will be notified when this manager's state changes. This method has no effect if the same listener is already registered.
        Parameters:
        listener - The listener to be added; must not be null.
      • clearListeners

        protected final void clearListeners()
        Clears all of the listeners from the listener list.
      • getListeners

        protected final java.lang.Object[] getListeners()
        Returns an array containing all the listeners attached to this event manager. The resulting array is unaffected by subsequent adds or removes. If there are no listeners registered, the result is an empty array. Use this method when notifying listeners, so that any modifications to the listener list during the notification will have no effect on the notification itself.

        Note: Callers of this method must not modify the returned array.

        Returns:
        The listeners currently attached; may be empty, but never null
      • isListenerAttached

        protected final boolean isListenerAttached()
        Whether one or more listeners are attached to the manager.
        Returns:
        true if listeners are attached to the manager; false otherwise.
      • removeListenerObject

        protected final void removeListenerObject​(java.lang.Object listener)
        Removes a listener from this manager. Has no effect if the same listener was not already registered.
        Parameters:
        listener - The listener to be removed; must not be null.