org.apache.batik.gvt.event

Class GraphicsNodeKeyEvent

public class GraphicsNodeKeyEvent extends GraphicsNodeInputEvent

An event which indicates that a keystroke occurred in a graphics node.
Field Summary
protected charkeyChar
keyChar is a valid unicode character that is fired by a key or a key combination on a keyboard.
protected intkeyCode
The unique value assigned to each of the keys on the keyboard.
protected intkeyLocation
The key location.
static intKEY_PRESSED
The "key pressed" event.
static intKEY_RELEASED
The "key released" event.
static intKEY_TYPED
The "key typed" event.
Constructor Summary
GraphicsNodeKeyEvent(GraphicsNode source, int id, long when, int modifiers, int lockState, int keyCode, char keyChar, int keyLocation)
Constructs a new graphics node key event.
Method Summary
chargetKeyChar()
Return a character corresponding to physical key pressed.
intgetKeyCode()
Return the integer code for the physical key pressed.
intgetKeyLocation()
Returns the key location.

Field Detail

keyChar

protected char keyChar
keyChar is a valid unicode character that is fired by a key or a key combination on a keyboard.

keyCode

protected int keyCode
The unique value assigned to each of the keys on the keyboard. There is a common set of key codes that can be fired by most keyboards. The symbolic name for a key code should be used rather than the code value itself.

keyLocation

protected int keyLocation
The key location.

KEY_PRESSED

public static final int KEY_PRESSED
The "key pressed" event. This event is generated when a key is pushed down.

KEY_RELEASED

public static final int KEY_RELEASED
The "key released" event. This event is generated when a key is let up.

KEY_TYPED

public static final int KEY_TYPED
The "key typed" event. This event is generated when a character is entered. In the simplest case, it is produced by a single key press. Often, however, characters are produced by series of key presses, and the mapping from key pressed events to key typed events may be many-to-one or many-to-many.

Constructor Detail

GraphicsNodeKeyEvent

public GraphicsNodeKeyEvent(GraphicsNode source, int id, long when, int modifiers, int lockState, int keyCode, char keyChar, int keyLocation)
Constructs a new graphics node key event.

Parameters: source the graphics node where the event originated id the id of this event when the time the event occurred modifiers the modifier keys down while event occurred lockState bitmask indicating which key locks were activated keyCode the Java key code keyChar the generated character keyLocation the location of the key

Method Detail

getKeyChar

public char getKeyChar()
Return a character corresponding to physical key pressed. May be localized.

getKeyCode

public int getKeyCode()
Return the integer code for the physical key pressed. Not localized.

getKeyLocation

public int getKeyLocation()
Returns the key location.
Copyright B) 2008 Apache Software Foundation. All Rights Reserved.