com.jmex.bui.text
Class BKeyMap

java.lang.Object
  extended by com.jmex.bui.text.BKeyMap
Direct Known Subclasses:
DefaultKeyMap

public class BKeyMap
extends Object

Maps key presses with specific modifier combinations to editor commands. These are used by the text-entry components.


Nested Class Summary
protected static class BKeyMap.Mapping
          Contains information about a single key mapping.
 
Field Summary
protected  BKeyMap.Mapping[] _mappings
          Contains a primitive hashmap of mappings.
static int ANY_MODIFIER
          A modifiers code that if specified, will default any keyCode to the specified command unless a specific modifier mapping is set.
protected static int BUCKETS
          The number of mapping buckets we maintain.
static int NO_MAPPING
          A command constant indicating no mapping exists for a particular modifier and key code combination.
 
Constructor Summary
BKeyMap()
           
 
Method Summary
 void addMapping(int modifiers, int keyCode, int command)
          Adds a mapping for the specified modifier and key code combination to the specified command.
 int lookupMapping(int modifiers, int keyCode)
          Looks up and returns the command associated with the specified set of modifiers and key code.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

NO_MAPPING

public static final int NO_MAPPING
A command constant indicating no mapping exists for a particular modifier and key code combination.

See Also:
Constant Field Values

ANY_MODIFIER

public static final int ANY_MODIFIER
A modifiers code that if specified, will default any keyCode to the specified command unless a specific modifier mapping is set.

See Also:
Constant Field Values

_mappings

protected BKeyMap.Mapping[] _mappings
Contains a primitive hashmap of mappings.


BUCKETS

protected static final int BUCKETS
The number of mapping buckets we maintain.

See Also:
Constant Field Values
Constructor Detail

BKeyMap

public BKeyMap()
Method Detail

addMapping

public void addMapping(int modifiers,
                       int keyCode,
                       int command)
Adds a mapping for the specified modifier and key code combination to the specified command.


lookupMapping

public int lookupMapping(int modifiers,
                         int keyCode)
Looks up and returns the command associated with the specified set of modifiers and key code. Returns NO_MAPPING if no matching mapping can be found.



Copyright © 2008 Michael Bayne. All Rights Reserved.