Class WWEvent

  • All Implemented Interfaces:
    java.io.Serializable
    Direct Known Subclasses:
    BulkRetrievalEvent, Message, PositionEvent, RenderingEvent, SelectEvent

    public class WWEvent
    extends java.util.EventObject
    WWEvent is the base class which all WorldWind event objects derive from. It extends Java's base EventObject by adding the capability to consume the event by calling consume(). Consuming a WWEvent prevents is from being processed in the default manner by the source that originated the event. If the event cannot be consumed, calling consume() has no effect, though isConsumed() returns whether or not consume() has been called.
    See Also:
    Serialized Form
    • Field Summary

      Fields 
      Modifier and Type Field Description
      protected boolean consumed
      Denotes whether or not the event has been consumed.
      • Fields inherited from class java.util.EventObject

        source
    • Constructor Summary

      Constructors 
      Constructor Description
      WWEvent​(java.lang.Object source)
      Creates a new WWEvent with the object that originated the event.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void consume()
      Consumes the event so it will not be processed in the default manner by the source which originated it.
      boolean isConsumed()
      Returns whether or not the event has been consumed.
      • Methods inherited from class java.util.EventObject

        getSource, toString
      • Methods inherited from class java.lang.Object

        clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Field Detail

      • consumed

        protected boolean consumed
        Denotes whether or not the event has been consumed. Initially false.
    • Constructor Detail

      • WWEvent

        public WWEvent​(java.lang.Object source)
        Creates a new WWEvent with the object that originated the event.
        Parameters:
        source - the object that originated the event.
        Throws:
        java.lang.IllegalArgumentException - if the source is null.
    • Method Detail

      • consume

        public void consume()
        Consumes the event so it will not be processed in the default manner by the source which originated it. This does nothing if the event cannot be consumed.
      • isConsumed

        public boolean isConsumed()
        Returns whether or not the event has been consumed.

        Note: if the event cannot be consumed, this still returns true if consume() has been called, though this has no effect.

        Returns:
        true if the event has been consumed, and false otherwise.