Back to index

im-sdk  12.3.91
Public Member Functions | Static Package Functions | Static Package Attributes | Private Member Functions | Private Attributes
sun.awt.im.iiimp.IIIMKeyEvent Class Reference

This class hold one key characterristic from string representation like Control+Shift+a, Alt+Tab. More...

Collaboration diagram for sun.awt.im.iiimp.IIIMKeyEvent:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 IIIMKeyEvent (String keyString)
boolean match (KeyEvent ke)
int getKeyCode ()
char getKeyChar ()
long getWhen ()
String toString ()
 IIIMKeyEvent (String keyString)
boolean match (KeyEvent ke)
int getKeyCode ()
char getKeyChar ()
long getWhen ()
String toString ()

Static Package Functions

 [static initializer]
 [static initializer]

Static Package Attributes

static Hashtable modifierTable = null
static Hashtable keyTable = null

Private Member Functions

int getModifier (String mod)
void setCharCode (String key)
int getModifier (String mod)
void setCharCode (String key)

Private Attributes

int keyCode = KeyEvent.VK_UNDEFINED
char keyChar = KeyEvent.CHAR_UNDEFINED
int modifier = 0
long when = 0
String keyString = null
boolean triggerPress = false

Detailed Description

This class hold one key characterristic from string representation like Control+Shift+a, Alt+Tab.

Definition at line 56 of file IIIMKeyEvent.java.


Constructor & Destructor Documentation

sun.awt.im.iiimp.IIIMKeyEvent.IIIMKeyEvent ( String  keyString) [inline]

Definition at line 64 of file IIIMKeyEvent.java.

                                          {
       super(KEY);
       this.keyString = keyString;
       // parse key representaion string
       // modifir+...+keyrepresentation 
       StringTokenizer st = new StringTokenizer(keyString, "+");
       String lastToken = null;
       while(st.hasMoreTokens()) {
           String token = st.nextToken();
           modifier |= getModifier(token);
           lastToken = token;
       }
       setCharCode(lastToken);
    }

Here is the call graph for this function:

sun.awt.im.iiimp.IIIMKeyEvent.IIIMKeyEvent ( String  keyString) [inline]

Definition at line 64 of file IIIMKeyEvent.java.

                                          {
       super(KEY);
       this.keyString = keyString;
       // parse key representaion string
       // modifir+...+keyrepresentation 
       StringTokenizer st = new StringTokenizer(keyString, "+");
       String lastToken = null;
       while(st.hasMoreTokens()) {
           String token = st.nextToken();
           modifier |= getModifier(token);
           lastToken = token;
       }
       setCharCode(lastToken);
    }

Here is the call graph for this function:


Member Function Documentation

sun.awt.im.iiimp.IIIMKeyEvent.[static initializer] ( ) [inline, static, package]
sun.awt.im.iiimp.IIIMKeyEvent.[static initializer] ( ) [inline, static, package]

Definition at line 108 of file IIIMKeyEvent.java.

                             {
       return keyChar;
    }

Definition at line 108 of file IIIMKeyEvent.java.

                             {
       return keyChar;
    }

Definition at line 104 of file IIIMKeyEvent.java.

                            {
       return keyCode;
    }

Definition at line 104 of file IIIMKeyEvent.java.

                            {
       return keyCode;
    }
int sun.awt.im.iiimp.IIIMKeyEvent.getModifier ( String  mod) [inline, private]

Definition at line 120 of file IIIMKeyEvent.java.

                                        {
       Integer i = (Integer)modifierTable.get(mod.toLowerCase());
       if (i == null) {
           return 0;
       }
       return i.intValue();
    }

Here is the caller graph for this function:

int sun.awt.im.iiimp.IIIMKeyEvent.getModifier ( String  mod) [inline, private]

Definition at line 120 of file IIIMKeyEvent.java.

                                        {
       Integer i = (Integer)modifierTable.get(mod.toLowerCase());
       if (i == null) {
           return 0;
       }
       return i.intValue();
    }

Definition at line 112 of file IIIMKeyEvent.java.

                          {
       return when;
    }

