org.jdesktop.wonderland.client.input
Class EventClassFocusListener

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.input.EventClassFocusListener
All Implemented Interfaces:
EventListener

public class EventClassFocusListener
extends EventClassListener

A simplified event listener which provides the input system with an array of event classes. By doing this the listener is telling the input system that it wishes to receive only events of these classes. Furthermore, the events are to be received only when the corresponding entity has focus. If you wish to not honor focus, use EventClassListener instead. This class uses isAssignableFrom to compare the event class with the desired event classes, so if the return array of eventClassesToConsume contains a superclass, events of that class and all subclasses will be consumed.

Author:
deronj

Field Summary
 
Fields inherited from class org.jdesktop.wonderland.client.input.EventListenerBaseImpl
enabled
 
Constructor Summary
EventClassFocusListener()
           
 
Method Summary
 boolean consumesEvent(Event event)
          INTERNAL ONLY.
 java.lang.Class[] eventClassesToConsume()
          Note on subclassing: the subclass should override this method.
 
Methods inherited from class org.jdesktop.wonderland.client.input.EventListenerBaseImpl
addToEntity, commit, commitEvent, 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

EventClassFocusListener

public EventClassFocusListener()
Method Detail

eventClassesToConsume

public java.lang.Class[] eventClassesToConsume()
Note on subclassing: the subclass should override this method.

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

consumesEvent

public boolean consumesEvent(Event event)
INTERNAL ONLY.

Specified by:
consumesEvent in interface EventListener
Overrides:
consumesEvent in class EventClassListener
Parameters:
event - The event in question.


Open Wonderland - http://openwonderland.org