Lines Matching refs:KeyStroke

31  * A KeyStroke represents a key action on the keyboard, or equivalent input
45 * create a KeyStroke; a variant of <code>getKeyStroke</code> must be used
46 * instead. These factory methods allow the KeyStroke implementation to cache
64 public class KeyStroke extends AWTKeyStroke {
71 private KeyStroke() {
73 private KeyStroke(char keyChar, int keyCode, int modifiers,
79 * Returns a shared instance of a <code>KeyStroke</code>
84 * @return a KeyStroke object for that key
86 public static KeyStroke getKeyStroke(char keyChar) {
88 registerSubclass(KeyStroke.class);
89 return (KeyStroke)getAWTKeyStroke(keyChar);
94 * Returns an instance of a KeyStroke, specifying whether the key is
100 * @param onKeyRelease <code>true</code> if this KeyStroke corresponds to a
102 * @return a KeyStroke object for that key
106 public static KeyStroke getKeyStroke(char keyChar, boolean onKeyRelease) {
107 return new KeyStroke(keyChar, KeyEvent.VK_UNDEFINED, 0, onKeyRelease);
111 * Returns a shared instance of a {@code KeyStroke}
141 * @return an KeyStroke object for that key
147 public static KeyStroke getKeyStroke(Character keyChar, int modifiers) {
149 registerSubclass(KeyStroke.class);
150 return (KeyStroke)getAWTKeyStroke(keyChar, modifiers);
155 * Returns a shared instance of a KeyStroke, given a numeric key code and a
190 * @param onKeyRelease <code>true</code> if the KeyStroke should represent
192 * @return a KeyStroke object for that key
197 public static KeyStroke getKeyStroke(int keyCode, int modifiers,
200 registerSubclass(KeyStroke.class);
201 return (KeyStroke)getAWTKeyStroke(keyCode, modifiers,
207 * Returns a shared instance of a KeyStroke, given a numeric key code and a
208 * set of modifiers. The returned KeyStroke will correspond to a key press.
241 * @return a KeyStroke object for that key
246 public static KeyStroke getKeyStroke(int keyCode, int modifiers) {
248 registerSubclass(KeyStroke.class);
249 return (KeyStroke)getAWTKeyStroke(keyCode, modifiers);
254 * Returns a KeyStroke which represents the stroke which generated a given
261 * @param anEvent the KeyEvent from which to obtain the KeyStroke
263 * @return the KeyStroke that precipitated the event
265 public static KeyStroke getKeyStrokeForEvent(KeyEvent anEvent) {
267 registerSubclass(KeyStroke.class);
268 return (KeyStroke)getAWTKeyStrokeForEvent(anEvent);
273 * Parses a string and returns a <code>KeyStroke</code>.
298 * @return a KeyStroke object for that String, or null if the specified
303 public static KeyStroke getKeyStroke(String s) {
308 registerSubclass(KeyStroke.class);
310 return (KeyStroke)getAWTKeyStroke(s);