InputMap provides a binding between an input event (currently only KeyStrokes are used) and an Object. InputMaps are usually used with an ActionMap, to determine an Action to perform when a key is pressed. An InputMap can have a parent that is searched for bindings not defined in the InputMap. As with ActionMap if you create a cycle, eg:
InputMap am = new InputMap(); InputMap bm = new InputMap(): am.setParent(bm); bm.setParent(am); some of the methods will cause a StackOverflowError to be thrown.
InputMap provides a binding between an input event (currently only KeyStrokes are used) and an Object. InputMaps are usually used with an ActionMap, to determine an Action to perform when a key is pressed. An InputMap can have a parent that is searched for bindings not defined in the InputMap. As with ActionMap if you create a cycle, eg: InputMap am = new InputMap(); InputMap bm = new InputMap(): am.setParent(bm); bm.setParent(am); some of the methods will cause a StackOverflowError to be thrown.
(->input-map)Constructor.
Creates an InputMap with no parent and no mappings.
Constructor. Creates an InputMap with no parent and no mappings.
(all-keys this)Returns an array of the KeyStrokes defined in this InputMap and its parent. This differs from keys() in that this method includes the keys defined in the parent.
returns: javax.swing.KeyStroke[]
Returns an array of the KeyStrokes defined in this InputMap and its parent. This differs from keys() in that this method includes the keys defined in the parent. returns: `javax.swing.KeyStroke[]`
(clear this)Removes all the mappings from this InputMap.
Removes all the mappings from this InputMap.
(get this key-stroke)Returns the binding for keyStroke, messaging the parent InputMap if the binding is not locally defined.
key-stroke - javax.swing.KeyStroke
returns: java.lang.Object
Returns the binding for keyStroke, messaging the parent InputMap if the binding is not locally defined. key-stroke - `javax.swing.KeyStroke` returns: `java.lang.Object`
(get-parent this)Gets this InputMap's parent.
returns: map the InputMap that is the parent of this one,
or null if this InputMap has no parent - javax.swing.InputMap
Gets this InputMap's parent.
returns: map the InputMap that is the parent of this one,
or null if this InputMap has no parent - `javax.swing.InputMap`(keys this)Returns the KeyStrokes that are bound in this InputMap.
returns: javax.swing.KeyStroke[]
Returns the KeyStrokes that are bound in this InputMap. returns: `javax.swing.KeyStroke[]`
(put this key-stroke action-map-key)Adds a binding for keyStroke to actionMapKey. If actionMapKey is null, this removes the current binding for keyStroke.
key-stroke - javax.swing.KeyStroke
action-map-key - java.lang.Object
Adds a binding for keyStroke to actionMapKey. If actionMapKey is null, this removes the current binding for keyStroke. key-stroke - `javax.swing.KeyStroke` action-map-key - `java.lang.Object`
(remove this key)Removes the binding for key from this InputMap.
key - javax.swing.KeyStroke
Removes the binding for key from this InputMap. key - `javax.swing.KeyStroke`
(set-parent this map)Sets this InputMap's parent.
map - the InputMap that is the parent of this one - javax.swing.InputMap
Sets this InputMap's parent. map - the InputMap that is the parent of this one - `javax.swing.InputMap`
(size this)Returns the number of KeyStroke bindings.
returns: int
Returns the number of KeyStroke bindings. returns: `int`
cljdoc builds & hosts documentation for Clojure/Script libraries
| Ctrl+k | Jump to recent docs |
| ← | Move to previous article |
| → | Move to next article |
| Ctrl+/ | Jump to the search field |