NASA World Wind

gov.nasa.worldwind.event
Class WWEvent

java.lang.Object
  extended by java.util.EventObject
      extended by gov.nasa.worldwind.event.WWEvent
All Implemented Interfaces:
Serializable
Direct Known Subclasses:
BulkRetrievalEvent, Message, PositionEvent, RenderingEvent, SelectEvent

public class WWEvent
extends EventObject

WWEvent is the base class which all World Wind 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
protected  boolean consumed
          Denotes whether or not the event has been consumed.
 
Fields inherited from class java.util.EventObject
source
 
Constructor Summary
WWEvent(Object source)
          Creates a new WWEvent with the object that originated the event.
 
Method Summary
 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, finalize, 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(Object source)
Creates a new WWEvent with the object that originated the event.

Parameters:
source - the object that originated the event.
Throws:
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.

NASA World Wind