< prev index next >

src/java.desktop/share/classes/java/awt/AWTKeyStroke.java

Print this page

        

@@ -348,10 +348,11 @@
      * @param anEvent the {@code KeyEvent} from which to
      *      obtain the {@code AWTKeyStroke}
      * @throws NullPointerException if {@code anEvent} is null
      * @return the {@code AWTKeyStroke} that precipitated the event
      */
+    @SuppressWarnings("deprecation")
     public static AWTKeyStroke getAWTKeyStrokeForEvent(KeyEvent anEvent) {
         int id = anEvent.getID();
         switch(id) {
           case KeyEvent.KEY_PRESSED:
           case KeyEvent.KEY_RELEASED:

@@ -395,10 +396,11 @@
      * @param s a String formatted as described above
      * @return an {@code AWTKeyStroke} object for that String
      * @throws IllegalArgumentException if {@code s} is {@code null},
      *        or is formatted incorrectly
      */
+    @SuppressWarnings("deprecation")
     public static AWTKeyStroke getAWTKeyStroke(String s) {
         if (s == null) {
             throw new IllegalArgumentException("String cannot be null");
         }
 

@@ -706,10 +708,11 @@
 
             return getCachedStroke(keyChar, keyCode, modifiers, onKeyRelease);
         }
     }
 
+    @SuppressWarnings("deprecation")
     private static int mapOldModifiers(int modifiers) {
         if ((modifiers & InputEvent.SHIFT_MASK) != 0) {
             modifiers |= InputEvent.SHIFT_DOWN_MASK;
         }
         if ((modifiers & InputEvent.ALT_MASK) != 0) {

@@ -735,10 +738,11 @@
             | InputEvent.BUTTON3_DOWN_MASK;
 
         return modifiers;
     }
 
+    @SuppressWarnings("deprecation")
     private static int mapNewModifiers(int modifiers) {
         if ((modifiers & InputEvent.SHIFT_DOWN_MASK) != 0) {
             modifiers |= InputEvent.SHIFT_MASK;
         }
         if ((modifiers & InputEvent.ALT_DOWN_MASK) != 0) {
< prev index next >