javax.swing
public class InputMap extends Object implements Serializable
InputMap
. The result is an object which
serves as a key to the component's ActionMap
. Finally
the Action
that is stored is executed.
Since: 1.3
Constructor Summary | |
---|---|
InputMap()
Creates a new InputMap instance. |
Method Summary | |
---|---|
KeyStroke[] | allKeys()
Returns all keys of entries in this InputMap and all its
parents.
|
void | clear()
Clears the entries from this InputMap . |
Object | get(KeyStroke keystroke)
Returns the binding for the specified keystroke, if there is one.
|
InputMap | getParent()
Returns the parent of this InputMap . |
KeyStroke[] | keys()
Returns all keys of entries in this InputMap . |
void | put(KeyStroke keystroke, Object actionMapKey)
Puts a new entry into the InputMap . |
void | remove(KeyStroke keystroke)
Removes an entry from this InputMap . |
void | setParent(InputMap parentMap)
Sets a parent for this InputMap . |
int | size()
Returns the number of entries in this InputMap . |
InputMap
instance. This default instance
contains no mappings and has no parent.InputMap
and all its
parents.
Returns: An array of keys (may be null
or have zero length).
InputMap
. The parent map, if
there is one, is not cleared.Parameters: keystroke the key of the entry (null
is ignored).
Returns: The binding associated with the specified keystroke (or
null
).
InputMap
. The default value
is null
.
Returns: The parent map (possibly null
).
See Also: setParent
InputMap
. This does not
include keys defined in the parent, if there is one (use the
allKeys method for that case).
null
when no entries have been added to the map,
and a zero length array if entries have been added but subsequently
removed (or cleared) from the map.
Returns: An array of keys (may be null
or have zero length).
InputMap
. If
actionMapKey
is null
any existing entry will be
removed.
Parameters: keystroke the keystroke for the entry (null
is
ignored). actionMapKey the action (null
permitted).
InputMap
. Note that this will
not remove any entry from the parent map, if there is one.
Parameters: keystroke the key of the entry to remove (null
is
ignored).
InputMap
. If a parent is specified,
the get method will look in the parent if it cannot
find an entry in this map.
Parameters: parentMap the new parent (null
permitted).
See Also: getParent
InputMap
. This count
does not include any entries from the parent map, if there is one.
Returns: The number of entries.