javax.swing
Class ComponentInputMap

java.lang.Object sample code for java.lang.Object definition code for java.lang.Object 
  extended by javax.swing.InputMap sample code for javax.swing.InputMap definition code for javax.swing.InputMap 
      extended by javax.swing.ComponentInputMap
All Implemented Interfaces:
Serializable sample code for java.io.Serializable definition code for java.io.Serializable
Direct Known Subclasses:
ComponentInputMapUIResource sample code for javax.swing.plaf.ComponentInputMapUIResource definition code for javax.swing.plaf.ComponentInputMapUIResource

public class ComponentInputMap
extends InputMap sample code for javax.swing.InputMap definition code for javax.swing.InputMap

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.

See Also:
Serialized Form

Constructor Summary
ComponentInputMap sample code for javax.swing.ComponentInputMap.ComponentInputMap(javax.swing.JComponent) definition code for javax.swing.ComponentInputMap.ComponentInputMap(javax.swing.JComponent) (JComponent sample code for javax.swing.JComponent definition code for javax.swing.JComponent  component)
          Creates a ComponentInputMap associated with the specified component.
 
Method Summary
 void clear sample code for javax.swing.ComponentInputMap.clear() definition code for javax.swing.ComponentInputMap.clear() ()
          Removes all the mappings from this object.
 JComponent sample code for javax.swing.JComponent definition code for javax.swing.JComponent getComponent sample code for javax.swing.ComponentInputMap.getComponent() definition code for javax.swing.ComponentInputMap.getComponent() ()
          Returns the component the InputMap was created for.
 void put sample code for javax.swing.ComponentInputMap.put(javax.swing.KeyStroke, java.lang.Object) definition code for javax.swing.ComponentInputMap.put(javax.swing.KeyStroke, java.lang.Object) (KeyStroke sample code for javax.swing.KeyStroke definition code for javax.swing.KeyStroke  keyStroke, Object sample code for java.lang.Object definition code for java.lang.Object  actionMapKey)
          Adds a binding for keyStroke to actionMapKey.
 void remove sample code for javax.swing.ComponentInputMap.remove(javax.swing.KeyStroke) definition code for javax.swing.ComponentInputMap.remove(javax.swing.KeyStroke) (KeyStroke sample code for javax.swing.KeyStroke definition code for javax.swing.KeyStroke  key)
          Removes the binding for key from this object.
 void setParent sample code for javax.swing.ComponentInputMap.setParent(javax.swing.InputMap) definition code for javax.swing.ComponentInputMap.setParent(javax.swing.InputMap) (InputMap sample code for javax.swing.InputMap definition code for javax.swing.InputMap  map)
          Sets the parent, which must be a ComponentInputMap associated with the same component as this ComponentInputMap.
 
Methods inherited from class javax.swing.InputMap sample code for javax.swing.InputMap definition code for javax.swing.InputMap
allKeys sample code for javax.swing.InputMap.allKeys() definition code for javax.swing.InputMap.allKeys() , get sample code for javax.swing.InputMap.get(javax.swing.KeyStroke) definition code for javax.swing.InputMap.get(javax.swing.KeyStroke) , getParent sample code for javax.swing.InputMap.getParent() definition code for javax.swing.InputMap.getParent() , keys sample code for javax.swing.InputMap.keys() definition code for javax.swing.InputMap.keys() , size sample code for javax.swing.InputMap.size() definition code for javax.swing.InputMap.size()
 
Methods inherited from class java.lang.Object sample code for java.lang.Object definition code for java.lang.Object
clone sample code for java.lang.Object.clone() definition code for java.lang.Object.clone() , equals sample code for java.lang.Object.equals(java.lang.Object) definition code for java.lang.Object.equals(java.lang.Object) , finalize sample code for java.lang.Object.finalize() definition code for java.lang.Object.finalize() , getClass sample code for java.lang.Object.getClass() definition code for java.lang.Object.getClass() , hashCode sample code for java.lang.Object.hashCode() definition code for java.lang.Object.hashCode() , notify sample code for java.lang.Object.notify() definition code for java.lang.Object.notify() , notifyAll sample code for java.lang.Object.notifyAll() definition code for java.lang.Object.notifyAll() , toString sample code for java.lang.Object.toString() definition code for java.lang.Object.toString() , wait sample code for java.lang.Object.wait() definition code for java.lang.Object.wait() , wait sample code for java.lang.Object.wait(long) definition code for java.lang.Object.wait(long) , wait sample code for java.lang.Object.wait(long, int) definition code for java.lang.Object.wait(long, int)
 

