jdk/src/share/classes/java/awt/KeyboardFocusManager.java
changeset 2451 597df8e1d786
parent 715 f16baef3a20e
child 2464 3c6755bdc55f
equal deleted inserted replaced
1978:8b981ce05cd0 2451:597df8e1d786
  2206 
  2206 
  2207     static boolean processSynchronousLightweightTransfer(Component heavyweight, Component descendant,
  2207     static boolean processSynchronousLightweightTransfer(Component heavyweight, Component descendant,
  2208                                                   boolean temporary, boolean focusedWindowChangeAllowed,
  2208                                                   boolean temporary, boolean focusedWindowChangeAllowed,
  2209                                                   long time)
  2209                                                   long time)
  2210     {
  2210     {
  2211         Window parentWindow = Component.getContainingWindow(heavyweight);
  2211         Window parentWindow = SunToolkit.getContainingWindow(heavyweight);
  2212         if (parentWindow == null || !parentWindow.syncLWRequests) {
  2212         if (parentWindow == null || !parentWindow.syncLWRequests) {
  2213             return false;
  2213             return false;
  2214         }
  2214         }
  2215         if (descendant == null) {
  2215         if (descendant == null) {
  2216             // Focus transfers from a lightweight child back to the
  2216             // Focus transfers from a lightweight child back to the
  2540 
  2540 
  2541             heavyweightRequests.add
  2541             heavyweightRequests.add
  2542                 (HeavyweightFocusRequest.CLEAR_GLOBAL_FOCUS_OWNER);
  2542                 (HeavyweightFocusRequest.CLEAR_GLOBAL_FOCUS_OWNER);
  2543 
  2543 
  2544             Component activeWindow = ((hwFocusRequest != null)
  2544             Component activeWindow = ((hwFocusRequest != null)
  2545                 ? Component.getContainingWindow(hwFocusRequest.heavyweight)
  2545                 ? SunToolkit.getContainingWindow(hwFocusRequest.heavyweight)
  2546                 : nativeFocusedWindow);
  2546                 : nativeFocusedWindow);
  2547             while (activeWindow != null &&
  2547             while (activeWindow != null &&
  2548                    !((activeWindow instanceof Frame) ||
  2548                    !((activeWindow instanceof Frame) ||
  2549                      (activeWindow instanceof Dialog)))
  2549                      (activeWindow instanceof Dialog)))
  2550             {
  2550             {
  3011             }
  3011             }
  3012         }
  3012         }
  3013     }
  3013     }
  3014 
  3014 
  3015     private static boolean focusedWindowChanged(Component to, Component from) {
  3015     private static boolean focusedWindowChanged(Component to, Component from) {
  3016         Window wto = Component.getContainingWindow(to);
  3016         Window wto = SunToolkit.getContainingWindow(to);
  3017         Window wfrom = Component.getContainingWindow(from);
  3017         Window wfrom = SunToolkit.getContainingWindow(from);
  3018         if (wto == null && wfrom == null) {
  3018         if (wto == null && wfrom == null) {
  3019             return true;
  3019             return true;
  3020         }
  3020         }
  3021         if (wto == null) {
  3021         if (wto == null) {
  3022             return true;
  3022             return true;
  3026         }
  3026         }
  3027         return (wto != wfrom);
  3027         return (wto != wfrom);
  3028     }
  3028     }
  3029 
  3029 
  3030     private static boolean isTemporary(Component to, Component from) {
  3030     private static boolean isTemporary(Component to, Component from) {
  3031         Window wto = Component.getContainingWindow(to);
  3031         Window wto = SunToolkit.getContainingWindow(to);
  3032         Window wfrom = Component.getContainingWindow(from);
  3032         Window wfrom = SunToolkit.getContainingWindow(from);
  3033         if (wto == null && wfrom == null) {
  3033         if (wto == null && wfrom == null) {
  3034             return false;
  3034             return false;
  3035         }
  3035         }
  3036         if (wto == null) {
  3036         if (wto == null) {
  3037             return true;
  3037             return true;