org.jdesktop.wonderland.client.jme.input.test
Class SpinObjectEventListener

java.lang.Object
  extended by org.jdesktop.mtgame.EntityComponent
      extended by org.jdesktop.mtgame.ProcessorComponent
          extended by org.jdesktop.wonderland.client.input.EventListenerBaseImpl
              extended by org.jdesktop.wonderland.client.input.EventClassListener
                  extended by org.jdesktop.wonderland.client.jme.input.test.SpinObjectEventListener
All Implemented Interfaces:
EventListener

public class SpinObjectEventListener
extends EventClassListener

An event listener which toggles the spinning state of an object when an button press event occurs over it. To use this in a scene just add this to any entities you wish to make input sensitive via this.addToEntity.

Example Usage:

SpinObjectEventListener spinListener = new SpinObjectEventListener();
spinListener.addToEntity(entity);

Author:
deronj

Field Summary
 
Fields inherited from class org.jdesktop.wonderland.client.input.EventListenerBaseImpl
enabled
 
Constructor Summary
SpinObjectEventListener()
           
 
Method Summary
 void commitEvent(Event event)
          Called after computeEvent has been called for this event listener.
 java.lang.Class[] eventClassesToConsume()
          Consume only mouse button events.
 
Methods inherited from class org.jdesktop.wonderland.client.input.EventClassListener
consumesEvent
 
Methods inherited from class org.jdesktop.wonderland.client.input.EventListenerBaseImpl
addToEntity, commit, compute, computeEvent, initialize, isEnabled, isListeningForEntity, postEvent, propagatesToParent, removeFromEntity, setEnabled
 
Methods inherited from class org.jdesktop.mtgame.ProcessorComponent
addToChain, getArmingCondition, getCurrentTriggerCollection, getLocation, getLODLevel, getRunInRenderer, getSwingSafe, removeFromChain, setArmingCondition, setLocation, setRunInRenderer, setSwingSafe
 
Methods inherited from class org.jdesktop.mtgame.EntityComponent
getEntity, setEntity
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SpinObjectEventListener

public SpinObjectEventListener()
Method Detail

eventClassesToConsume

public java.lang.Class[] eventClassesToConsume()
Consume only mouse button events.

Overrides:
eventClassesToConsume in class EventClassListener
Returns:
An array of the event classes the listener wishes to consume.

commitEvent

public void commitEvent(Event event)
Called after computeEvent has been called for this event listener. The implementation of this method should apply to the world those changes which were determined in computeEvent.

Note: It is guaranteed that a call to commitEvent for an event is always preceded by a call to commitEvent for that event.

Specified by:
commitEvent in interface EventListener
Overrides:
commitEvent in class EventListenerBaseImpl
Parameters:
event - The event which was computed.


Open Wonderland - http://openwonderland.org