gishur.core.event
Class ConsumableEvent

java.lang.Object
  |
  +--java.util.EventObject
        |
        +--java.awt.AWTEvent
              |
              +--gishur.core.event.GishurEvent
                    |
                    +--gishur.core.event.ConsumableEvent
All Implemented Interfaces:
java.lang.Cloneable, Cloneable, java.io.Serializable
Direct Known Subclasses:
ModifyEvent

public abstract class ConsumableEvent
extends GishurEvent
implements Cloneable

Base class for all AWTEvents that may be consumed. This may be used by event processing to prevent dispatching of consumed events. ConsumableEvents are Cloneable because they may be cloned to initiate various consumption paths while event processing.

Version:
1.0
Author:
Thomas Wolf
See Also:
Serialized Form

Fields inherited from class gishur.core.event.GishurEvent
AWT_ACTION_EVENT_MASK, AWT_ADJUSTMENT_EVENT_MASK, AWT_COMPONENT_EVENT_MASK, AWT_CONTAINER_EVENT_MASK, AWT_FOCUS_EVENT_MASK, AWT_ITEM_EVENT_MASK, AWT_KEY_EVENT_MASK, AWT_MOUSE_EVENT_MASK, AWT_MOUSE_MOTION_EVENT_MASK, AWT_TEXT_EVENT_MASK, AWT_WINDOW_EVENT_MASK, GISHUR_EVENT_MASK, GISHUR_ID_MASK, MAX_EVENT_TYPES, MIN_GISHUR_MASK
 
Fields inherited from class java.awt.AWTEvent
ACTION_EVENT_MASK, ADJUSTMENT_EVENT_MASK, COMPONENT_EVENT_MASK, consumed, CONTAINER_EVENT_MASK, FOCUS_EVENT_MASK, HIERARCHY_BOUNDS_EVENT_MASK, HIERARCHY_EVENT_MASK, id, INPUT_METHOD_EVENT_MASK, INVOCATION_EVENT_MASK, ITEM_EVENT_MASK, KEY_EVENT_MASK, MOUSE_EVENT_MASK, MOUSE_MOTION_EVENT_MASK, PAINT_EVENT_MASK, RESERVED_ID_MAX, TEXT_EVENT_MASK, WINDOW_EVENT_MASK
 
Fields inherited from class java.util.EventObject
source
 
Constructor Summary
ConsumableEvent(java.awt.Event event)
          Constructs an ConsumableEvent object from the parameters of a 1.0-style event.
ConsumableEvent(java.lang.Object source, int id)
          Constructs an ConsumableEvent object with the specified source object and type.
 
Method Summary
 java.lang.Object clone()
          Creates a new object of the same class as this object.
 void consume()
          Consumes this event so that it will not be processed in the default manner by the source which originated it.
 boolean isConsumed()
          Returns whether or not this event has been consumed.
 
Methods inherited from class gishur.core.event.GishurEvent
isMaskedBy
 
Methods inherited from class java.awt.AWTEvent
finalize, getID, paramString, toString
 
Methods inherited from class java.util.EventObject
getSource
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ConsumableEvent

public ConsumableEvent(java.awt.Event event)
Constructs an ConsumableEvent object from the parameters of a 1.0-style event.
Parameters:
event - the old-style event

ConsumableEvent

public ConsumableEvent(java.lang.Object source,
                       int id)
Constructs an ConsumableEvent object with the specified source object and type.
Parameters:
source - the object where the event originated
Method Detail

consume

public void consume()
Consumes this event so that it will not be processed in the default manner by the source which originated it.
Overrides:
consume in class java.awt.AWTEvent

isConsumed

public boolean isConsumed()
Returns whether or not this event has been consumed.
Overrides:
isConsumed in class java.awt.AWTEvent
See Also:
consume()

clone

public java.lang.Object clone()
Creates a new object of the same class as this object.
Specified by:
clone in interface Cloneable
Overrides:
clone in class java.lang.Object
Returns:
a clone of this instance.
Throws:
OutOfMemoryError - if there is not enough memory.
See Also:
Cloneable