Constructor Detail

ComponentInputMap sample code for javax.swing.ComponentInputMap(javax.swing.JComponent) definition code for javax.swing.ComponentInputMap(javax.swing.JComponent)

public ComponentInputMap(JComponent sample code for javax.swing.JComponent definition code for javax.swing.JComponent  component)
Creates a ComponentInputMap associated with the specified component.

Parameters:
component - a non-null JComponent
Throws:
IllegalArgumentException sample code for java.lang.IllegalArgumentException definition code for java.lang.IllegalArgumentException - if component is null
Method Detail

setParent sample code for javax.swing.ComponentInputMap.setParent(javax.swing.InputMap) definition code for javax.swing.ComponentInputMap.setParent(javax.swing.InputMap)

public void setParent(InputMap sample code for javax.swing.InputMap definition code for javax.swing.InputMap  map)
Sets the parent, which must be a ComponentInputMap associated with the same component as this ComponentInputMap.

Overrides:
setParent sample code for javax.swing.InputMap.setParent(javax.swing.InputMap) definition code for javax.swing.InputMap.setParent(javax.swing.InputMap) in class InputMap sample code for javax.swing.InputMap definition code for javax.swing.InputMap
Parameters:
map - a ComponentInputMap
Throws:
IllegalArgumentException sample code for java.lang.IllegalArgumentException definition code for java.lang.IllegalArgumentException - if map is not a ComponentInputMap or is not associated with the same component

getComponent sample code for javax.swing.ComponentInputMap.getComponent() definition code for javax.swing.ComponentInputMap.getComponent()

public JComponent sample code for javax.swing.JComponent definition code for javax.swing.JComponent  getComponent()
Returns the component the InputMap was created for.


put sample code for javax.swing.ComponentInputMap.put(javax.swing.KeyStroke, java.lang.Object) definition code for javax.swing.ComponentInputMap.put(javax.swing.KeyStroke, java.lang.Object)

public void put(KeyStroke sample code for javax.swing.KeyStroke definition code for javax.swing.KeyStroke  keyStroke,
                Object sample code for java.lang.Object definition code for java.lang.Object  actionMapKey)
Adds a binding for keyStroke to actionMapKey. If actionMapKey is null, this removes the current binding for keyStroke.

Overrides:
put sample code for javax.swing.InputMap.put(javax.swing.KeyStroke, java.lang.Object) definition code for javax.swing.InputMap.put(javax.swing.KeyStroke, java.lang.Object) in class InputMap sample code for javax.swing.InputMap definition code for javax.swing.InputMap

remove sample code for javax.swing.ComponentInputMap.remove(javax.swing.KeyStroke) definition code for javax.swing.ComponentInputMap.remove(javax.swing.KeyStroke)

public void remove(KeyStroke sample code for javax.swing.KeyStroke definition code for javax.swing.KeyStroke  key)
Removes the binding for key from this object.

Overrides:
remove sample code for javax.swing.InputMap.remove(javax.swing.KeyStroke) definition code for javax.swing.InputMap.remove(javax.swing.KeyStroke) in class InputMap sample code for javax.swing.InputMap definition code for javax.swing.InputMap

clear sample code for javax.swing.ComponentInputMap.clear() definition code for javax.swing.ComponentInputMap.clear()

public void clear()
Removes all the mappings from this object.

Overrides:
clear sample code for javax.swing.InputMap.clear() definition code for javax.swing.InputMap.clear() in class InputMap sample code for javax.swing.InputMap definition code for javax.swing.InputMap