public class InputTriggerMap extends Object
InputMap
, this provides bindings from InputTrigger
to Behaviour
keys, and is chainable (see
setParent(InputTriggerMap)
).
In contrast to InputMap
, one InputTrigger
can map to multiple
Behaviour
keys.
Constructor and Description |
---|
InputTriggerMap()
Creates an
InputTriggerMap with no parent and no mappings. |
Modifier and Type | Method and Description |
---|---|
void |
clear()
Remove all bindings from this map.
|
Set<String> |
get(InputTrigger inputTrigger)
Get the set of all bindings for
inputTrigger defined in this map
and its parents. |
Map<InputTrigger,Set<String>> |
getAllBindings()
Get all bindings defined in this map and its parents.
|
Map<InputTrigger,Set<String>> |
getBindings()
Get all bindings defined in this map.
|
InputTriggerMap |
getParent()
Gets this
InputTriggerMap 's parent. |
int |
modCount() |
void |
put(InputTrigger inputTrigger,
String behaviourKey)
Adds a binding for
inputTrigger to behaviourKey . |
void |
remove(InputTrigger inputTrigger,
String behaviourKey)
Remove the specific binding from
inputTrigger to behaviourKey from this map. |
void |
removeAll(InputTrigger inputTrigger)
Remove all bindings for
inputTrigger from this map. |
void |
setParent(InputTriggerMap map)
Sets this
InputTriggerMap 's parent. |
public InputTriggerMap()
InputTriggerMap
with no parent and no mappings.public void setParent(InputTriggerMap map)
InputTriggerMap
's parent.map
- the map that is the parent of this onepublic InputTriggerMap getParent()
InputTriggerMap
's parent.null
if
this map has no parentpublic void put(InputTrigger inputTrigger, String behaviourKey)
inputTrigger
to behaviourKey
.inputTrigger
- behaviourKey
- public Set<String> get(InputTrigger inputTrigger)
inputTrigger
defined in this map
and its parents.inputTrigger
- inputTrigger
.public void remove(InputTrigger inputTrigger, String behaviourKey)
inputTrigger
to behaviourKey
from this map.inputTrigger
- behaviourKey
- public void removeAll(InputTrigger inputTrigger)
inputTrigger
from this map.inputTrigger
- public void clear()
public Map<InputTrigger,Set<String>> getAllBindings()
InputTriggerMap
, i.e.,
it will not reflect changes to the InputTriggerMap
.
This differs from getBindings()
in that this method includes the
bindings defined in the parent.
public Map<InputTrigger,Set<String>> getBindings()
InputTriggerMap
, i.e., it will not
reflect changes to the InputTriggerMap
.public int modCount()
Copyright © 2015–2022 SciJava. All rights reserved.