com.jme.input.action
Class InputActionEvent

java.lang.Object
  extended bycom.jme.input.action.InputActionEvent

public class InputActionEvent
extends java.lang.Object

InputActionEvent defines an event that generates the processing of a given InputAction. This event contains information about the triggers that caused the event to take places as well as the list of names of the other Actions that were to be processed at the same time.

Version:
$Id: InputActionEvent.java,v 1.1 2004/10/14 01:22:58 mojomonkey Exp $
Author:
Mark Powell

Constructor Summary
InputActionEvent()
          instantiates a default InputActionEvent object.
InputActionEvent(KeyInput keys, MouseInput mouse, java.util.ArrayList eventList, float time)
          instantiates a new InputActionEvent object.
 
Method Summary
 boolean containsEvent(java.lang.String event)
          containsEvent determines if a event defined by its name is currently contained in the list.
 java.util.ArrayList getEventList()
          returns the event list.
 KeyInput getKeys()
          returns the list of keys.
 MouseInput getMouse()
           
 float getTime()
          returns the time the event occured.
 boolean isKeyDown(int key)
          isKeyDown determines if a particular key is pressed at the time of the event.
 void setEventList(java.util.ArrayList eventList)
          sets the event list.
 void setKeys(KeyInput keys)
          sets the list of keys.
 void setMouse(MouseInput mouse)
           
 void setTime(float time)
          sets the time the event occured.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

InputActionEvent

public InputActionEvent()
instantiates a default InputActionEvent object. The keys, eventList and time are set to null or 0.


InputActionEvent

public InputActionEvent(KeyInput keys,
                        MouseInput mouse,
                        java.util.ArrayList eventList,
                        float time)
instantiates a new InputActionEvent object. The keys, eventList and time are set during creation.

Parameters:
keys - the key state.
eventList - the list of called actions.
time - the time of the event.
Method Detail

getEventList

public java.util.ArrayList getEventList()
returns the event list. This list contains all actions called for this event.

Returns:
Returns the eventList.

setEventList

public void setEventList(java.util.ArrayList eventList)
sets the event list. This list contains all actions called for this event.

Parameters:
eventList - The eventList to set.

getTime

public float getTime()
returns the time the event occured.

Returns:
Returns the time.

setTime

public void setTime(float time)
sets the time the event occured.

Parameters:
time - The time to set.

getKeys

public KeyInput getKeys()
returns the list of keys.

Returns:
Returns the keys.

setKeys

public void setKeys(KeyInput keys)
sets the list of keys.

Parameters:
keys - The keys to set.

isKeyDown

public boolean isKeyDown(int key)
isKeyDown determines if a particular key is pressed at the time of the event. The key is defined as a constant from KeyInput. If the key is pressed, true is returned else, false is returned.

Parameters:
key - the key to check (defined as a constant in KeyInput).
Returns:
true if the supplied key is pressed, false otherwise.

containsEvent

public boolean containsEvent(java.lang.String event)
containsEvent determines if a event defined by its name is currently contained in the list.

Parameters:
event - the event to check.
Returns:
true if the event is in the list, false otherwise.

getMouse

public MouseInput getMouse()
Returns:
Returns the mouse.

setMouse

public void setMouse(MouseInput mouse)
Parameters:
mouse - The mouse to set.