com.incrediblesoft.redjey.event
Class AbstractEvent

java.lang.Object
  extended by com.incrediblesoft.redjey.event.AbstractEvent
Direct Known Subclasses:
ActionEvent, FocusEvent, MouseEvent, PaintEvent

public class AbstractEvent
extends java.lang.Object


Field Summary
static int ACTION_EVENT
           
static int FOCUS_EVENT
           
static int MOUSE_EVENT
          Event types.
static int PAINT_EVENT
           
 
Constructor Summary
AbstractEvent(Component source, int id, int eventType)
          Default constructor
 
Method Summary
 void consume()
          Consumes this event
 int getEventType()
          Returns the type of event
 int getID()
          Returns event id
 Component getSource()
          Returns event's source
 boolean isConsumed()
          Returns wether this event is already consumed
 void setID(int id)
          Sets event id
 void setSource(Component source)
          Sets source of event
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

MOUSE_EVENT

public static final int MOUSE_EVENT
Event types. Used to avoid the use of instanceof instruction

See Also:
Constant Field Values

PAINT_EVENT

public static final int PAINT_EVENT
See Also:
Constant Field Values

ACTION_EVENT

public static final int ACTION_EVENT
See Also:
Constant Field Values

FOCUS_EVENT

public static final int FOCUS_EVENT
See Also:
Constant Field Values
Constructor Detail

AbstractEvent

public AbstractEvent(Component source,
                     int id,
                     int eventType)
Default constructor

Parameters:
source - Source
id - Event ID
eventType - Type of event (Mouse, Paint, Action etc.)
Method Detail

getSource

public Component getSource()
Returns event's source

Returns:
Source

setSource

public void setSource(Component source)
Sets source of event

Parameters:
source - Source

getID

public int getID()
Returns event id

Returns:

setID

public void setID(int id)
Sets event id

Parameters:
id - ID

isConsumed

public boolean isConsumed()
Returns wether this event is already consumed

Returns:
true/false

consume

public void consume()
Consumes this event


getEventType

public int getEventType()
Returns the type of event

Returns:
Event type (Mouse, Paint, Action etc.)