< 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


  72         /*
  73          * Get a shape assigned to the given window.
  74          */
  75         Shape getShape(Window window);
  76         /*
  77          * Set a shape to the given window.
  78          */
  79         void setShape(Window window, Shape shape);
  80         /*
  81          * Identify whether the given window is opaque (true)
  82          *  or translucent (false).
  83          */
  84         boolean isOpaque(Window window);
  85         /*
  86          * Set the opaque preoperty to the given window.
  87          */
  88         void setOpaque(Window window, boolean isOpaque);
  89         /*
  90          * Update the image of a non-opaque (translucent) window.
  91          */
  92         void updateWindow(Window window, BufferedImage backBuffer);
  93         /**
  94          * Sets the synchronous status of focus requests on lightweight
  95          * components in the specified window to the specified value.
  96          */
  97         void setLWRequestStatus(Window changed, boolean status);
  98 
  99         /** Get the size of the security warning.
 100          */
 101         Dimension getSecurityWarningSize(Window w);
 102 
 103         /**
 104          * Set the size of the security warning.
 105          */
 106         void setSecurityWarningSize(Window w, int width, int height);
 107 
 108         /** Set the position of the security warning.
 109          */
 110         void setSecurityWarningPosition(Window w, Point2D point,
 111                 float alignmentX, float alignmentY);
 112 


 386          */
 387         String getLabel(MenuItem item);
 388 
 389         /**
 390          * Returns shortcut
 391          */
 392         MenuShortcut getShortcut(MenuItem item);
 393     }
 394 
 395     /**
 396      * An accessor for the Menu class
 397      */
 398     public interface MenuAccessor {
 399         /**
 400          * Returns vector of the items that are part of the Menu
 401          */
 402         Vector getItems(Menu menu);
 403     }
 404 
 405     /**






























 406      * An accessor for the ClientPropertyKey class
 407      */
 408     public interface ClientPropertyKeyAccessor {
 409         /**
 410          * Retrieves JComponent_TRANSFER_HANDLER enum object
 411          */
 412         Object getJComponent_TRANSFER_HANDLER();
 413     }
 414 
 415     /**
 416      * An accessor for the DefaultKeyboardFocusManager class
 417      */
 418     public interface DefaultKeyboardFocusManagerAccessor {
 419         void consumeNextKeyTyped(DefaultKeyboardFocusManager dkfm, KeyEvent e);
 420     }
 421 
 422     /*
 423      * Accessor instances are initialized in the static initializers of
 424      * corresponding AWT classes by using setters defined below.
 425      */


 428     private static ComponentAccessor componentAccessor;
 429     private static KeyboardFocusManagerAccessor kfmAccessor;
 430     /*
 431      * The java.awt.Window class accessor object.
 432      */
 433     private static WindowAccessor windowAccessor;
 434 
 435     /*
 436      * The java.awt.AWTEvent class accessor object.
 437      */
 438     private static AWTEventAccessor awtEventAccessor;
 439     private static MenuComponentAccessor menuComponentAccessor;
 440     private static EventQueueAccessor eventQueueAccessor;
 441     private static PopupMenuAccessor popupMenuAccessor;
 442     private static ScrollPaneAdjustableAccessor scrollPaneAdjustableAccessor;
 443     private static CheckboxMenuItemAccessor checkboxMenuItemAccessor;
 444     private static CursorAccessor cursorAccessor;
 445     private static MenuBarAccessor menuBarAccessor;
 446     private static MenuItemAccessor menuItemAccessor;
 447     private static MenuAccessor menuAccessor;

 448     private static ClientPropertyKeyAccessor clientPropertyKeyAccessor;
 449     private static DefaultKeyboardFocusManagerAccessor defaultKeyboardFocusManagerAccessor;
 450 
 451     /**
 452      * Set an accessor object for the java.awt.Window class.
 453      */
 454     public static void setWindowAccessor(WindowAccessor wa) {
 455         windowAccessor = wa;
 456     }
 457 
 458     /**
 459      * Retrieve the accessor object for the java.awt.Window class.
 460      */
 461     public static WindowAccessor getWindowAccessor() {
 462         if (windowAccessor == null) {
 463             unsafe.ensureClassInitialized(Window.class);
 464         }
 465 
 466         return windowAccessor;
 467     }


 654             unsafe.ensureClassInitialized(MenuItemAccessor.class);
 655         }
 656         return menuItemAccessor;
 657     }
 658 
 659     /**
 660      * Set an accessor object for the java.awt.Menu class.
 661      */
 662     public static void setMenuAccessor(MenuAccessor ma) {
 663         menuAccessor = ma;
 664     }
 665 
 666     /**
 667      * Retrieve the accessor object for the java.awt.Menu class.
 668      */
 669     public static MenuAccessor getMenuAccessor() {
 670         if (menuAccessor == null) {
 671             unsafe.ensureClassInitialized(MenuAccessor.class);
 672         }
 673         return menuAccessor;

















 674     }
 675 
 676     /**
 677      * Set an accessor object for the javax.swing.ClientPropertyKey class.
 678      */
 679     public static void setClientPropertyKeyAccessor(ClientPropertyKeyAccessor cpka) {
 680         clientPropertyKeyAccessor = cpka;
 681     }
 682 
 683     /**
 684      * Retrieve the accessor object for the javax.swing.ClientPropertyKey class.
 685      */
 686     public static ClientPropertyKeyAccessor getClientPropertyKeyAccessor() {
 687         if (clientPropertyKeyAccessor == null) {
 688             unsafe.ensureClassInitialized(ClientPropertyKeyAccessor.class);
 689         }
 690         return clientPropertyKeyAccessor;
 691     }
 692 
 693     /**


  72         /*
  73          * Get a shape assigned to the given window.
  74          */
  75         Shape getShape(Window window);
  76         /*
  77          * Set a shape to the given window.
  78          */
  79         void setShape(Window window, Shape shape);
  80         /*
  81          * Identify whether the given window is opaque (true)
  82          *  or translucent (false).
  83          */
  84         boolean isOpaque(Window window);
  85         /*
  86          * Set the opaque preoperty to the given window.
  87          */
  88         void setOpaque(Window window, boolean isOpaque);
  89         /*
  90          * Update the image of a non-opaque (translucent) window.
  91          */
  92         void updateWindow(Window window);
  93         /**
  94          * Sets the synchronous status of focus requests on lightweight
  95          * components in the specified window to the specified value.
  96          */
  97         void setLWRequestStatus(Window changed, boolean status);
  98 
  99         /** Get the size of the security warning.
 100          */
 101         Dimension getSecurityWarningSize(Window w);
 102 
 103         /**
 104          * Set the size of the security warning.
 105          */
 106         void setSecurityWarningSize(Window w, int width, int height);
 107 
 108         /** Set the position of the security warning.
 109          */
 110         void setSecurityWarningPosition(Window w, Point2D point,
 111                 float alignmentX, float alignmentY);
 112 


 386          */
 387         String getLabel(MenuItem item);
 388 
 389         /**
 390          * Returns shortcut
 391          */
 392         MenuShortcut getShortcut(MenuItem item);
 393     }
 394 
 395     /**
 396      * An accessor for the Menu class
 397      */
 398     public interface MenuAccessor {
 399         /**
 400          * Returns vector of the items that are part of the Menu
 401          */
 402         Vector getItems(Menu menu);
 403     }
 404 
 405     /**
 406      * An accessor for the KeyEvent class
 407      */
 408     public interface KeyEventAccessor {
 409         /**
 410          * Sets rawCode field for KeyEvent
 411          */
 412         void setRawCode(KeyEvent ev, long rawCode);
 413 
 414         /**
 415          * Sets primaryLevelUnicode field for KeyEvent
 416          */
 417         void setPrimaryLevelUnicode(KeyEvent ev, long primaryLevelUnicode);
 418 
 419         /**
 420          * Sets extendedKeyCode field for KeyEvent
 421          */
 422         void setExtendedKeyCode(KeyEvent ev, long extendedKeyCode);
 423 
 424         /**
 425          * Returns an extended key code for the event.
 426          */
 427         int getExtendedKeyCode(KeyEvent ev);
 428 
 429         /**
 430          * Returns an extended key code for a unicode character.
 431          */
 432         int getExtendedKeyCodeForChar(int c);
 433     }
 434 
 435     /**
 436      * An accessor for the ClientPropertyKey class
 437      */
 438     public interface ClientPropertyKeyAccessor {
 439         /**
 440          * Retrieves JComponent_TRANSFER_HANDLER enum object
 441          */
 442         Object getJComponent_TRANSFER_HANDLER();
 443     }
 444 
 445     /**
 446      * An accessor for the DefaultKeyboardFocusManager class
 447      */
 448     public interface DefaultKeyboardFocusManagerAccessor {
 449         void consumeNextKeyTyped(DefaultKeyboardFocusManager dkfm, KeyEvent e);
 450     }
 451 
 452     /*
 453      * Accessor instances are initialized in the static initializers of
 454      * corresponding AWT classes by using setters defined below.
 455      */


 458     private static ComponentAccessor componentAccessor;
 459     private static KeyboardFocusManagerAccessor kfmAccessor;
 460     /*
 461      * The java.awt.Window class accessor object.
 462      */
 463     private static WindowAccessor windowAccessor;
 464 
 465     /*
 466      * The java.awt.AWTEvent class accessor object.
 467      */
 468     private static AWTEventAccessor awtEventAccessor;
 469     private static MenuComponentAccessor menuComponentAccessor;
 470     private static EventQueueAccessor eventQueueAccessor;
 471     private static PopupMenuAccessor popupMenuAccessor;
 472     private static ScrollPaneAdjustableAccessor scrollPaneAdjustableAccessor;
 473     private static CheckboxMenuItemAccessor checkboxMenuItemAccessor;
 474     private static CursorAccessor cursorAccessor;
 475     private static MenuBarAccessor menuBarAccessor;
 476     private static MenuItemAccessor menuItemAccessor;
 477     private static MenuAccessor menuAccessor;
 478     private static KeyEventAccessor keyEventAccessor;
 479     private static ClientPropertyKeyAccessor clientPropertyKeyAccessor;
 480     private static DefaultKeyboardFocusManagerAccessor defaultKeyboardFocusManagerAccessor;
 481 
 482     /**
 483      * Set an accessor object for the java.awt.Window class.
 484      */
 485     public static void setWindowAccessor(WindowAccessor wa) {
 486         windowAccessor = wa;
 487     }
 488 
 489     /**
 490      * Retrieve the accessor object for the java.awt.Window class.
 491      */
 492     public static WindowAccessor getWindowAccessor() {
 493         if (windowAccessor == null) {
 494             unsafe.ensureClassInitialized(Window.class);
 495         }
 496 
 497         return windowAccessor;
 498     }


 685             unsafe.ensureClassInitialized(MenuItemAccessor.class);
 686         }
 687         return menuItemAccessor;
 688     }
 689 
 690     /**
 691      * Set an accessor object for the java.awt.Menu class.
 692      */
 693     public static void setMenuAccessor(MenuAccessor ma) {
 694         menuAccessor = ma;
 695     }
 696 
 697     /**
 698      * Retrieve the accessor object for the java.awt.Menu class.
 699      */
 700     public static MenuAccessor getMenuAccessor() {
 701         if (menuAccessor == null) {
 702             unsafe.ensureClassInitialized(MenuAccessor.class);
 703         }
 704         return menuAccessor;
 705     }
 706 
 707     /**
 708      * Set an accessor object for the java.awt.event.KeyEvent class.
 709      */
 710     public static void setKeyEventAccessor(KeyEventAccessor kea) {
 711         keyEventAccessor = kea;
 712     }
 713 
 714     /**
 715      * Retrieve the accessor object for the java.awt.event.KeyEvent class.
 716      */
 717     public static KeyEventAccessor getKeyEventAccessor() {
 718         if (keyEventAccessor == null) {
 719             unsafe.ensureClassInitialized(KeyEventAccessor.class);
 720         }
 721         return keyEventAccessor;
 722     }
 723 
 724     /**
 725      * Set an accessor object for the javax.swing.ClientPropertyKey class.
 726      */
 727     public static void setClientPropertyKeyAccessor(ClientPropertyKeyAccessor cpka) {
 728         clientPropertyKeyAccessor = cpka;
 729     }
 730 
 731     /**
 732      * Retrieve the accessor object for the javax.swing.ClientPropertyKey class.
 733      */
 734     public static ClientPropertyKeyAccessor getClientPropertyKeyAccessor() {
 735         if (clientPropertyKeyAccessor == null) {
 736             unsafe.ensureClassInitialized(ClientPropertyKeyAccessor.class);
 737         }
 738         return clientPropertyKeyAccessor;
 739     }
 740 
 741     /**
< prev index next >