org.jdesktop.wonderland.client.input
Class Event

java.lang.Object
  extended by org.jdesktop.wonderland.client.input.Event
All Implemented Interfaces:
java.io.Serializable
Direct Known Subclasses:
AvatarCollisionEvent, DropTargetEvent3D, FocusChangeEvent, FocusEvent3D, InputEvent3D, SceneEvent

public abstract class Event
extends java.lang.Object
implements java.io.Serializable

The base class for all Wonderland events and actions.

Author:
deronj
See Also:
Serialized Form

Field Summary
protected  org.jdesktop.mtgame.Entity entity
          The entity to which this event was distributed.
static int EVENT_CLASS_ID
          This event's class ID.
protected  boolean isFocussed
          Whether the entity had focus at the time the event was distributed.
 
Constructor Summary
protected Event()
          Create a new instance of Event
 
Method Summary
protected static int allocateEventClassID()
          Allocate a unique event class ID.
 Event clone(Event event)
          Copy the members of this class into the given event.
protected static void free(int eventClassID)
          Free an already allocated event class ID.
 int getClassID()
          Return the class ID of this event type.
 org.jdesktop.mtgame.Entity getEntity()
          Returns the entity to which this event was distributed.
 boolean isFocussed()
          Did the entity with which this event is associated have focus at the time the event was distributed?
 void setEntity(org.jdesktop.mtgame.Entity entity)
          INTERNAL ONLY.
 void setFocussed(boolean focussed)
          INTERNAL ONLY.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

EVENT_CLASS_ID

public static int EVENT_CLASS_ID
This event's class ID. All concrete subclasses should call Event.allocateEventClassID to allocate this.


entity

protected org.jdesktop.mtgame.Entity entity
The entity to which this event was distributed.


isFocussed

protected boolean isFocussed
Whether the entity had focus at the time the event was distributed.

Constructor Detail

Event

protected Event()
Create a new instance of Event

Method Detail

getClassID

public int getClassID()
Return the class ID of this event type.


allocateEventClassID

protected static int allocateEventClassID()
Allocate a unique event class ID.


free

protected static void free(int eventClassID)
Free an already allocated event class ID.


getEntity

public org.jdesktop.mtgame.Entity getEntity()
Returns the entity to which this event was distributed.


isFocussed

public boolean isFocussed()
Did the entity with which this event is associated have focus at the time the event was distributed?


setEntity

public void setEntity(org.jdesktop.mtgame.Entity entity)
INTERNAL ONLY.
Specify the entity with which this event is associated.


setFocussed

public void setFocussed(boolean focussed)
INTERNAL ONLY.
Set whether event's entity had focus at the time the event was distributed.

NOTE: this must be called by the EventDistributor at event distribution time.


clone

public Event clone(Event event)
Copy the members of this class into the given event.



Open Wonderland - http://openwonderland.org