gov.nasa.worldwind.event
Class WWEvent
java.lang.Object
java.util.EventObject
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. |
|
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. |
consumed
protected boolean consumed
- Denotes whether or not the event has been consumed. Initially
false.
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.
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.