4743N/A * Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved. 0N/A * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 0N/A * This code is free software; you can redistribute it and/or modify it 0N/A * under the terms of the GNU General Public License version 2 only, as 2362N/A * published by the Free Software Foundation. Oracle designates this 0N/A * particular file as subject to the "Classpath" exception as provided 2362N/A * by Oracle in the LICENSE file that accompanied this code. 0N/A * This code is distributed in the hope that it will be useful, but WITHOUT 0N/A * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 0N/A * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 0N/A * version 2 for more details (a copy is included in the LICENSE file that 0N/A * accompanied this code). 0N/A * You should have received a copy of the GNU General Public License version 0N/A * 2 along with this work; if not, write to the Free Software Foundation, 0N/A * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 2362N/A * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 2362N/A * or visit www.oracle.com if you need additional information or have any 0N/A * The KeyboardFocusManager is responsible for managing the active and focused 0N/A * Windows, and the current focus owner. The focus owner is defined as the 0N/A * Component in an application that will typically receive all KeyEvents 0N/A * generated by the user. The focused Window is the Window that is, or 0N/A * contains, the focus owner. Only a Frame or a Dialog can be the active 0N/A * Window. The native windowing system may denote the active Window or its 0N/A * children with special decorations, such as a highlighted title bar. The 0N/A * active Window is always either the focused Window, or the first Frame or 0N/A * Dialog that is an owner of the focused Window. 0N/A * The KeyboardFocusManager is both a centralized location for client code to 0N/A * query for the focus owner and initiate focus changes, and an event 0N/A * dispatcher for all FocusEvents, WindowEvents related to focus, and 0N/A * Some browsers partition applets in different code bases into separate 0N/A * contexts, and establish walls between these contexts. In such a scenario, 0N/A * there will be one KeyboardFocusManager per context. Other browsers place all 0N/A * applets into the same context, implying that there will be only a single, 0N/A * global KeyboardFocusManager for all applets. This behavior is 0N/A * implementation-dependent. Consult your browser's documentation for more 0N/A * information. No matter how many contexts there may be, however, there can 0N/A * never be more than one focus owner, focused Window, or active Window, per 0N/A * How to Use the Focus Subsystem</a>, 0N/A * a section in <em>The Java Tutorial</em>, and the 0N/A * for more information. 0N/A * @author David Mendenhall 0N/A * @see java.awt.event.FocusEvent 0N/A * @see java.awt.event.WindowEvent 0N/A * @see java.awt.event.KeyEvent 0N/A // Shared focus engine logger 0N/A /* ensure that the necessary native libraries are loaded */ 0N/A * Initialize JNI field and method IDs 0N/A * The identifier for the Forward focus traversal keys. 0N/A * @see #setDefaultFocusTraversalKeys 0N/A * @see #getDefaultFocusTraversalKeys 0N/A * @see Component#setFocusTraversalKeys 0N/A * @see Component#getFocusTraversalKeys 0N/A * The identifier for the Backward focus traversal keys. 0N/A * @see #setDefaultFocusTraversalKeys 0N/A * @see #getDefaultFocusTraversalKeys 0N/A * @see Component#setFocusTraversalKeys 0N/A * @see Component#getFocusTraversalKeys 0N/A * The identifier for the Up Cycle focus traversal keys. 0N/A * @see #setDefaultFocusTraversalKeys 0N/A * @see #getDefaultFocusTraversalKeys 0N/A * @see Component#setFocusTraversalKeys 0N/A * @see Component#getFocusTraversalKeys 0N/A * The identifier for the Down Cycle focus traversal keys. 0N/A * @see #setDefaultFocusTraversalKeys 0N/A * @see #getDefaultFocusTraversalKeys 0N/A * @see Component#setFocusTraversalKeys 0N/A * @see Component#getFocusTraversalKeys 0N/A * Returns the current KeyboardFocusManager instance for the calling 0N/A * @return this thread's context's KeyboardFocusManager 0N/A * @see #setCurrentKeyboardFocusManager 0N/A * Sets the current KeyboardFocusManager instance for the calling thread's 0N/A * context. If null is specified, then the current KeyboardFocusManager 0N/A * is replaced with a new instance of DefaultKeyboardFocusManager. 0N/A * If a SecurityManager is installed, the calling thread must be granted 0N/A * the AWTPermission "replaceKeyboardFocusManager" in order to replace the 0N/A * the current KeyboardFocusManager. If this permission is not granted, 0N/A * this method will throw a SecurityException, and the current 0N/A * KeyboardFocusManager will be unchanged. 0N/A * @param newManager the new KeyboardFocusManager for this thread's context 0N/A * @see #getCurrentKeyboardFocusManager 0N/A * @see DefaultKeyboardFocusManager 0N/A * @throws SecurityException if the calling thread does not have permission 0N/A * to replace the current KeyboardFocusManager 0N/A * The Component in an application that will typically receive all 0N/A * KeyEvents generated by the user. 0N/A * The Component in an application that will regain focus when an 0N/A * outstanding temporary focus transfer has completed, or the focus owner, 0N/A * if no outstanding temporary transfer exists. 0N/A * The Window which is, or contains, the focus owner. 0N/A * Only a Frame or a Dialog can be the active Window. The native windowing 0N/A * system may denote the active Window with a special decoration, such as a 0N/A * highlighted title bar. The active Window is always either the focused 0N/A * Window, or the first Frame or Dialog which is an owner of the focused 0N/A * The default FocusTraversalPolicy for all Windows that have no policy of 0N/A * their own set. If those Windows have focus-cycle-root children that have 0N/A * no keyboard-traversal policy of their own, then those children will also 0N/A * inherit this policy (as will, recursively, their focus-cycle-root 0N/A * The bound property names of each focus traversal key. 0N/A "forwardDefaultFocusTraversalKeys",
0N/A "backwardDefaultFocusTraversalKeys",
0N/A "upCycleDefaultFocusTraversalKeys",
0N/A "downCycleDefaultFocusTraversalKeys" 0N/A * The default strokes for initializing the default focus traversal keys. 0N/A * The default focus traversal keys. Each array of traversal keys will be 0N/A * in effect on all Windows that have no such array of their own explicitly 0N/A * set. Each array will also be inherited, recursively, by any child 0N/A * Component of those Windows that has no such array of its own explicitly 0N/A * The current focus cycle root. If the focus owner is itself a focus cycle 0N/A * root, then it may be ambiguous as to which Components represent the next 0N/A * and previous Components to focus during normal focus traversal. In that 0N/A * case, the current focus cycle root is used to differentiate among the 0N/A * A description of any VetoableChangeListeners which have been registered. 0N/A * A description of any PropertyChangeListeners which have been registered. 0N/A * This KeyboardFocusManager's KeyEventDispatcher chain. The List does not 0N/A * include this KeyboardFocusManager unless it was explicitly re-registered 0N/A * via a call to <code>addKeyEventDispatcher</code>. If no other 0N/A * KeyEventDispatchers are registered, this field may be null or refer to 0N/A * a List of length 0. 0N/A * This KeyboardFocusManager's KeyEventPostProcessor chain. The List does 0N/A * not include this KeyboardFocusManager unless it was explicitly 0N/A * re-registered via a call to <code>addKeyEventPostProcessor</code>. 0N/A * If no other KeyEventPostProcessors are registered, this field may be 0N/A * null or refer to a List of length 0. 0N/A * Maps Windows to those Windows' most recent focus owners. 0N/A * Error String for initializing SecurityExceptions. 0N/A private static final String notPrivileged =
"this KeyboardFocusManager is not installed in the current thread's context";
0N/A * We cache the permission used to verify that the calling thread is 0N/A * permitted to access the global focus state. 0N/A * SequencedEvent which is currently dispatched in AppContext. 0N/A * Initializes a KeyboardFocusManager. 0N/A * Returns the focus owner, if the focus owner is in the same context as 0N/A * the calling thread. The focus owner is defined as the Component in an 0N/A * application that will typically receive all KeyEvents generated by the 0N/A * user. KeyEvents which map to the focus owner's focus traversal keys will 0N/A * not be delivered if focus traversal keys are enabled for the focus 0N/A * owner. In addition, KeyEventDispatchers may retarget or consume 0N/A * KeyEvents before they reach the focus owner. 0N/A * @return the focus owner, or null if the focus owner is not a member of 0N/A * the calling thread's context 0N/A * @see #getGlobalFocusOwner 0N/A * @see #setGlobalFocusOwner 0N/A * Returns the focus owner, even if the calling thread is in a different 0N/A * context than the focus owner. The focus owner is defined as the 0N/A * Component in an application that will typically receive all KeyEvents 0N/A * generated by the user. KeyEvents which map to the focus owner's focus 0N/A * traversal keys will not be delivered if focus traversal keys are enabled 0N/A * for the focus owner. In addition, KeyEventDispatchers may retarget or 0N/A * consume KeyEvents before they reach the focus owner. 0N/A * This method will throw a SecurityException if this KeyboardFocusManager 0N/A * is not the current KeyboardFocusManager for the calling thread's 0N/A * @return the focus owner 0N/A * @see #getFocusOwner 0N/A * @see #setGlobalFocusOwner 0N/A * @throws SecurityException if this KeyboardFocusManager is not the 0N/A * current KeyboardFocusManager for the calling thread's context 0N/A * Sets the focus owner. The operation will be cancelled if the Component 0N/A * is not focusable. The focus owner is defined as the Component in an 0N/A * application that will typically receive all KeyEvents generated by the 0N/A * user. KeyEvents which map to the focus owner's focus traversal keys will 0N/A * not be delivered if focus traversal keys are enabled for the focus 0N/A * owner. In addition, KeyEventDispatchers may retarget or consume 0N/A * KeyEvents before they reach the focus owner. 0N/A * This method does not actually set the focus to the specified Component. 0N/A * It merely stores the value to be subsequently returned by 0N/A * <code>getFocusOwner()</code>. Use <code>Component.requestFocus()</code> 0N/A * or <code>Component.requestFocusInWindow()</code> to change the focus 0N/A * owner, subject to platform limitations. 0N/A * @param focusOwner the focus owner 0N/A * @see #getFocusOwner 0N/A * @see #getGlobalFocusOwner 0N/A * @see Component#requestFocus() 0N/A * @see Component#requestFocusInWindow() 0N/A * @see Component#isFocusable 0N/A * Clears the global focus owner at both the Java and native levels. If 0N/A * there exists a focus owner, that Component will receive a permanent 0N/A * FOCUS_LOST event. After this operation completes, the native windowing 0N/A * system will discard all user-generated KeyEvents until the user selects 0N/A * a new Component to receive focus, or a Component is given focus 0N/A * explicitly via a call to <code>requestFocus()</code>. This operation 0N/A * does not change the focused or active Windows. 0N/A * @see Component#requestFocus() 0N/A * @see java.awt.event.FocusEvent#FOCUS_LOST 0N/A // Toolkit must be fully initialized, otherwise 0N/A // _clearGlobalFocusOwner will crash or throw an exception 0N/A * Returns the permanent focus owner, if the permanent focus owner is in 0N/A * the same context as the calling thread. The permanent focus owner is 0N/A * defined as the last Component in an application to receive a permanent 0N/A * FOCUS_GAINED event. The focus owner and permanent focus owner are 0N/A * equivalent unless a temporary focus change is currently in effect. In 0N/A * such a situation, the permanent focus owner will again be the focus 0N/A * owner when the temporary focus change ends. 0N/A * @return the permanent focus owner, or null if the permanent focus owner 0N/A * is not a member of the calling thread's context 0N/A * @see #getGlobalPermanentFocusOwner 0N/A * @see #setGlobalPermanentFocusOwner 0N/A * Returns the permanent focus owner, even if the calling thread is in a 0N/A * different context than the permanent focus owner. The permanent focus 0N/A * owner is defined as the last Component in an application to receive a 0N/A * permanent FOCUS_GAINED event. The focus owner and permanent focus owner 0N/A * are equivalent unless a temporary focus change is currently in effect. 0N/A * In such a situation, the permanent focus owner will again be the focus 0N/A * owner when the temporary focus change ends. 0N/A * This method will throw a SecurityException if this KeyboardFocusManager 0N/A * is not the current KeyboardFocusManager for the calling thread's 0N/A * @return the permanent focus owner 0N/A * @see #getPermanentFocusOwner 0N/A * @see #setGlobalPermanentFocusOwner 0N/A * @throws SecurityException if this KeyboardFocusManager is not the 0N/A * current KeyboardFocusManager for the calling thread's context 0N/A * Sets the permanent focus owner. The operation will be cancelled if the 0N/A * Component is not focusable. The permanent focus owner is defined as the 0N/A * last Component in an application to receive a permanent FOCUS_GAINED 0N/A * event. The focus owner and permanent focus owner are equivalent unless 0N/A * a temporary focus change is currently in effect. In such a situation, 0N/A * the permanent focus owner will again be the focus owner when the 0N/A * temporary focus change ends. 0N/A * This method does not actually set the focus to the specified Component. 0N/A * It merely stores the value to be subsequently returned by 0N/A * <code>getPermanentFocusOwner()</code>. Use 0N/A * <code>Component.requestFocus()</code> or 0N/A * <code>Component.requestFocusInWindow()</code> to change the focus owner, 0N/A * subject to platform limitations. 0N/A * @param permanentFocusOwner the permanent focus owner 0N/A * @see #getPermanentFocusOwner 0N/A * @see #getGlobalPermanentFocusOwner 0N/A * @see Component#requestFocus() 0N/A * @see Component#requestFocusInWindow() 0N/A * @see Component#isFocusable 0N/A * Returns the focused Window, if the focused Window is in the same context 0N/A * as the calling thread. The focused Window is the Window that is or 0N/A * contains the focus owner. 0N/A * @return the focused Window, or null if the focused Window is not a 0N/A * member of the calling thread's context 0N/A * @see #getGlobalFocusedWindow 0N/A * @see #setGlobalFocusedWindow 0N/A * Returns the focused Window, even if the calling thread is in a different 0N/A * context than the focused Window. The focused Window is the Window that 0N/A * is or contains the focus owner. 0N/A * This method will throw a SecurityException if this KeyboardFocusManager 0N/A * is not the current KeyboardFocusManager for the calling thread's 0N/A * @return the focused Window 0N/A * @see #getFocusedWindow 0N/A * @see #setGlobalFocusedWindow 0N/A * @throws SecurityException if this KeyboardFocusManager is not the 0N/A * current KeyboardFocusManager for the calling thread's context 0N/A * Sets the focused Window. The focused Window is the Window that is or 0N/A * contains the focus owner. The operation will be cancelled if the 0N/A * specified Window to focus is not a focusable Window. 0N/A * This method does not actually change the focused Window as far as the 0N/A * native windowing system is concerned. It merely stores the value to be 0N/A * subsequently returned by <code>getFocusedWindow()</code>. Use 0N/A * <code>Component.requestFocus()</code> or 0N/A * <code>Component.requestFocusInWindow()</code> to change the focused 0N/A * Window, subject to platform limitations. 0N/A * @param focusedWindow the focused Window 0N/A * @see #getFocusedWindow 0N/A * @see #getGlobalFocusedWindow 0N/A * @see Component#requestFocus() 0N/A * @see Component#requestFocusInWindow() 0N/A * @see Window#isFocusableWindow 0N/A * Returns the active Window, if the active Window is in the same context 0N/A * as the calling thread. Only a Frame or a Dialog can be the active 0N/A * Window. The native windowing system may denote the active Window or its 0N/A * children with special decorations, such as a highlighted title bar. 0N/A * The active Window is always either the focused Window, or the first 0N/A * Frame or Dialog that is an owner of the focused Window. 0N/A * @return the active Window, or null if the active Window is not a member 0N/A * of the calling thread's context 0N/A * @see #getGlobalActiveWindow 0N/A * @see #setGlobalActiveWindow 0N/A * Returns the active Window, even if the calling thread is in a different 0N/A * context than the active Window. Only a Frame or a Dialog can be the 0N/A * active Window. The native windowing system may denote the active Window 0N/A * or its children with special decorations, such as a highlighted title 0N/A * bar. The active Window is always either the focused Window, or the first 0N/A * Frame or Dialog that is an owner of the focused Window. 0N/A * This method will throw a SecurityException if this KeyboardFocusManager 0N/A * is not the current KeyboardFocusManager for the calling thread's 0N/A * @return the active Window 0N/A * @see #getActiveWindow 0N/A * @see #setGlobalActiveWindow 0N/A * @throws SecurityException if this KeyboardFocusManager is not the 0N/A * current KeyboardFocusManager for the calling thread's context 0N/A * Sets the active Window. Only a Frame or a Dialog can be the active 0N/A * Window. The native windowing system may denote the active Window or its 0N/A * children with special decorations, such as a highlighted title bar. The 0N/A * active Window is always either the focused Window, or the first Frame or 0N/A * Dialog that is an owner of the focused Window. 0N/A * This method does not actually change the active Window as far as the 0N/A * native windowing system is concerned. It merely stores the value to be 0N/A * subsequently returned by <code>getActiveWindow()</code>. Use 0N/A * <code>Component.requestFocus()</code> or 0N/A * <code>Component.requestFocusInWindow()</code>to change the active 0N/A * Window, subject to platform limitations. 0N/A * @param activeWindow the active Window 0N/A * @see #getActiveWindow 0N/A * @see #getGlobalActiveWindow 0N/A * @see Component#requestFocus() 0N/A * @see Component#requestFocusInWindow() 0N/A * Returns the default FocusTraversalPolicy. Top-level components 0N/A * use this value on their creation to initialize their own focus traversal 0N/A * policy by explicit call to Container.setFocusTraversalPolicy. 0N/A * @return the default FocusTraversalPolicy. null will never be returned. 0N/A * @see #setDefaultFocusTraversalPolicy 0N/A * @see Container#setFocusTraversalPolicy 0N/A * @see Container#getFocusTraversalPolicy 0N/A * Sets the default FocusTraversalPolicy. Top-level components 0N/A * use this value on their creation to initialize their own focus traversal 0N/A * policy by explicit call to Container.setFocusTraversalPolicy. 0N/A * Note: this call doesn't affect already created components as they have 0N/A * their policy initialized. Only new components will use this policy as 0N/A * their default policy. 0N/A * @param defaultPolicy the new, default FocusTraversalPolicy 0N/A * @see #getDefaultFocusTraversalPolicy 0N/A * @see Container#setFocusTraversalPolicy 0N/A * @see Container#getFocusTraversalPolicy 0N/A * @throws IllegalArgumentException if defaultPolicy is null 0N/A synchronized (
this) {
0N/A * Sets the default focus traversal keys for a given traversal operation. 0N/A * This traversal key <code>Set</code> will be in effect on all 0N/A * <code>Window</code>s that have no such <code>Set</code> of 0N/A * their own explicitly defined. This <code>Set</code> will also be 0N/A * inherited, recursively, by any child <code>Component</code> of 0N/A * those <code>Windows</code> that has 0N/A * no such <code>Set</code> of its own explicitly defined. 0N/A * The default values for the default focus traversal keys are 0N/A * implementation-dependent. Sun recommends that all implementations for a 0N/A * particular native platform use the same default values. The 0N/A * recommendations for Windows and Unix are listed below. These 0N/A * recommendations are used in the Sun AWT implementations. 0N/A * <table border=1 summary="Recommended default values for focus traversal keys"> 0N/A * <th>Identifier</th> 0N/A * <td><code>KeyboardFocusManager.FORWARD_TRAVERSAL_KEYS</code></td> 0N/A * <td>Normal forward keyboard traversal</td> 0N/A * <td><code>TAB</code> on <code>KEY_PRESSED</code>, 0N/A * <code>CTRL-TAB</code> on <code>KEY_PRESSED</code></td> 0N/A * <td><code>KeyboardFocusManager.BACKWARD_TRAVERSAL_KEYS</code></td> 0N/A * <td>Normal reverse keyboard traversal</td> 0N/A * <td><code>SHIFT-TAB</code> on <code>KEY_PRESSED</code>, 0N/A * <code>CTRL-SHIFT-TAB</code> on <code>KEY_PRESSED</code></td> 0N/A * <td><code>KeyboardFocusManager.UP_CYCLE_TRAVERSAL_KEYS</code></td> 0N/A * <td>Go up one focus traversal cycle</td> 0N/A * <td><code>KeyboardFocusManager.DOWN_CYCLE_TRAVERSAL_KEYS</code></td> 0N/A * <td>Go down one focus traversal cycle</td> 0N/A * To disable a traversal key, use an empty <code>Set</code>; 0N/A * <code>Collections.EMPTY_SET</code> is recommended. 0N/A * Using the <code>AWTKeyStroke</code> API, client code can 0N/A * specify on which of two 0N/A * specific <code>KeyEvent</code>s, <code>KEY_PRESSED</code> or 0N/A * <code>KEY_RELEASED</code>, the focus traversal operation will 0N/A * occur. Regardless of which <code>KeyEvent</code> is specified, 0N/A * however, all <code>KeyEvent</code>s related to the focus 0N/A * traversal key, including the associated <code>KEY_TYPED</code> 0N/A * event, will be consumed, and will not be dispatched 0N/A * to any <code>Component</code>. It is a runtime error to 0N/A * specify a <code>KEY_TYPED</code> event as 0N/A * mapping to a focus traversal operation, or to map the same event to 0N/A * multiple default focus traversal operations. 0N/A * <code>KeyboardFocusManager.FORWARD_TRAVERSAL_KEYS</code>, 0N/A * <code>KeyboardFocusManager.BACKWARD_TRAVERSAL_KEYS</code>, 0N/A * <code>KeyboardFocusManager.UP_CYCLE_TRAVERSAL_KEYS</code>, or 0N/A * <code>KeyboardFocusManager.DOWN_CYCLE_TRAVERSAL_KEYS</code> 0N/A * @param keystrokes the Set of <code>AWTKeyStroke</code>s for the 0N/A * specified operation 0N/A * @see #getDefaultFocusTraversalKeys 0N/A * @see Component#setFocusTraversalKeys 0N/A * @see Component#getFocusTraversalKeys 0N/A * @throws IllegalArgumentException if id is not one of 0N/A * <code>KeyboardFocusManager.FORWARD_TRAVERSAL_KEYS</code>, 0N/A * <code>KeyboardFocusManager.BACKWARD_TRAVERSAL_KEYS</code>, 0N/A * <code>KeyboardFocusManager.UP_CYCLE_TRAVERSAL_KEYS</code>, or 0N/A * <code>KeyboardFocusManager.DOWN_CYCLE_TRAVERSAL_KEYS</code>, 0N/A * or if keystrokes is <code>null</code>, 0N/A * or if keystrokes contains <code>null</code>, 0N/A * or if any <code>Object</code> in 0N/A * keystrokes is not an <code>AWTKeyStroke</code>, 0N/A * or if any keystroke 0N/A * represents a <code>KEY_TYPED</code> event, 0N/A * or if any keystroke already maps 0N/A * to another default focus traversal operation 0N/A synchronized (
this) {
0N/A //According to javadoc this method should throw IAE instead of ClassCastException 0N/A // Check to see if key already maps to another traversal 0N/A * Returns a Set of default focus traversal keys for a given traversal 0N/A * operation. This traversal key Set will be in effect on all Windows that 0N/A * have no such Set of their own explicitly defined. This Set will also be 0N/A * inherited, recursively, by any child Component of those Windows that has 0N/A * no such Set of its own explicitly defined. (See 0N/A * <code>setDefaultFocusTraversalKeys</code> for a full description of each 0N/A * @param id one of KeyboardFocusManager.FORWARD_TRAVERSAL_KEYS, 0N/A * KeyboardFocusManager.BACKWARD_TRAVERSAL_KEYS, 0N/A * KeyboardFocusManager.UP_CYCLE_TRAVERSAL_KEYS, or 0N/A * KeyboardFocusManager.DOWN_CYCLE_TRAVERSAL_KEYS 0N/A * @return the <code>Set</code> of <code>AWTKeyStroke</code>s 0N/A * for the specified operation; the <code>Set</code> 0N/A * will be unmodifiable, and may be empty; <code>null</code> 0N/A * will never be returned 0N/A * @see #setDefaultFocusTraversalKeys 0N/A * @see Component#setFocusTraversalKeys 0N/A * @see Component#getFocusTraversalKeys 0N/A * @throws IllegalArgumentException if id is not one of 0N/A * KeyboardFocusManager.FORWARD_TRAVERSAL_KEYS, 0N/A * KeyboardFocusManager.BACKWARD_TRAVERSAL_KEYS, 0N/A * KeyboardFocusManager.UP_CYCLE_TRAVERSAL_KEYS, or 0N/A * KeyboardFocusManager.DOWN_CYCLE_TRAVERSAL_KEYS 0N/A // Okay to return Set directly because it is an unmodifiable view 0N/A * Returns the current focus cycle root, if the current focus cycle root is 0N/A * in the same context as the calling thread. If the focus owner is itself 0N/A * a focus cycle root, then it may be ambiguous as to which Components 0N/A * represent the next and previous Components to focus during normal focus 0N/A * traversal. In that case, the current focus cycle root is used to 0N/A * differentiate among the possibilities. 0N/A * This method is intended to be used only by KeyboardFocusManagers and 0N/A * focus implementations. It is not for general client use. 0N/A * @return the current focus cycle root, or null if the current focus cycle 0N/A * root is not a member of the calling thread's context 0N/A * @see #getGlobalCurrentFocusCycleRoot 0N/A * @see #setGlobalCurrentFocusCycleRoot 0N/A * Returns the current focus cycle root, even if the calling thread is in a 0N/A * different context than the current focus cycle root. If the focus owner 0N/A * is itself a focus cycle root, then it may be ambiguous as to which 0N/A * Components represent the next and previous Components to focus during 0N/A * normal focus traversal. In that case, the current focus cycle root is 0N/A * used to differentiate among the possibilities. 0N/A * This method will throw a SecurityException if this KeyboardFocusManager 0N/A * is not the current KeyboardFocusManager for the calling thread's 0N/A * @return the current focus cycle root, or null if the current focus cycle 0N/A * root is not a member of the calling thread's context 0N/A * @see #getCurrentFocusCycleRoot 0N/A * @see #setGlobalCurrentFocusCycleRoot 0N/A * @throws SecurityException if this KeyboardFocusManager is not the 0N/A * current KeyboardFocusManager for the calling thread's context 0N/A * Sets the current focus cycle root. If the focus owner is itself a focus 0N/A * cycle root, then it may be ambiguous as to which Components represent 0N/A * the next and previous Components to focus during normal focus traversal. 0N/A * In that case, the current focus cycle root is used to differentiate 0N/A * among the possibilities. 0N/A * This method is intended to be used only by KeyboardFocusManagers and 0N/A * focus implementations. It is not for general client use. 0N/A * @param newFocusCycleRoot the new focus cycle root 0N/A * @see #getCurrentFocusCycleRoot 0N/A * @see #getGlobalCurrentFocusCycleRoot 0N/A * Adds a PropertyChangeListener to the listener list. The listener is 0N/A * registered for all bound properties of this class, including the 0N/A * <li>whether the KeyboardFocusManager is currently managing focus 0N/A * for this application or applet's browser context 0N/A * ("managingFocus")</li> 0N/A * <li>the focus owner ("focusOwner")</li> 0N/A * <li>the permanent focus owner ("permanentFocusOwner")</li> 0N/A * <li>the focused Window ("focusedWindow")</li> 0N/A * <li>the active Window ("activeWindow")</li> 0N/A * <li>the default focus traversal policy 0N/A * ("defaultFocusTraversalPolicy")</li> 0N/A * <li>the Set of default FORWARD_TRAVERSAL_KEYS 0N/A * ("forwardDefaultFocusTraversalKeys")</li> 0N/A * <li>the Set of default BACKWARD_TRAVERSAL_KEYS 0N/A * ("backwardDefaultFocusTraversalKeys")</li> 0N/A * <li>the Set of default UP_CYCLE_TRAVERSAL_KEYS 0N/A * ("upCycleDefaultFocusTraversalKeys")</li> 0N/A * <li>the Set of default DOWN_CYCLE_TRAVERSAL_KEYS 0N/A * ("downCycleDefaultFocusTraversalKeys")</li> 0N/A * <li>the current focus cycle root ("currentFocusCycleRoot")</li> 0N/A * If listener is null, no exception is thrown and no action is performed. 0N/A * @param listener the PropertyChangeListener to be added 0N/A * @see #removePropertyChangeListener 0N/A * @see #getPropertyChangeListeners 0N/A * @see #addPropertyChangeListener(java.lang.String,java.beans.PropertyChangeListener) 0N/A synchronized (
this) {
0N/A * Removes a PropertyChangeListener from the listener list. This method 0N/A * should be used to remove the PropertyChangeListeners that were 0N/A * registered for all bound properties of this class. 0N/A * If listener is null, no exception is thrown and no action is performed. 0N/A * @param listener the PropertyChangeListener to be removed 0N/A * @see #addPropertyChangeListener 0N/A * @see #getPropertyChangeListeners 0N/A * @see #removePropertyChangeListener(java.lang.String,java.beans.PropertyChangeListener) 0N/A synchronized (
this) {
0N/A * Returns an array of all the property change listeners 0N/A * registered on this keyboard focus manager. 0N/A * @return all of this keyboard focus manager's 0N/A * <code>PropertyChangeListener</code>s 0N/A * or an empty array if no property change 0N/A * listeners are currently registered 0N/A * @see #addPropertyChangeListener 0N/A * @see #removePropertyChangeListener 0N/A * @see #getPropertyChangeListeners(java.lang.String) 0N/A * Adds a PropertyChangeListener to the listener list for a specific 0N/A * property. The specified property may be user-defined, or one of the 0N/A * <li>whether the KeyboardFocusManager is currently managing focus 0N/A * for this application or applet's browser context 0N/A * ("managingFocus")</li> 0N/A * <li>the focus owner ("focusOwner")</li> 0N/A * <li>the permanent focus owner ("permanentFocusOwner")</li> 0N/A * <li>the focused Window ("focusedWindow")</li> 0N/A * <li>the active Window ("activeWindow")</li> 0N/A * <li>the default focus traversal policy 0N/A * ("defaultFocusTraversalPolicy")</li> 0N/A * <li>the Set of default FORWARD_TRAVERSAL_KEYS 0N/A * ("forwardDefaultFocusTraversalKeys")</li> 0N/A * <li>the Set of default BACKWARD_TRAVERSAL_KEYS 0N/A * ("backwardDefaultFocusTraversalKeys")</li> 0N/A * <li>the Set of default UP_CYCLE_TRAVERSAL_KEYS 0N/A * ("upCycleDefaultFocusTraversalKeys")</li> 0N/A * <li>the Set of default DOWN_CYCLE_TRAVERSAL_KEYS 0N/A * ("downCycleDefaultFocusTraversalKeys")</li> 0N/A * <li>the current focus cycle root ("currentFocusCycleRoot")</li> 0N/A * If listener is null, no exception is thrown and no action is performed. 0N/A * @param propertyName one of the property names listed above 0N/A * @param listener the PropertyChangeListener to be added 0N/A * @see #addPropertyChangeListener(java.beans.PropertyChangeListener) 0N/A * @see #removePropertyChangeListener(java.lang.String,java.beans.PropertyChangeListener) 0N/A * @see #getPropertyChangeListeners(java.lang.String) 0N/A synchronized (
this) {
0N/A * Removes a PropertyChangeListener from the listener list for a specific 0N/A * property. This method should be used to remove PropertyChangeListeners 0N/A * that were registered for a specific bound property. 0N/A * If listener is null, no exception is thrown and no action is performed. 0N/A * @param propertyName a valid property name 0N/A * @param listener the PropertyChangeListener to be removed 0N/A * @see #addPropertyChangeListener(java.lang.String,java.beans.PropertyChangeListener) 0N/A * @see #getPropertyChangeListeners(java.lang.String) 0N/A * @see #removePropertyChangeListener(java.beans.PropertyChangeListener) 0N/A synchronized (
this) {
0N/A * Returns an array of all the <code>PropertyChangeListener</code>s 0N/A * associated with the named property. 0N/A * @return all of the <code>PropertyChangeListener</code>s associated with 0N/A * the named property or an empty array if no such listeners have 0N/A * @see #addPropertyChangeListener(java.lang.String,java.beans.PropertyChangeListener) 0N/A * @see #removePropertyChangeListener(java.lang.String,java.beans.PropertyChangeListener) 0N/A * Fires a PropertyChangeEvent in response to a change in a bound property. 0N/A * The event will be delivered to all registered PropertyChangeListeners. 0N/A * No event will be delivered if oldValue and newValue are the same. 0N/A * @param propertyName the name of the property that has changed 0N/A * @param oldValue the property's previous value 0N/A * @param newValue the property's new value 0N/A * Adds a VetoableChangeListener to the listener list. The listener is 0N/A * registered for all vetoable properties of this class, including the 0N/A * <li>the focus owner ("focusOwner")</li> 0N/A * <li>the permanent focus owner ("permanentFocusOwner")</li> 0N/A * <li>the focused Window ("focusedWindow")</li> 0N/A * <li>the active Window ("activeWindow")</li> 0N/A * If listener is null, no exception is thrown and no action is performed. 0N/A * @param listener the VetoableChangeListener to be added 0N/A * @see #removeVetoableChangeListener 0N/A * @see #getVetoableChangeListeners 0N/A * @see #addVetoableChangeListener(java.lang.String,java.beans.VetoableChangeListener) 0N/A synchronized (
this) {
0N/A * Removes a VetoableChangeListener from the listener list. This method 0N/A * should be used to remove the VetoableChangeListeners that were 0N/A * registered for all vetoable properties of this class. 0N/A * If listener is null, no exception is thrown and no action is performed. 0N/A * @param listener the VetoableChangeListener to be removed 0N/A * @see #addVetoableChangeListener 0N/A * @see #getVetoableChangeListeners 0N/A * @see #removeVetoableChangeListener(java.lang.String,java.beans.VetoableChangeListener) 0N/A synchronized (
this) {
0N/A * Returns an array of all the vetoable change listeners 0N/A * registered on this keyboard focus manager. 0N/A * @return all of this keyboard focus manager's 0N/A * <code>VetoableChangeListener</code>s 0N/A * or an empty array if no vetoable change 0N/A * listeners are currently registered 0N/A * @see #addVetoableChangeListener 0N/A * @see #removeVetoableChangeListener 0N/A * @see #getVetoableChangeListeners(java.lang.String) 0N/A * Adds a VetoableChangeListener to the listener list for a specific 0N/A * property. The specified property may be user-defined, or one of the 0N/A * <li>the focus owner ("focusOwner")</li> 0N/A * <li>the permanent focus owner ("permanentFocusOwner")</li> 0N/A * <li>the focused Window ("focusedWindow")</li> 0N/A * <li>the active Window ("activeWindow")</li> 0N/A * If listener is null, no exception is thrown and no action is performed. 0N/A * @param propertyName one of the property names listed above 0N/A * @param listener the VetoableChangeListener to be added 0N/A * @see #addVetoableChangeListener(java.beans.VetoableChangeListener) 0N/A * @see #removeVetoableChangeListener 0N/A * @see #getVetoableChangeListeners 0N/A synchronized (
this) {
0N/A * Removes a VetoableChangeListener from the listener list for a specific 0N/A * property. This method should be used to remove VetoableChangeListeners 0N/A * that were registered for a specific bound property. 0N/A * If listener is null, no exception is thrown and no action is performed. 0N/A * @param propertyName a valid property name 0N/A * @param listener the VetoableChangeListener to be removed 0N/A * @see #addVetoableChangeListener 0N/A * @see #getVetoableChangeListeners 0N/A * @see #removeVetoableChangeListener(java.beans.VetoableChangeListener) 0N/A synchronized (
this) {
0N/A * Returns an array of all the <code>VetoableChangeListener</code>s 0N/A * associated with the named property. 0N/A * @return all of the <code>VetoableChangeListener</code>s associated with 0N/A * the named property or an empty array if no such listeners have 0N/A * @see #addVetoableChangeListener(java.lang.String,java.beans.VetoableChangeListener) 0N/A * @see #removeVetoableChangeListener(java.lang.String,java.beans.VetoableChangeListener) 0N/A * @see #getVetoableChangeListeners 0N/A * Fires a PropertyChangeEvent in response to a change in a vetoable 0N/A * property. The event will be delivered to all registered 0N/A * VetoableChangeListeners. If a VetoableChangeListener throws a 0N/A * PropertyVetoException, a new event is fired reverting all 0N/A * VetoableChangeListeners to the old value and the exception is then 0N/A * rethrown. No event will be delivered if oldValue and newValue are the 0N/A * @param propertyName the name of the property that has changed 0N/A * @param oldValue the property's previous value 0N/A * @param newValue the property's new value 0N/A * @throws java.beans.PropertyVetoException if a 0N/A * <code>VetoableChangeListener</code> threw 0N/A * <code>PropertyVetoException</code> 0N/A * Adds a KeyEventDispatcher to this KeyboardFocusManager's dispatcher 0N/A * chain. This KeyboardFocusManager will request that each 0N/A * KeyEventDispatcher dispatch KeyEvents generated by the user before 0N/A * finally dispatching the KeyEvent itself. KeyEventDispatchers will be 0N/A * notified in the order in which they were added. Notifications will halt 0N/A * as soon as one KeyEventDispatcher returns <code>true</code> from its 0N/A * <code>dispatchKeyEvent</code> method. There is no limit to the total 0N/A * number of KeyEventDispatchers which can be added, nor to the number of 0N/A * times which a particular KeyEventDispatcher instance can be added. 0N/A * If a null dispatcher is specified, no action is taken and no exception 0N/A * In a multithreaded application, {@link KeyEventDispatcher} behaves 0N/A * the same as other AWT listeners. See 0N/A * >AWT Threading Issues</a> for more details. 0N/A * @param dispatcher the KeyEventDispatcher to add to the dispatcher chain 0N/A * @see #removeKeyEventDispatcher 0N/A synchronized (
this) {
0N/A * Removes a KeyEventDispatcher which was previously added to this 0N/A * KeyboardFocusManager's dispatcher chain. This KeyboardFocusManager 0N/A * cannot itself be removed, unless it was explicitly re-registered via a 0N/A * call to <code>addKeyEventDispatcher</code>. 0N/A * If a null dispatcher is specified, if the specified dispatcher is not 0N/A * in the dispatcher chain, or if this KeyboardFocusManager is specified 0N/A * without having been explicitly re-registered, no action is taken and no 0N/A * exception is thrown. 0N/A * In a multithreaded application, {@link KeyEventDispatcher} behaves 0N/A * the same as other AWT listeners. See 0N/A * >AWT Threading Issues</a> for more details. 0N/A * @param dispatcher the KeyEventDispatcher to remove from the dispatcher 0N/A * @see #addKeyEventDispatcher 0N/A synchronized (
this) {
0N/A * Returns this KeyboardFocusManager's KeyEventDispatcher chain as a List. 0N/A * The List will not include this KeyboardFocusManager unless it was 0N/A * explicitly re-registered via a call to 0N/A * <code>addKeyEventDispatcher</code>. If no other KeyEventDispatchers are 0N/A * registered, implementations are free to return null or a List of length 0N/A * 0. Client code should not assume one behavior over another, nor should 0N/A * it assume that the behavior, once established, will not change. 0N/A * @return a possibly null or empty List of KeyEventDispatchers 0N/A * @see #addKeyEventDispatcher 0N/A * @see #removeKeyEventDispatcher 0N/A * Adds a KeyEventPostProcessor to this KeyboardFocusManager's post- 0N/A * processor chain. After a KeyEvent has been dispatched to and handled by 0N/A * its target, KeyboardFocusManager will request that each 0N/A * KeyEventPostProcessor perform any necessary post-processing as part 0N/A * of the KeyEvent's final resolution. KeyEventPostProcessors 0N/A * will be notified in the order in which they were added; the current 0N/A * KeyboardFocusManager will be notified last. Notifications will halt 0N/A * as soon as one KeyEventPostProcessor returns <code>true</code> from its 0N/A * <code>postProcessKeyEvent</code> method. There is no limit to the the 0N/A * total number of KeyEventPostProcessors that can be added, nor to the 0N/A * number of times that a particular KeyEventPostProcessor instance can be 0N/A * If a null post-processor is specified, no action is taken and no 0N/A * exception is thrown. 0N/A * In a multithreaded application, {@link KeyEventPostProcessor} behaves 0N/A * the same as other AWT listeners. See 0N/A * >AWT Threading Issues</a> for more details. 0N/A * @param processor the KeyEventPostProcessor to add to the post-processor 0N/A * @see #removeKeyEventPostProcessor 0N/A synchronized (
this) {
0N/A * Removes a previously added KeyEventPostProcessor from this 0N/A * KeyboardFocusManager's post-processor chain. This KeyboardFocusManager 0N/A * cannot itself be entirely removed from the chain. Only additional 0N/A * references added via <code>addKeyEventPostProcessor</code> can be 0N/A * If a null post-processor is specified, if the specified post-processor 0N/A * is not in the post-processor chain, or if this KeyboardFocusManager is 0N/A * specified without having been explicitly added, no action is taken and 0N/A * no exception is thrown. 0N/A * In a multithreaded application, {@link KeyEventPostProcessor} behaves 0N/A * the same as other AWT listeners. See 0N/A * >AWT Threading Issues</a> for more details. 0N/A * @param processor the KeyEventPostProcessor to remove from the post- 0N/A * @see #addKeyEventPostProcessor 0N/A synchronized (
this) {
0N/A * Returns this KeyboardFocusManager's KeyEventPostProcessor chain as a 0N/A * List. The List will not include this KeyboardFocusManager unless it was 0N/A * explicitly added via a call to <code>addKeyEventPostProcessor</code>. If 0N/A * no KeyEventPostProcessors are registered, implementations are free to 0N/A * return null or a List of length 0. Client code should not assume one 0N/A * behavior over another, nor should it assume that the behavior, once 0N/A * established, will not change. 0N/A * @return a possibly null or empty List of KeyEventPostProcessors 0N/A * @see #addKeyEventPostProcessor 0N/A * @see #removeKeyEventPostProcessor 0N/A // ATTN: component has a strong reference to window via chain 0N/A // of Component.parent fields. Since WeakHasMap refers to its 0N/A // values strongly, we need to break the strong link from the 0N/A // value (component) back to its key (window). 0N/A // Also clear temporary lost component stored in Window 0N/A * Please be careful changing this method! It is called from 0N/A * javax.swing.JComponent.runInputVerifier() using reflection. 0N/A * This method is called by the AWT event dispatcher requesting that the 0N/A * current KeyboardFocusManager dispatch the specified event on its behalf. 0N/A * It is expected that all KeyboardFocusManagers will dispatch all 0N/A * FocusEvents, all WindowEvents related to focus, and all KeyEvents. 0N/A * These events should be dispatched based on the KeyboardFocusManager's 0N/A * notion of the focus owner and the focused and active Windows, sometimes 0N/A * overriding the source of the specified AWTEvent. Dispatching must be 0N/A * done using <code>redispatchEvent</code> to prevent the AWT event 0N/A * dispatcher from recursively requesting that the KeyboardFocusManager 0N/A * dispatch the event again. If this method returns <code>false</code>, 0N/A * then the AWT event dispatcher will attempt to dispatch the event itself. 0N/A * @param e the AWTEvent to be dispatched 0N/A * @return <code>true</code> if this method dispatched the event; 0N/A * <code>false</code> otherwise 0N/A * @see #redispatchEvent 0N/A * @see #dispatchKeyEvent 0N/A * Redispatches an AWTEvent in such a way that the AWT event dispatcher 0N/A * will not recursively request that the KeyboardFocusManager, or any 0N/A * installed KeyEventDispatchers, dispatch the event again. Client 0N/A * implementations of <code>dispatchEvent</code> and client-defined 0N/A * KeyEventDispatchers must call <code>redispatchEvent(target, e)</code> 0N/A * instead of <code>target.dispatchEvent(e)</code> to dispatch an event. 0N/A * This method is intended to be used only by KeyboardFocusManagers and 0N/A * KeyEventDispatchers. It is not for general client use. 0N/A * @param target the Component to which the event should be dispatched 0N/A * @param e the event to dispatch 0N/A * @see #dispatchEvent 0N/A * @see KeyEventDispatcher 0N/A * Typically this method will be called by <code>dispatchEvent</code> if no 0N/A * other KeyEventDispatcher in the dispatcher chain dispatched the 0N/A * KeyEvent, or if no other KeyEventDispatchers are registered. If an 0N/A * implementation of this method returns <code>false</code>, 0N/A * <code>dispatchEvent</code> may try to dispatch the KeyEvent itself, or 0N/A * may simply return <code>false</code>. If <code>true</code> is returned, 0N/A * <code>dispatchEvent</code> should return <code>true</code> as well. 0N/A * @param e the KeyEvent which the current KeyboardFocusManager has 0N/A * requested that this KeyEventDispatcher dispatch 0N/A * @return <code>true</code> if the KeyEvent was dispatched; 0N/A * <code>false</code> otherwise 0N/A * @see #dispatchEvent 0N/A * This method will be called by <code>dispatchKeyEvent</code>. 0N/A * By default, this method will handle any unconsumed KeyEvents that 0N/A * map to an AWT <code>MenuShortcut</code> by consuming the event 0N/A * and activating the shortcut. 0N/A * @param e the KeyEvent to post-process 0N/A * @return <code>true</code> to indicate that no other 0N/A * KeyEventPostProcessor will be notified of the KeyEvent. 0N/A * @see #dispatchKeyEvent 0N/A * This method initiates a focus traversal operation if and only if the 0N/A * KeyEvent represents a focus traversal key for the specified 0N/A * focusedComponent. It is expected that focusedComponent is the current 0N/A * focus owner, although this need not be the case. If it is not, 0N/A * focus traversal will nevertheless proceed as if focusedComponent 0N/A * were the current focus owner. 0N/A * @param focusedComponent the Component that will be the basis for a focus 0N/A * traversal operation if the specified event represents a focus 0N/A * traversal key for the Component 0N/A * @param e the event that may represent a focus traversal key 0N/A * Called by the AWT to notify the KeyboardFocusManager that it should 0N/A * delay dispatching of KeyEvents until the specified Component becomes 0N/A * the focus owner. If client code requests a focus change, and the AWT 0N/A * determines that this request might be granted by the native windowing 0N/A * system, then the AWT will call this method. It is the responsibility of 0N/A * the KeyboardFocusManager to delay dispatching of KeyEvents with 0N/A * timestamps later than the specified time stamp until the specified 0N/A * Component receives a FOCUS_GAINED event, or the AWT cancels the delay 0N/A * request by invoking <code>dequeueKeyEvents</code> or 0N/A * <code>discardKeyEvents</code>. 0N/A * @param after timestamp of current event, or the current, system time if 0N/A * the current event has no timestamp, or the AWT cannot determine 0N/A * which event is currently being handled 0N/A * @param untilFocused Component which should receive a FOCUS_GAINED event 0N/A * before any pending KeyEvents 0N/A * @see #dequeueKeyEvents 0N/A * @see #discardKeyEvents 0N/A * Called by the AWT to notify the KeyboardFocusManager that it should 0N/A * cancel delayed dispatching of KeyEvents. All KeyEvents which were 0N/A * enqueued because of a call to <code>enqueueKeyEvents</code> with the 0N/A * same timestamp and Component should be released for normal dispatching 0N/A * to the current focus owner. If the given timestamp is less than zero, 0N/A * the outstanding enqueue request for the given Component with the <b> 0N/A * oldest</b> timestamp (if any) should be cancelled. 0N/A * @param after the timestamp specified in the call to 0N/A * <code>enqueueKeyEvents</code>, or any value < 0 0N/A * @param untilFocused the Component specified in the call to 0N/A * <code>enqueueKeyEvents</code> 0N/A * @see #enqueueKeyEvents 0N/A * @see #discardKeyEvents 0N/A * Called by the AWT to notify the KeyboardFocusManager that it should 0N/A * cancel delayed dispatching of KeyEvents. All KeyEvents which were 0N/A * enqueued because of one or more calls to <code>enqueueKeyEvents</code> 0N/A * with the same Component should be discarded. 0N/A * @param comp the Component specified in one or more calls to 0N/A * <code>enqueueKeyEvents</code> 0N/A * @see #enqueueKeyEvents 0N/A * @see #dequeueKeyEvents 0N/A * Focuses the Component after aComponent, typically based on a 0N/A * FocusTraversalPolicy. 0N/A * @param aComponent the Component that is the basis for the focus 0N/A * traversal operation 0N/A * @see FocusTraversalPolicy 0N/A * Focuses the Component before aComponent, typically based on a 0N/A * FocusTraversalPolicy. 0N/A * @param aComponent the Component that is the basis for the focus 0N/A * traversal operation 0N/A * @see FocusTraversalPolicy 0N/A * Moves the focus up one focus traversal cycle. Typically, the focus owner 0N/A * is set to aComponent's focus cycle root, and the current focus cycle 0N/A * root is set to the new focus owner's focus cycle root. If, however, 0N/A * aComponent's focus cycle root is a Window, then typically the focus 0N/A * owner is set to the Window's default Component to focus, and the current 0N/A * focus cycle root is unchanged. 0N/A * @param aComponent the Component that is the basis for the focus 0N/A * traversal operation 0N/A * Moves the focus down one focus traversal cycle. Typically, if 0N/A * aContainer is a focus cycle root, then the focus owner is set to 0N/A * aContainer's default Component to focus, and the current focus cycle 0N/A * root is set to aContainer. If aContainer is not a focus cycle root, then 0N/A * no focus traversal operation occurs. 0N/A * @param aContainer the Container that is the basis for the focus 0N/A * traversal operation 0N/A * Focuses the Component after the current focus owner. 0N/A * Focuses the Component before the current focus owner. 0N/A * Moves the focus up one focus traversal cycle from the current focus 0N/A * owner. Typically, the new focus owner is set to the current focus 0N/A * owner's focus cycle root, and the current focus cycle root is set to the 0N/A * new focus owner's focus cycle root. If, however, the current focus 0N/A * owner's focus cycle root is a Window, then typically the focus owner is 0N/A * set to the focus cycle root's default Component to focus, and the 0N/A * current focus cycle root is unchanged. 0N/A * Moves the focus down one focus traversal cycle from the current focus 0N/A * owner, if and only if the current focus owner is a Container that is a 0N/A * focus cycle root. Typically, the focus owner is set to the current focus 0N/A * owner's default Component to focus, and the current focus cycle root is 0N/A * set to the current focus owner. If the current focus owner is not a 0N/A * Container that is a focus cycle root, then no focus traversal operation 0N/A * Dumps the list of focus requests to stderr 1979N/A log.
fine(
"Assertion (this != HeavyweightFocusRequest.CLEAR_GLOBAL_FOCUS_OWNER) failed");
0N/A // Not a duplicate request 0N/A ",lightweightRequests=";
0N/A * heavyweightRequests is used as a monitor for synchronized changes of 0N/A * currentLightweightRequests, clearingCurrentLightweightRequests and 0N/A // Focus transfers from a lightweight child back to the 0N/A // heavyweight Container should be treated like lightweight 0N/A // Redundant request. 0N/A // 'heavyweight' owns the native focus and there are no pending 0N/A // requests. 'heavyweight' must be a Container and 0N/A // 'descendant' must not be the focus owner. Otherwise, 0N/A // we would never have gotten this far. 0N/A * Indicates whether the native implementation should proceed with a 0N/A * pending, native focus request. Before changing the focus at the native 0N/A * level, the AWT implementation should always call this function for 0N/A * permission. This function will reject the request if a duplicate request 0N/A * preceded it, or if the specified heavyweight Component already owns the 0N/A * focus and no native focus changes are pending. Otherwise, the request 0N/A * will be approved and the focus request list will be updated so that, 0N/A * if necessary, the proper descendant will be focused when the 0N/A * corresponding FOCUS_GAINED event on the heavyweight is received. 0N/A * An implementation must ensure that calls to this method and native 0N/A * focus changes are atomic. If this is not guaranteed, then the ordering 0N/A * of the focus request list may be incorrect, leading to errors in the 0N/A * type-ahead mechanism. Typically this is accomplished by only calling 0N/A * this function from the native event pumping thread, or by holding a 0N/A * global, native lock during invocation. 0N/A // Focus transfers from a lightweight child back to the 0N/A // heavyweight Container should be treated like lightweight 0N/A // Redundant request. 0N/A // 'heavyweight' owns the native focus and there are no pending 0N/A // requests. 'heavyweight' must be a Container and 0N/A // 'descendant' must not be the focus owner. Otherwise, 0N/A // we would never have gotten this far. 0N/A // Fix 5028014. Rolled out. 0N/A // SunToolkit.postPriorityEvent(currentFocusOwnerEvent); 0N/A // Fix 5028014. Rolled out. 0N/A // SunToolkit.postPriorityEvent(newFocusOwnerEvent); 0N/A // 'heavyweight' doesn't have the native focus right now, but 0N/A // if all pending requests were completed, it would. Add 0N/A // descendant to the heavyweight's list of pending 0N/A // lightweight focus transfers. 0N/A // For purposes of computing oldFocusedWindow, we should look at 0N/A // the second to last HeavyweightFocusRequest on the queue iff the 0N/A // last HeavyweightFocusRequest is CLEAR_GLOBAL_FOCUS_OWNER. If 0N/A // there is no second to last HeavyweightFocusRequest, null is an 0N/A // acceptable value. 0N/A * Returns the Window which will be active after processing this request, 0N/A * or null if this is a duplicate request. The active Window is useful 0N/A * because some native platforms do not support setting the native focus 0N/A * owner to null. On these platforms, the obvious choice is to set the 0N/A * focus owner to the focus proxy of the active Window. 0N/A // need to call this out of synchronized block to avoid possible deadlock 0N/A // duplicate request 0N/A * @param ex previously caught exception that may be processed right here, or null 0N/A * @param comp the component to dispatch the event to 0N/A * @param event the event to dispatch to the component 0N/A // The current app context differs from the app context of a focus 0N/A // owner (and all pending lightweight requests), so we do nothing 0N/A // now and wait for a next event. 0N/A * WARNING: This is based on DKFM's logic solely! 0N/A * We allow to trigger restoreFocus() in the dispatching process 0N/A * only if we have the last request to dispatch. If the last request 0N/A * fails, focus will be restored to either the component of the last 0N/A * previously succedded request, or to to the focus owner that was 0N/A * before this clearing proccess. 0N/A * We're not dispatching FOCUS_LOST while the current focus owner is null. 0N/A * But regardless of whether it's null or not, we're clearing ALL the local 0N/A // Any other case represents a failure condition which we did 0N/A // not expect. We need to clearFocusRequestList() and patch up 0N/A // the event as best as possible. 0N/A // if source w/o peer and 0N/A // if source is equal to first lightweight 0N/A // then we should correct source and nativeSource 0N/A // Focus change as a result of a known call to requestFocus(), 0N/A // or known click on a peer focusable heavyweight Component. 0N/A * Since we receive FOCUS_GAINED when current focus 0N/A * owner is not null, correcponding FOCUS_LOST is supposed 0N/A * to be lost. And so, we keep new focus owner 0N/A * to determine synthetic FOCUS_LOST event which will be 0N/A * generated by KeyboardFocusManager for this FOCUS_GAINED. 0N/A * This code based on knowledge of 0N/A * DefaultKeyboardFocusManager's implementation and might 0N/A * be not applicable for another KeyboardFocusManager. 0N/A // 'opposite' will be fixed by 0N/A // DefaultKeyboardFocusManager.realOppositeComponent 0N/A // Special case for FOCUS_GAINED in top-levels 0N/A // If it arrives as the result of activation we should skip it 0N/A // This event will not have appropriate request record and 0N/A // on arrival there will be already some focus owner set. 0N/A }
// end synchronized(heavyweightRequests) 0N/A // Call to KeyboardFocusManager.clearGlobalFocusOwner() 0N/A // Otherwise, fall through to failure case below 0N/A // Focus leaving application 0N/A // Focus change as a result of a known call to requestFocus(), 0N/A // or click on a peer focusable heavyweight Component. 0N/A // If a focus transfer is made across top-levels, then the 0N/A // FOCUS_LOST event is always temporary, and the FOCUS_GAINED 0N/A // event is always permanent. Otherwise, the stored temporary 0N/A // value is honored. 0N/A // If top-level changed there might be no focus request in a list 0N/A // But we know the opposite, we now it is temporary - dispatch the event. 0N/A // Create copy of the event with only difference in temporary parameter. 0N/A }
// end synchronized(heavyweightRequests) 0N/A * This code handles FOCUS_LOST event which is generated by 0N/A * DefaultKeyboardFocusManager for FOCUS_GAINED. 0N/A * This code based on knowledge of DefaultKeyboardFocusManager's 0N/A * implementation and might be not applicable for another 0N/A * KeyboardFocusManager. 0N/A * Clears markers queue 0N/A * This method is not intended to be overridden by KFM's. 0N/A * Only DefaultKeyboardFocusManager can implement it. 0N/A // Fix for 4799136 - clear type-ahead markers if requests queue is empty 0N/A // We do it here because this method is called only when problems happen 0N/A // Fix for 4799136 - clear type-ahead markers if requests queue is empty 0N/A // We do it here because this method is called only when problems happen 0N/A // Accessor to private field isProxyActive of KeyEvent 0N/A // Returns the value of this KeyEvent's field isProxyActive