org.jdesktop.wonderland.client.scenemanager.event
Class SceneEvent

java.lang.Object
  extended by org.jdesktop.wonderland.client.input.Event
      extended by org.jdesktop.wonderland.client.scenemanager.event.SceneEvent
All Implemented Interfaces:
java.io.Serializable
Direct Known Subclasses:
ActivatedEvent, ContextEvent, EnterExitEvent, HoverEvent, SelectionEvent

public class SceneEvent
extends Event

The base event class for all scene manager events. This base class manages a list of Entities to which the scene event applies. In some cases (e.g. hover event), there will be only one Entity, while there may be more than one Entity for other events (e.g. selection event). The list of Entities is ordered: the first Entity in the list was the first Entity selected.

Author:
Jordan Slott
See Also:
Serialized Form

Field Summary
 
Fields inherited from class org.jdesktop.wonderland.client.input.Event
entity, EVENT_CLASS_ID, isFocussed
 
Constructor Summary
SceneEvent()
          Default constructor
SceneEvent(java.util.List<org.jdesktop.mtgame.Entity> entities)
          Constructor, takes the list of Enitities of the context event.
 
Method Summary
 Event clone(Event event)
          Copy the members of this class into the given event.
static Cell getCellForEntity(org.jdesktop.mtgame.Entity entity)
          Returns the Cell corresonding to the given Entity, or null if there is none.
 java.util.List<org.jdesktop.mtgame.Entity> getEntityList()
          Returns an ordered list of Entities associated with the context event.
 Cell getPrimaryCell()
          Returns the Cell associated with the "primary" selection.
 org.jdesktop.mtgame.Entity getPrimaryEntity()
          Returns the Entity associated with the "primary" selection.
 
Methods inherited from class org.jdesktop.wonderland.client.input.Event
allocateEventClassID, free, getClassID, getEntity, isFocussed, setEntity, setFocussed
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SceneEvent

public SceneEvent()
Default constructor


SceneEvent

public SceneEvent(java.util.List<org.jdesktop.mtgame.Entity> entities)
Constructor, takes the list of Enitities of the context event.

Method Detail

getEntityList

public java.util.List<org.jdesktop.mtgame.Entity> getEntityList()
Returns an ordered list of Entities associated with the context event. The first Entity in the list represents the first Entity selected.

Returns:
A list of selected Entities

getCellForEntity

public static Cell getCellForEntity(org.jdesktop.mtgame.Entity entity)
Returns the Cell corresonding to the given Entity, or null if there is none.

Parameters:
entity - The entity for fetch the Cell for
Returns:
The Cell

getPrimaryEntity

public org.jdesktop.mtgame.Entity getPrimaryEntity()
Returns the Entity associated with the "primary" selection. That is, if multiple Entity's are selected, the "primary" Entity was the first one selected. Returns null if none.

Returns:
The primary Entity, or null

getPrimaryCell

public Cell getPrimaryCell()
Returns the Cell associated with the "primary" selection. That is, if multiple Entity's are selected, the "primary" Cell is the Cell associated with the first Entity selected. Returns null if none.

Returns:
The primary Cell, or null

clone

public Event clone(Event event)
Copy the members of this class into the given event.
If event is null, a new event of this class is created and returned.

Overrides:
clone in class Event


Open Wonderland - http://openwonderland.org