Lines Matching defs:AWTKeyStroke

43  * An <code>AWTKeyStroke</code> represents a key action on the
44 * keyboard, or equivalent input device. <code>AWTKeyStroke</code>s
50 * In all cases, <code>AWTKeyStroke</code>s can specify modifiers
56 * <code>AWTKeyStroke</code> on its own, but should instead use
58 * methods allows the <code>AWTKeyStroke</code> implementation
67 public class AWTKeyStroke implements Serializable {
81 private static AWTKeyStroke APP_CONTEXT_KEYSTROKE_KEY = new AWTKeyStroke();
85 * AWTKeyStroke class.
86 * Must be called under locked AWTKeyStroke.class
90 Class clazz = (Class)appContext.get(AWTKeyStroke.class);
92 clazz = AWTKeyStroke.class;
93 appContext.put(AWTKeyStroke.class, AWTKeyStroke.class);
109 * Constructs an <code>AWTKeyStroke</code> with default values.
111 * <table border="1" summary="AWTKeyStroke default values">
131 * <code>AWTKeyStroke</code>s should not be constructed
137 protected AWTKeyStroke() {
141 * Constructs an <code>AWTKeyStroke</code> with the specified
142 * values. <code>AWTKeyStroke</code>s should not be constructed
147 * @param keyCode the key code for this <code>AWTKeyStroke</code>
150 * <code>AWTKeyStroke</code> corresponds
154 protected AWTKeyStroke(char keyChar, int keyCode, int modifiers,
164 * <code>AWTKeyStroke</code> will use when generating new
165 * instances of <code>AWTKeyStroke</code>s. After invoking this
167 * Class. The specified Class must be either <code>AWTKeyStroke</code>
168 * or derived from <code>AWTKeyStroke</code>, and it must have a
171 * flushes the current <code>AWTKeyStroke</code> cache.
178 * <code>AWTKeyStroke</code>, or a class derived from
179 * <code>AWTKeyStroke</code>
186 synchronized (AWTKeyStroke.class) {
187 Class keyStrokeClass = (Class)appContext.get(AWTKeyStroke.class);
193 if (!AWTKeyStroke.class.isAssignableFrom(subclass)) {
194 throw new ClassCastException("subclass is not derived from AWTKeyStroke");
205 AWTKeyStroke stroke = (AWTKeyStroke)ctor.newInstance((Object[]) null);
221 synchronized (AWTKeyStroke.class) {
222 appContext.put(AWTKeyStroke.class, subclass);
251 private static synchronized AWTKeyStroke getCachedStroke
256 AWTKeyStroke cacheKey = (AWTKeyStroke)appContext.get(APP_CONTEXT_KEYSTROKE_KEY);
266 cacheKey = (AWTKeyStroke)getCtor(clazz).newInstance((Object[]) null);
281 AWTKeyStroke stroke = (AWTKeyStroke)cache.get(cacheKey);
291 * Returns a shared instance of an <code>AWTKeyStroke</code>
296 * @return an <code>AWTKeyStroke</code> object for that key
298 public static AWTKeyStroke getAWTKeyStroke(char keyChar) {
303 * Returns a shared instance of an {@code AWTKeyStroke}
333 * @return an <code>AWTKeyStroke</code> object for that key
339 public static AWTKeyStroke getAWTKeyStroke(Character keyChar, int modifiers)
349 * Returns a shared instance of an <code>AWTKeyStroke</code>,
385 * @param onKeyRelease <code>true</code> if the <code>AWTKeyStroke</code>
387 * @return an AWTKeyStroke object for that key
392 public static AWTKeyStroke getAWTKeyStroke(int keyCode, int modifiers,
399 * Returns a shared instance of an <code>AWTKeyStroke</code>,
401 * <code>AWTKeyStroke</code> will correspond to a key press.
432 * @return an <code>AWTKeyStroke</code> object for that key
437 public static AWTKeyStroke getAWTKeyStroke(int keyCode, int modifiers) {
443 * Returns an <code>AWTKeyStroke</code> which represents the
452 * obtain the <code>AWTKeyStroke</code>
454 * @return the <code>AWTKeyStroke</code> that precipitated the event
456 public static AWTKeyStroke getAWTKeyStrokeForEvent(KeyEvent anEvent) {
477 * Parses a string and returns an <code>AWTKeyStroke</code>.
499 * @return an <code>AWTKeyStroke</code> object for that String
503 public static AWTKeyStroke getAWTKeyStroke(String s) {
517 synchronized (AWTKeyStroke.class) {
633 * Returns the character for this <code>AWTKeyStroke</code>.
644 * Returns the numeric key code for this <code>AWTKeyStroke</code>.
655 * Returns the modifier keys for this <code>AWTKeyStroke</code>.
665 * Returns whether this <code>AWTKeyStroke</code> represents a key release.
667 * @return <code>true</code> if this <code>AWTKeyStroke</code>
677 * this <code>AWTKeyStroke</code>.
712 if (anObject instanceof AWTKeyStroke) {
713 AWTKeyStroke ks = (AWTKeyStroke)anObject;
801 * Returns a cached instance of <code>AWTKeyStroke</code> (or a subclass of
802 * <code>AWTKeyStroke</code>) which is equal to this instance.
807 synchronized (AWTKeyStroke.class) {