|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.jagatoo.input.managers.InputBindingsManager<A>
public class InputBindingsManager<A extends InputAction>
This is a generic input-bindings manager.
| Field Summary | |
|---|---|
protected DeviceComponent[][] |
boundKeys
|
protected static int |
NUM_KEY_SETS
|
| Constructor Summary | |
|---|---|
InputBindingsManager(int numCommands)
|
|
| Method Summary | |
|---|---|
void |
addInputBindingListener(InputBindingListener<A> l)
|
InputBindingsSet |
bind(DeviceComponent comp,
A action)
Binds a key to a specific InputAction at the fist free InputBindingsSet or InputBindingsSet.PRIMARY. |
InputBindingsSet |
bind(DeviceComponent comp,
A action,
InputBindingsSet set)
Binds a key to a specific InputAction. |
A |
getBoundAction(DeviceComponent comp)
|
A |
getBoundAction(DeviceComponent comp,
InputBindingsSet set)
|
java.util.Collection<A> |
getBoundActions()
|
void |
getBoundActions(DeviceComponent[] components,
InputAction[] result)
|
DeviceComponent |
getBoundComponent(A action,
InputBindingsSet set)
|
java.util.Set<DeviceComponent> |
getBoundInputComponents()
|
int |
getBoundInputComponents(DeviceComponent[] result)
|
java.util.Map<DeviceComponent,A> |
getInputBindingsMap()
|
int |
getNumActions()
|
protected void |
notifyBound(DeviceComponent key,
InputBindingsSet set,
A action)
|
protected void |
notifyUnbound(DeviceComponent key,
InputBindingsSet set,
A action)
|
void |
removeInputBindingListener(InputBindingListener<A> l)
|
void |
set(InputBindingsManager<? extends A> bindings)
Sets the key-bindings Map with the KeyCodes mapped to InputActions. |
void |
set(InputBindingsManager<? extends A> bindings,
boolean clearBefore)
Sets the key-bindings Map with the KeyCodes mapped to InputActions. |
void |
setInputBindings(java.util.Map<DeviceComponent,? extends A> inputBindings)
Sets the key-bindings Map with the KeyCodes mapped to InputActions. |
void |
setInputBindings(java.util.Map<DeviceComponent,? extends A> inputBindings,
boolean clearBefore)
Sets the key-bindings Map with the KeyCodes mapped to InputActions. |
DeviceComponent |
unbind(A action)
Unbinds a key from a specific KeyCommand. |
A |
unbind(DeviceComponent comp)
Unbinds a specific key. |
void |
unbindAll()
Clears the key bindings Map. |
void |
unbindAll(InputBindingsSet set)
Clears the key bindings Map. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected static final int NUM_KEY_SETS
protected final DeviceComponent[][] boundKeys
| Constructor Detail |
|---|
public InputBindingsManager(int numCommands)
| Method Detail |
|---|
public final void addInputBindingListener(InputBindingListener<A> l)
public final void removeInputBindingListener(InputBindingListener<A> l)
protected final void notifyBound(DeviceComponent key,
InputBindingsSet set,
A action)
protected final void notifyUnbound(DeviceComponent key,
InputBindingsSet set,
A action)
public final int getNumActions()
public final java.util.Set<DeviceComponent> getBoundInputComponents()
public final int getBoundInputComponents(DeviceComponent[] result)
public final java.util.Collection<A> getBoundActions()
public final void getBoundActions(DeviceComponent[] components,
InputAction[] result)
public final A unbind(DeviceComponent comp)
comp - the component to unbind
InputAction, this key was previously bound topublic final DeviceComponent unbind(A action)
action - the InputAction to un-map from its key
public final A getBoundAction(DeviceComponent comp,
InputBindingsSet set)
comp - the key of the requested InputActionset - the InputBindingsSet (may be null for an arbitrary set)
public final A getBoundAction(DeviceComponent comp)
comp - the key of the requested InputAction
public final DeviceComponent getBoundComponent(A action,
InputBindingsSet set)
action - set -
public final InputBindingsSet bind(DeviceComponent comp,
A action,
InputBindingsSet set)
comp - the key to bindaction - the InputAction to map to the given keyset - the InputBindingsSet the key is to be bound at. (may be null to take the next free set or the PRIMARY)
InputBindingsSet, the key has been bound at.
public final InputBindingsSet bind(DeviceComponent comp,
A action)
InputBindingsSet or InputBindingsSet.PRIMARY.
comp - the key to bindaction - the InputAction to map to the given key
InputBindingsSet, the key has been bound at.public final void unbindAll(InputBindingsSet set)
set - public final void unbindAll()
public final void setInputBindings(java.util.Map<DeviceComponent,? extends A> inputBindings,
boolean clearBefore)
public final void setInputBindings(java.util.Map<DeviceComponent,? extends A> inputBindings)
public java.util.Map<DeviceComponent,A> getInputBindingsMap()
public final void set(InputBindingsManager<? extends A> bindings,
boolean clearBefore)
public final void set(InputBindingsManager<? extends A> bindings)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||