APIdia Launch Partner
Top Description Fields Constructors Methods
javax.swing

public Class ComponentInputMap

extends InputMap
Class Inheritance
Known Direct Subclasses
javax.swing.plaf.ComponentInputMapUIResource
Annotations
@SuppressWarnings:serial

A ComponentInputMap is an InputMap associated with a particular JComponent. The component is automatically notified whenever the ComponentInputMap changes. ComponentInputMaps are used for WHEN_IN_FOCUSED_WINDOW bindings.
Author
Scott Violet
Since
1.3

Field Summary

Modifier and TypeField and Description
private JComponent
component

Component binding is created for.

Constructor Summary

AccessConstructor and Description
public
ComponentInputMap(JComponent
a non-null JComponent
component
)

Creates a ComponentInputMap associated with the specified component.

Method Summary

Modifier and TypeMethod and Description
public void
clear()

Overrides javax.swing.InputMap.clear.

Removes all the mappings from this object.

public JComponent

Returns:

the component the InputMap was created for.
getComponent
()

Returns the component the InputMap was created for.

public void
put(KeyStroke keyStroke, Object actionMapKey)

Overrides javax.swing.InputMap.put.

Adds a binding for keyStroke to actionMapKey.

public void
remove(KeyStroke key)

Overrides javax.swing.InputMap.remove.

Removes the binding for key from this object.

public void
setParent(InputMap
a ComponentInputMap
map
)

Overrides javax.swing.InputMap.setParent.

Sets the parent, which must be a ComponentInputMap associated with the same component as this ComponentInputMap.

Inherited from javax.swing.InputMap:
allKeysgetgetParentkeyssize

Field Detail

componentback to summary
private JComponent component

Component binding is created for.

Constructor Detail

ComponentInputMapback to summary
public ComponentInputMap(JComponent component)

Creates a ComponentInputMap associated with the specified component.

Parameters
component:JComponent

a non-null JComponent

Exceptions
IllegalArgumentException:
if component is null

Method Detail

clearback to summary
public void clear()

Overrides javax.swing.InputMap.clear.

Removes all the mappings from this object.

getComponentback to summary
public JComponent getComponent()

Returns the component the InputMap was created for.

Returns:JComponent

the component the InputMap was created for.

putback to summary
public void put(KeyStroke keyStroke, Object actionMapKey)

Overrides javax.swing.InputMap.put.

Adds a binding for keyStroke to actionMapKey. If actionMapKey is null, this removes the current binding for keyStroke.

removeback to summary
public void remove(KeyStroke key)

Overrides javax.swing.InputMap.remove.

Removes the binding for key from this object.

setParentback to summary
public void setParent(InputMap map)

Overrides javax.swing.InputMap.setParent.

Sets the parent, which must be a ComponentInputMap associated with the same component as this ComponentInputMap.

Parameters
map:InputMap

a ComponentInputMap

Exceptions
IllegalArgumentException:
if map is not a ComponentInputMap or is not associated with the same component