jdk/src/java.desktop/share/classes/java/awt/Component.java
changeset 28985 33e7de0337d9
parent 28059 e576535359cc
child 29886 545c0c3809b8
equal deleted inserted replaced
28984:12031ba2dc38 28985:33e7de0337d9
     1 /*
     1 /*
     2  * Copyright (c) 1995, 2014, Oracle and/or its affiliates. All rights reserved.
     2  * Copyright (c) 1995, 2015, Oracle and/or its affiliates. All rights reserved.
     3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     4  *
     4  *
     5  * This code is free software; you can redistribute it and/or modify it
     5  * This code is free software; you can redistribute it and/or modify it
     6  * under the terms of the GNU General Public License version 2 only, as
     6  * under the terms of the GNU General Public License version 2 only, as
     7  * published by the Free Software Foundation.  Oracle designates this
     7  * published by the Free Software Foundation.  Oracle designates this
  1688 
  1688 
  1689     void clearCurrentFocusCycleRootOnHide() {
  1689     void clearCurrentFocusCycleRootOnHide() {
  1690         /* do nothing */
  1690         /* do nothing */
  1691     }
  1691     }
  1692 
  1692 
  1693     /*
       
  1694      * Delete references from LightweightDispatcher of a heavyweight parent
       
  1695      */
       
  1696     void clearLightweightDispatcherOnRemove(Component removedComponent) {
       
  1697         if (parent != null) {
       
  1698             parent.clearLightweightDispatcherOnRemove(removedComponent);
       
  1699         }
       
  1700     }
       
  1701 
       
  1702     /**
  1693     /**
  1703      * @deprecated As of JDK version 1.1,
  1694      * @deprecated As of JDK version 1.1,
  1704      * replaced by <code>setVisible(boolean)</code>.
  1695      * replaced by <code>setVisible(boolean)</code>.
  1705      */
  1696      */
  1706     @Deprecated
  1697     @Deprecated
  6240     };
  6231     };
  6241 
  6232 
  6242     /**
  6233     /**
  6243      * Indicates whether a class or its superclasses override coalesceEvents.
  6234      * Indicates whether a class or its superclasses override coalesceEvents.
  6244      * Must be called with lock on coalesceMap and privileged.
  6235      * Must be called with lock on coalesceMap and privileged.
  6245      * @see checkCoalsecing
  6236      * @see checkCoalescing
  6246      */
  6237      */
  6247     private static boolean isCoalesceEventsOverriden(Class<?> clazz) {
  6238     private static boolean isCoalesceEventsOverriden(Class<?> clazz) {
  6248         assert Thread.holdsLock(coalesceMap);
  6239         assert Thread.holdsLock(coalesceMap);
  6249 
  6240 
  6250         // First check superclass - we may not need to bother ourselves.
  6241         // First check superclass - we may not need to bother ourselves.
  7081             KeyboardFocusManager.getCurrentKeyboardFocusManager().
  7072             KeyboardFocusManager.getCurrentKeyboardFocusManager().
  7082                 setGlobalPermanentFocusOwner(null);
  7073                 setGlobalPermanentFocusOwner(null);
  7083         }
  7074         }
  7084 
  7075 
  7085         synchronized (getTreeLock()) {
  7076         synchronized (getTreeLock()) {
  7086             clearLightweightDispatcherOnRemove(this);
       
  7087 
       
  7088             if (isFocusOwner() && KeyboardFocusManager.isAutoFocusTransferEnabledFor(this)) {
  7077             if (isFocusOwner() && KeyboardFocusManager.isAutoFocusTransferEnabledFor(this)) {
  7089                 transferFocus(true);
  7078                 transferFocus(true);
  7090             }
  7079             }
  7091 
  7080 
  7092             if (getContainer() != null && isAddNotifyComplete) {
  7081             if (getContainer() != null && isAddNotifyComplete) {