Package org.apache.batik.gvt.event
Class GraphicsNodeKeyEvent
java.lang.Object
java.util.EventObject
org.apache.batik.gvt.event.GraphicsNodeEvent
org.apache.batik.gvt.event.GraphicsNodeInputEvent
org.apache.batik.gvt.event.GraphicsNodeKeyEvent
- All Implemented Interfaces:
Serializable
An event which indicates that a keystroke occurred in a graphics node.
- Version:
- $Id: GraphicsNodeKeyEvent.java 1733416 2016-03-03 07:07:13Z gadams $
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescription(package private) static final int
static final int
The "key pressed" event.static final int
The "key released" event.static final int
The "key typed" event.protected char
keyChar
is a valid unicode character that is fired by a key or a key combination on a keyboard.protected int
The unique value assigned to each of the keys on the keyboard.protected int
The key location.Fields inherited from class org.apache.batik.gvt.event.GraphicsNodeInputEvent
ALT_GRAPH_MASK, ALT_MASK, BUTTON1_MASK, BUTTON2_MASK, BUTTON3_MASK, CAPS_LOCK_MASK, CTRL_MASK, KANA_LOCK_MASK, lockState, META_MASK, modifiers, NUM_LOCK_MASK, SCROLL_LOCK_MASK, SHIFT_MASK, when
Fields inherited from class org.apache.batik.gvt.event.GraphicsNodeEvent
id
Fields inherited from class java.util.EventObject
source
-
Constructor Summary
ConstructorsConstructorDescriptionGraphicsNodeKeyEvent
(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
Modifier and TypeMethodDescriptionchar
Return a character corresponding to physical key pressed.int
Return the integer code for the physical key pressed.int
Returns the key location.Methods inherited from class org.apache.batik.gvt.event.GraphicsNodeInputEvent
getLockState, getModifiers, getWhen, isAltDown, isAltGraphDown, isControlDown, isMetaDown, isShiftDown
Methods inherited from class org.apache.batik.gvt.event.GraphicsNodeEvent
consume, getGraphicsNode, getID, isConsumed
Methods inherited from class java.util.EventObject
getSource, toString
-
Field Details
-
KEY_FIRST
static final int KEY_FIRST- See Also:
-
KEY_TYPED
public static final int KEY_TYPEDThe "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.- See Also:
-
KEY_PRESSED
public static final int KEY_PRESSEDThe "key pressed" event. This event is generated when a key is pushed down.- See Also:
-
KEY_RELEASED
public static final int KEY_RELEASEDThe "key released" event. This event is generated when a key is let up.- See Also:
-
keyCode
protected int keyCodeThe 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. -
keyChar
protected char keyCharkeyChar
is a valid unicode character that is fired by a key or a key combination on a keyboard. -
keyLocation
protected int keyLocationThe key location.
-
-
Constructor Details
-
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 originatedid
- the id of this eventwhen
- the time the event occurredmodifiers
- the modifier keys down while event occurredlockState
- bitmask indicating which key locks were activatedkeyCode
- the Java key codekeyChar
- the generated characterkeyLocation
- the location of the key
-
-
Method Details
-
getKeyCode
public int getKeyCode()Return the integer code for the physical key pressed. Not localized. -
getKeyChar
public char getKeyChar()Return a character corresponding to physical key pressed. May be localized. -
getKeyLocation
public int getKeyLocation()Returns the key location.
-