< prev index next >

src/share/classes/sun/awt/AWTAccessor.java

Print this page
rev 1556 : 6794764: Translucent windows are completely repainted on every paint event, on Windows
6719382: Printing of AWT components on windows is not working
6726866: Repainting artifacts when resizing or dragging JInternalFrames in non-opaque toplevel
6683775: Painting artifacts is seen when panel is made setOpaque(false) for a translucent window
Reviewed-by: anthony, tdv, alexp
rev 1566 : 6680988: KeyEvent is still missing VK values for many keyboards
Summary: 2 new methods and some fields added to KeyEvent, plus hash of constants introduced
Reviewed-by: art

@@ -87,11 +87,11 @@
          */
         void setOpaque(Window window, boolean isOpaque);
         /*
          * Update the image of a non-opaque (translucent) window.
          */
-        void updateWindow(Window window, BufferedImage backBuffer);
+        void updateWindow(Window window);
         /**
          * Sets the synchronous status of focus requests on lightweight
          * components in the specified window to the specified value.
          */
         void setLWRequestStatus(Window changed, boolean status);

@@ -401,10 +401,40 @@
          */
         Vector getItems(Menu menu);
     }
 
     /**
+     * An accessor for the KeyEvent class
+     */
+    public interface KeyEventAccessor {
+        /**
+         * Sets rawCode field for KeyEvent
+         */
+        void setRawCode(KeyEvent ev, long rawCode);
+
+        /**
+         * Sets primaryLevelUnicode field for KeyEvent
+         */
+        void setPrimaryLevelUnicode(KeyEvent ev, long primaryLevelUnicode);
+
+        /**
+         * Sets extendedKeyCode field for KeyEvent
+         */
+        void setExtendedKeyCode(KeyEvent ev, long extendedKeyCode);
+
+        /**
+         * Returns an extended key code for the event.
+         */
+        int getExtendedKeyCode(KeyEvent ev);
+
+        /**
+         * Returns an extended key code for a unicode character.
+         */
+        int getExtendedKeyCodeForChar(int c);
+    }
+
+    /**
      * An accessor for the ClientPropertyKey class
      */
     public interface ClientPropertyKeyAccessor {
         /**
          * Retrieves JComponent_TRANSFER_HANDLER enum object

@@ -443,10 +473,11 @@
     private static CheckboxMenuItemAccessor checkboxMenuItemAccessor;
     private static CursorAccessor cursorAccessor;
     private static MenuBarAccessor menuBarAccessor;
     private static MenuItemAccessor menuItemAccessor;
     private static MenuAccessor menuAccessor;
+    private static KeyEventAccessor keyEventAccessor;
     private static ClientPropertyKeyAccessor clientPropertyKeyAccessor;
     private static DefaultKeyboardFocusManagerAccessor defaultKeyboardFocusManagerAccessor;
 
     /**
      * Set an accessor object for the java.awt.Window class.

@@ -672,10 +703,27 @@
         }
         return menuAccessor;
     }
 
     /**
+     * Set an accessor object for the java.awt.event.KeyEvent class.
+     */
+    public static void setKeyEventAccessor(KeyEventAccessor kea) {
+        keyEventAccessor = kea;
+    }
+
+    /**
+     * Retrieve the accessor object for the java.awt.event.KeyEvent class.
+     */
+    public static KeyEventAccessor getKeyEventAccessor() {
+        if (keyEventAccessor == null) {
+            unsafe.ensureClassInitialized(KeyEventAccessor.class);
+        }
+        return keyEventAccessor;
+    }
+
+    /**
      * Set an accessor object for the javax.swing.ClientPropertyKey class.
      */
     public static void setClientPropertyKeyAccessor(ClientPropertyKeyAccessor cpka) {
         clientPropertyKeyAccessor = cpka;
     }
< prev index next >