1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package net.sourceforge.jivalo.editor.key;
17
18 import java.awt.event.KeyEvent;
19
20 /**
21 * @author <a href="mailto:ivalo@iki.fi">Markku Saarela</a>
22 *
23 */
24 public class KeyCode
25 {
26
27 /**
28 * Name of key.
29 * @see java.awt.event.KeyEvent
30 */
31 private String name;
32
33 /**
34 * Key code value.
35 * @see java.awt.event.KeyEvent
36 */
37 private int keyCode;
38
39 /**
40 * @param name javax.swing.text.DefaultEditorKit static field name
41 * @param action javax.swing.text.DefaultEditorKit static field value
42 */
43 public KeyCode( String name, int keyCode )
44 {
45 super();
46 this.name = name;
47 this.keyCode = keyCode;
48
49 }
50
51 /**
52 * @return the name
53 */
54 public String getName()
55 {
56 return this.name;
57 }
58
59 /**
60 * @return the keyCode
61 */
62 public int getKeyCode()
63 {
64 return this.keyCode;
65 }
66
67 /**
68 * @see java.lang.Object#toString()
69 */
70 public String toString()
71 {
72 return KeyEvent.getKeyText( this.keyCode );
73
74 }
75
76
77
78 }