Definition at line 112 of file IIIMKeyEvent.java.

                          {
       return when;
    }
boolean sun.awt.im.iiimp.IIIMKeyEvent.match ( KeyEvent  ke) [inline]

Definition at line 81 of file IIIMKeyEvent.java.

                                      {
       int id = ke.getID();
       switch(id) {
         case KeyEvent.KEY_PRESSED:
           if (keyCode == ke.getKeyCode() && ke.getModifiers() == modifier) {
              triggerPress = true;
              return true;
           }
           break;
         case KeyEvent.KEY_TYPED:
           if (triggerPress) {
              return true;
           }
           break;
         case KeyEvent.KEY_RELEASED:
           if (keyCode == ke.getKeyCode() && triggerPress) {
              triggerPress = false;
              return true;
           }
       }
       return false;
    }
boolean sun.awt.im.iiimp.IIIMKeyEvent.match ( KeyEvent  ke) [inline]

Definition at line 81 of file IIIMKeyEvent.java.

                                      {
       int id = ke.getID();
       switch(id) {
         case KeyEvent.KEY_PRESSED:
           if (keyCode == ke.getKeyCode() && ke.getModifiers() == modifier) {
              triggerPress = true;
              return true;
           }
           break;
         case KeyEvent.KEY_TYPED:
           if (triggerPress) {
              return true;
           }
           break;
         case KeyEvent.KEY_RELEASED:
           if (keyCode == ke.getKeyCode() && triggerPress) {
              triggerPress = false;
              return true;
           }
       }
       return false;
    }
void sun.awt.im.iiimp.IIIMKeyEvent.setCharCode ( String  key) [inline, private]

Definition at line 128 of file IIIMKeyEvent.java.

                                         {
       if (key == null || key.length() == 0) {
           return;
       }
       if (key.length() > 1) {
           // this is KeyCode string representation
           Integer I = (Integer)keyTable.get(key.toUpperCase());
           if (I != null) {
              keyCode = I.intValue();
           }
           // need to check UTF-16
       } else {
           // length == 1
           keyChar = key.charAt(0);
       }
    }

Here is the caller graph for this function:

void sun.awt.im.iiimp.IIIMKeyEvent.setCharCode ( String  key) [inline, private]

Definition at line 128 of file IIIMKeyEvent.java.

                                         {
       if (key == null || key.length() == 0) {
           return;
       }
       if (key.length() > 1) {
           // this is KeyCode string representation
           Integer I = (Integer)keyTable.get(key.toUpperCase());
           if (I != null) {
              keyCode = I.intValue();
           }
           // need to check UTF-16
       } else {
           // length == 1
           keyChar = key.charAt(0);
       }
    }

Definition at line 116 of file IIIMKeyEvent.java.

                             {
       return keyString;
    }

Definition at line 116 of file IIIMKeyEvent.java.

                             {
       return keyString;
    }

Member Data Documentation

char sun.awt.im.iiimp.IIIMKeyEvent.keyChar = KeyEvent.CHAR_UNDEFINED [private]

Definition at line 59 of file IIIMKeyEvent.java.

int sun.awt.im.iiimp.IIIMKeyEvent.keyCode = KeyEvent.VK_UNDEFINED [private]

Definition at line 58 of file IIIMKeyEvent.java.

String sun.awt.im.iiimp.IIIMKeyEvent.keyString = null [private]

Definition at line 62 of file IIIMKeyEvent.java.

static Hashtable sun.awt.im.iiimp.IIIMKeyEvent.keyTable = null [static, package]

Definition at line 146 of file IIIMKeyEvent.java.

Definition at line 60 of file IIIMKeyEvent.java.

static Hashtable sun.awt.im.iiimp.IIIMKeyEvent.modifierTable = null [static, package]

Definition at line 145 of file IIIMKeyEvent.java.

boolean sun.awt.im.iiimp.IIIMKeyEvent.triggerPress = false [private]

Definition at line 79 of file IIIMKeyEvent.java.

Definition at line 61 of file IIIMKeyEvent.java.


The documentation for this class was generated from the following files: