org.openbp.jaspira.action.keys
Class KeyMgr.MultiInputMap

java.lang.Object
  extended by javax.swing.InputMap
      extended by javax.swing.ComponentInputMap
          extended by org.openbp.jaspira.action.keys.KeyMgr.MultiInputMap
All Implemented Interfaces:
java.io.Serializable
Enclosing class:
KeyMgr

public class KeyMgr.MultiInputMap
extends javax.swing.ComponentInputMap

Input Map that supports two different parent map. Allows one parent map to be shared between components. Adding and removal of entries is delegated to the true parent.

See Also:
Serialized Form

Constructor Summary
KeyMgr.MultiInputMap(javax.swing.JComponent component)
          Creates a new MultiInputMap to a given component and shared parentmap.
 
Method Summary
 javax.swing.KeyStroke[] allKeys()
          Returns an array of the KeyStrokes defined in this InputMap and its parent.
 void clear()
           
 java.lang.Object get(javax.swing.KeyStroke keyStroke)
          Returns the binding for given key, messaging the parent InputMap if the binding is not locally defined.
 javax.swing.JComponent getComponent()
           
 javax.swing.InputMap getParent()
           
 javax.swing.KeyStroke[] keys()
           
 void put(javax.swing.KeyStroke keyStroke, java.lang.Object actionMapKey)
           
 void remove(javax.swing.KeyStroke key)
           
 void setParent(javax.swing.InputMap map)
           
 int size()
           
 void uninstall()
          Uninstalls the multi inout map from the given component and restores the old input map.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

KeyMgr.MultiInputMap

public KeyMgr.MultiInputMap(javax.swing.JComponent component)
Creates a new MultiInputMap to a given component and shared parentmap.

Parameters:
component - Component the map should belong to
Method Detail

uninstall

public void uninstall()
Uninstalls the multi inout map from the given component and restores the old input map. Does nothing if the component has not been assigned a multi input map.


get

public java.lang.Object get(javax.swing.KeyStroke keyStroke)
Returns the binding for given key, messaging the parent InputMap if the binding is not locally defined.

Overrides:
get in class javax.swing.InputMap
Parameters:
keyStroke - Key to get the binding for
Returns:
The binding or null if no binding exists for this key

allKeys

public javax.swing.KeyStroke[] allKeys()
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.

Overrides:
allKeys in class javax.swing.InputMap

clear

public void clear()
Overrides:
clear in class javax.swing.ComponentInputMap
See Also:
ComponentInputMap.clear()

getComponent

public javax.swing.JComponent getComponent()
Overrides:
getComponent in class javax.swing.ComponentInputMap
See Also:
ComponentInputMap.getComponent()

getParent

public javax.swing.InputMap getParent()
Overrides:
getParent in class javax.swing.InputMap
See Also:
InputMap.getParent()

keys

public javax.swing.KeyStroke[] keys()
Overrides:
keys in class javax.swing.InputMap
See Also:
InputMap.keys()

put

public void put(javax.swing.KeyStroke keyStroke,
                java.lang.Object actionMapKey)
Overrides:
put in class javax.swing.ComponentInputMap
See Also:
ComponentInputMap.put(javax.swing.KeyStroke, java.lang.Object)

remove

public void remove(javax.swing.KeyStroke key)
Overrides:
remove in class javax.swing.ComponentInputMap
See Also:
ComponentInputMap.remove(javax.swing.KeyStroke)

setParent

public void setParent(javax.swing.InputMap map)
Overrides:
setParent in class javax.swing.ComponentInputMap
See Also:
ComponentInputMap.setParent(javax.swing.InputMap)

size

public int size()
Overrides:
size in class javax.swing.InputMap
See Also:
InputMap.size()


Copyright © 2011. All Rights Reserved.