| java.lang.Object | |
| ↳ | javax.swing.InputMap |
Known Direct Subclasses
|
Known Indirect Subclasses
|
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.
| Public Constructors | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
Creates an
InputMap with no parent and no mappings. | |||||||||||
| Public Methods | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
Returns an array of the
KeyStrokes defined in this
InputMap and its parent. | |||||||||||
Removes all the mappings from this
InputMap. | |||||||||||
Returns the binding for
keyStroke, messaging the
parent InputMap if the binding is not locally defined. | |||||||||||
Gets this
InputMap's parent. | |||||||||||
Returns the
KeyStrokes that are bound in this InputMap. | |||||||||||
Adds a binding for
keyStroke to actionMapKey. | |||||||||||
Removes the binding for
key from this
InputMap. | |||||||||||
Sets this
InputMap's parent. | |||||||||||
Returns the number of
KeyStroke bindings. | |||||||||||
|
[Expand]
Inherited Methods | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
From class
java.lang.Object
| |||||||||||
Creates an InputMap with no parent and no mappings.
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.
Removes all the mappings from this InputMap.
Returns the binding for keyStroke, messaging the
parent InputMap if the binding is not locally defined.
Gets this InputMap's parent.
InputMap that is the parent of this one,
or null if this InputMap has no parent
Adds a binding for keyStroke to actionMapKey.
If actionMapKey is null, this removes the current binding
for keyStroke.
Sets this InputMap's parent.
| map | the InputMap that is the parent of this one
|
|---|
Returns the number of KeyStroke bindings.