com.tensegrity.gui.swt.graph
Class KeyStrokeTransformer

java.lang.Object
  extended bycom.tensegrity.gui.swt.graph.KeyStrokeTransformer

public class KeyStrokeTransformer
extends java.lang.Object

This class provides methods which aim to ensure that SWT key events are correctly understood and processed by the framework.

This class is not intended to be instanciated and only provides public static methods.

Version:
$Id: KeyStrokeTransformer.java,v 1.10 2005/07/28 13:29:16 SebastienGuyon Exp $
Author:
S�bastien Guyon
See Also:
KeyEvent

Method Summary
static KeyStroke getKeyStroke(char keyChar, int keyCode, int modifiers)
           This method is used in order to return a KeyStroke given a keyChar, keyCode, and modifiers of a "SWT" keystroke.
static KeyStroke getKeyStroke(char keyChar, int keyCode, int modifiers, boolean onKeyRelease)
           This method is used in order to return a KeyStroke given a keyChar, keyCode, and modifiers of a "SWT" keystroke.
static KeyStroke getKeyStroke(org.eclipse.swt.events.KeyEvent e)
           This method is used in order to return a KeyStroke given the keyChar, keyCode, and modifiers of the passed "SWT" key event.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getKeyStroke

public static KeyStroke getKeyStroke(char keyChar,
                                     int keyCode,
                                     int modifiers)

This method is used in order to return a KeyStroke given a keyChar, keyCode, and modifiers of a "SWT" keystroke. Simply forwards its call to getKeyStroke(char, int, int, boolean) with false as last parameter.

Parameters:
keyChar - the char of the key.
keyCode - an int specifying the numeric code for a key.
modifiers - an int specifying any combination of the key modifiers.
Returns:
a windowing toolkit independant KeyStroke as understood by the framework.
See Also:
getKeyStroke(char, int, int, boolean)

getKeyStroke

public static KeyStroke getKeyStroke(org.eclipse.swt.events.KeyEvent e)

This method is used in order to return a KeyStroke given the keyChar, keyCode, and modifiers of the passed "SWT" key event. Simply forwards its call to getKeyStroke(char, int, int).

Parameters:
e - a SWT key event.
Returns:
a windowing toolkit independant KeyStroke as understood by the framework.
See Also:
getKeyStroke(char, int, int, boolean)

getKeyStroke

public static KeyStroke getKeyStroke(char keyChar,
                                     int keyCode,
                                     int modifiers,
                                     boolean onKeyRelease)

This method is used in order to return a KeyStroke given a keyChar, keyCode, and modifiers of a "SWT" keystroke.

Parameters:
keyChar - the char of the key.
keyCode - an int specifying the numeric code for a key.
modifiers - an int specifying any combination of the key modifiers.
onKeyRelease - A flag specifying whether this keystroke should trigger an action on pressed or released event
Returns:
a windowing toolkit independant KeyStroke as understood by the framework.


Copyright © 2005 Tensegrity Software GmbH. All Rights Reserved. Date of creation: 09.06.2006.