All Downloads are FREE. Search and download functionalities are using the official Maven repository.

java.awt.KeyboardFocusManager Maven / Gradle / Ivy

There is a newer version: 1.3.1
Show newest version
/*

NOTICE


(c) 2005-2007 Sun Microsystems, Inc. All Rights Reserved.

Neither this file nor any files generated from it describe a complete specification, and they may only be used as described below. For example, no permission is given for you to incorporate this file, in whole or in part, in an implementation of a Java specification.

Sun Microsystems Inc. owns the copyright in this file and it is provided to you for informative, as opposed to normative, use. The file and any files generated from it may be used to generate other informative documentation, such as a unified set of documents of API signatures for a platform that includes technologies expressed as Java APIs. The file may also be used to produce "compilation stubs," which allow applications to be compiled and validated for such platforms.

Any work generated from this file, such as unified javadocs or compiled stub files, must be accompanied by this notice in its entirety.

This work corresponds to the API signatures of JSR 217: Personal Basis Profile 1.1. In the event of a discrepency between this work and the JSR 217 specification, which is available at http://www.jcp.org/en/jsr/detail?id=217, the latter takes precedence. */ package java.awt; import java.beans.*; import java.awt.event.FocusEvent; import java.awt.event.InputEvent; import java.awt.event.KeyEvent; import java.awt.event.WindowEvent; // import java.awt.peer.LightweightPeer; import java.util.Set; import java.util.HashSet; import java.util.Collections; import java.util.Iterator; import java.util.LinkedList; import java.util.ListIterator; import java.util.StringTokenizer; import java.util.WeakHashMap; import java.lang.ref.WeakReference; // import sun.awt.AppContext; // import sun.awt.DebugHelper; // import sun.awt.SunToolkit; // PBP/PP 6214654 /** * The KeyboardFocusManager is responsible for managing the active and focused * Windows, and the current focus owner. The focus owner is defined as the * Component in an application that will typically receive all KeyEvents * generated by the user. The focused Window is the Window that is, or * contains, the focus owner. Only a Frame can be the active * Window. The native windowing system may denote the active Window or its * children with special decorations, such as a highlighted title bar. The * active Window is always either the focused Window, or the first Frame that is an owner of the focused Window. *

* The KeyboardFocusManager is both a centralized location for client code to * query for the focus owner and initiate focus changes, and an event * dispatcher for all FocusEvents, WindowEvents related to focus, and * KeyEvents. *

* Some browsers partition applets in different code bases into separate * contexts, and establish walls between these contexts. In such a scenario, * there will be one KeyboardFocusManager per context. Other browsers place all * applets into the same context, implying that there will be only a single, * global KeyboardFocusManager for all applets. This behavior is * implementation-dependent. Consult your browser's documentation for more * information. No matter how many contexts there may be, however, there can * never be more than one focus owner, focused Window, or active Window, per * ClassLoader. * * @author David Mendenhall * @version 1.40, 01/23/03 * * @see Window * @see Frame * * @see java.awt.event.FocusEvent * @see java.awt.event.WindowEvent * @see java.awt.event.KeyEvent * @since 1.4 */ public abstract class KeyboardFocusManager implements KeyEventDispatcher, KeyEventPostProcessor { /** * The identifier for the Forward focus traversal keys. * * @see #setDefaultFocusTraversalKeys * @see #getDefaultFocusTraversalKeys * @see Component#setFocusTraversalKeys * @see Component#getFocusTraversalKeys */ public static final int FORWARD_TRAVERSAL_KEYS = 0; /** * The identifier for the Backward focus traversal keys. * * @see #setDefaultFocusTraversalKeys * @see #getDefaultFocusTraversalKeys * @see Component#setFocusTraversalKeys * @see Component#getFocusTraversalKeys */ public static final int BACKWARD_TRAVERSAL_KEYS = 1; /** * The identifier for the Up Cycle focus traversal keys. * * @see #setDefaultFocusTraversalKeys * @see #getDefaultFocusTraversalKeys * @see Component#setFocusTraversalKeys * @see Component#getFocusTraversalKeys */ public static final int UP_CYCLE_TRAVERSAL_KEYS = 2; /** * The identifier for the Down Cycle focus traversal keys. * * @see #setDefaultFocusTraversalKeys * @see #getDefaultFocusTraversalKeys * @see Component#setFocusTraversalKeys * @see Component#getFocusTraversalKeys */ public static final int DOWN_CYCLE_TRAVERSAL_KEYS = 3; /** * Initializes a KeyboardFocusManager. */ // public KeyboardFocusManager() { } // PBP/PP // [6203831] // Dummy package-private constructor to hide default public constructor. KeyboardFocusManager() {} // PBP/PP 6203831 // should have been removed for the initial fix for this bug // OK, we spoke to soon, this shouldn't have been removed in // order to fix 6203831, so I am putting it back in // PBP/PP 6216640 /** * Returns the current KeyboardFocusManager instance for the calling * thread's context. * * @return this thread's context's KeyboardFocusManager * */ public static KeyboardFocusManager getCurrentKeyboardFocusManager() { return null; } // PBP/PP 6203831 (removed reference to DefaultKeyboardFM /** * Sets the current KeyboardFocusManager instance for the calling thread's * context. If null is specified, then the current KeyboardFocusManager * is replaced with a new instance of DefaultKeyboardFocusManager. *

* If a SecurityManager is installed, the calling thread must be granted * the AWTPermission "replaceKeyboardFocusManager" in order to replace the * the current KeyboardFocusManager. If this permission is not granted, * this method will throw a SecurityException, and the current * KeyboardFocusManager will be unchanged. * * @param newManager the new KeyboardFocusManager for this thread's context * * @throws SecurityException if the calling thread does not have permission * to replace the current KeyboardFocusManager */ // public static synchronized void // setCurrentKeyboardFocusManager(KeyboardFocusManager newManager) // throws SecurityException // { } // PBP/PP 6203831 removed ref to get/setGlobalFocusOwner /** * Returns the focus owner, if the focus owner is in the same context as * the calling thread. The focus owner is defined as the Component in an * application that will typically receive all KeyEvents generated by the * user. KeyEvents which map to the focus owner's focus traversal keys will * not be delivered if focus traversal keys are enabled for the focus * owner. In addition, KeyEventDispatchers may retarget or consume * KeyEvents before they reach the focus owner. * * @return the focus owner, or null if the focus owner is not a member of * the calling thread's context * */ public Component getFocusOwner() { return null; } // PBP/PP 6203831 removed ref to setGlobalFocusOwner /** * Returns the focus owner, even if the calling thread is in a different * context than the focus owner. The focus owner is defined as the * Component in an application that will typically receive all KeyEvents * generated by the user. KeyEvents which map to the focus owner's focus * traversal keys will not be delivered if focus traversal keys are enabled * for the focus owner. In addition, KeyEventDispatchers may retarget or * consume KeyEvents before they reach the focus owner. *

* This method will throw a SecurityException if this KeyboardFocusManager * is not the current KeyboardFocusManager for the calling thread's * context. * * @return the focus owner * @see #getFocusOwner * * @throws SecurityException if this KeyboardFocusManager is not the * current KeyboardFocusManager for the calling thread's context */ // protected Component getGlobalFocusOwner() throws SecurityException { return null; } // PBP/PP 6203831 removed ref to getGlobalFocusOwner /** * Sets the focus owner. The operation will be cancelled if the Component * is not focusable. The focus owner is defined as the Component in an * application that will typically receive all KeyEvents generated by the * user. KeyEvents which map to the focus owner's focus traversal keys will * not be delivered if focus traversal keys are enabled for the focus * owner. In addition, KeyEventDispatchers may retarget or consume * KeyEvents before they reach the focus owner. *

* This method does not actually set the focus to the specified Component. * It merely stores the value to be subsequently returned by * getFocusOwner(). Use Component.requestFocus() * or Component.requestFocusInWindow() to change the focus * owner, subject to platform limitations. * * @param focusOwner the focus owner * @see #getFocusOwner * * @see Component#requestFocus() * @see Component#requestFocusInWindow() * @see Component#isFocusable * @beaninfo * bound: true */ // protected void setGlobalFocusOwner(Component focusOwner) { } /** * Clears the global focus owner at both the Java and native levels. If * there exists a focus owner, that Component will receive a permanent * FOCUS_LOST event. After this operation completes, the native windowing * system will discard all user-generated KeyEvents until the user selects * a new Component to receive focus, or a Component is given focus * explicitly via a call to requestFocus(). This operation * does not change the focused or active Windows. * * @see Component#requestFocus() * @see java.awt.event.FocusEvent#FOCUS_LOST */ public void clearGlobalFocusOwner() { } // PBP/PP 6203831 removed ref to get/setPermanentFocusOwner /** * Returns the permanent focus owner, if the permanent focus owner is in * the same context as the calling thread. The permanent focus owner is * defined as the last Component in an application to receive a permanent * FOCUS_GAINED event. The focus owner and permanent focus owner are * equivalent unless a temporary focus change is currently in effect. In * such a situation, the permanent focus owner will again be the focus * owner when the temporary focus change ends. * * @return the permanent focus owner, or null if the permanent focus owner * is not a member of the calling thread's context * */ public Component getPermanentFocusOwner() { return null; } // PBP/PP 6203831 removed ref to setGlobalPermanentFocusOwner /** * Returns the permanent focus owner, even if the calling thread is in a * different context than the permanent focus owner. The permanent focus * owner is defined as the last Component in an application to receive a * permanent FOCUS_GAINED event. The focus owner and permanent focus owner * are equivalent unless a temporary focus change is currently in effect. * In such a situation, the permanent focus owner will again be the focus * owner when the temporary focus change ends. *

* This method will throw a SecurityException if this KeyboardFocusManager * is not the current KeyboardFocusManager for the calling thread's * context. * * @return the permanent focus owner * @see #getPermanentFocusOwner * * @throws SecurityException if this KeyboardFocusManager is not the * current KeyboardFocusManager for the calling thread's context */ // protected Component getGlobalPermanentFocusOwner() throws SecurityException // { return null; } /** * Sets the permanent focus owner. The operation will be cancelled if the * Component is not focusable. The permanent focus owner is defined as the * last Component in an application to receive a permanent FOCUS_GAINED * event. The focus owner and permanent focus owner are equivalent unless * a temporary focus change is currently in effect. In such a situation, * the permanent focus owner will again be the focus owner when the * temporary focus change ends. *

* This method does not actually set the focus to the specified Component. * It merely stores the value to be subsequently returned by * getPermanentFocusOwner(). Use * Component.requestFocus() or * Component.requestFocusInWindow() to change the focus owner, * subject to platform limitations. * * @param permanentFocusOwner the permanent focus owner * @see #getPermanentFocusOwner * @see #getGlobalPermanentFocusOwner * @see Component#requestFocus() * @see Component#requestFocusInWindow() * @see Component#isFocusable * @beaninfo * bound: true */ // protected void setGlobalPermanentFocusOwner(Component permanentFocusOwner) // { } /** * Returns the focused Window, if the focused Window is in the same context * as the calling thread. The focused Window is the Window that is or * contains the focus owner. * * @return the focused Window, or null if the focused Window is not a * member of the calling thread's context * */ public Window getFocusedWindow() { return null; } /** * Returns the focused Window, even if the calling thread is in a different * context than the focused Window. The focused Window is the Window that * is or contains the focus owner. *

* This method will throw a SecurityException if this KeyboardFocusManager * is not the current KeyboardFocusManager for the calling thread's * context. * * @return the focused Window * @see #getFocusedWindow * * @throws SecurityException if this KeyboardFocusManager is not the * current KeyboardFocusManager for the calling thread's context */ // protected Window getGlobalFocusedWindow() throws SecurityException { return null; } /** * Sets the focused Window. The focused Window is the Window that is or * contains the focus owner. The operation will be cancelled if the * specified Window to focus is not a focusable Window. *

* This method does not actually change the focused Window as far as the * native windowing system is concerned. It merely stores the value to be * subsequently returned by getFocusedWindow(). Use * Component.requestFocus() or * Component.requestFocusInWindow() to change the focused * Window, subject to platform limitations. * * @param focusedWindow the focused Window * @see #getFocusedWindow * * @see Component#requestFocus() * @see Component#requestFocusInWindow() * @see Window#isFocusableWindow * @beaninfo * bound: true */ // protected void setGlobalFocusedWindow(Window focusedWindow) { } // PBP/PP 6203831 // PBP/PP 6214654 -- remove dialog references -- /** * Returns the active Window, if the active Window is in the same context * as the calling thread. Only a Frame can be the active * Window. The native windowing system may denote the active Window or its * children with special decorations, such as a highlighted title bar. * The active Window is always either the focused Window, or the first * Frame that is an owner of the focused Window. * * @return the active Window, or null if the active Window is not a member * of the calling thread's context * */ public Window getActiveWindow() { return null; } // PBP/PP 6203831 // PBP/PP 6214654 -- remove dialog references -- /** * Returns the active Window, even if the calling thread is in a different * context than the active Window. Only a Frame can be the * active Window. The native windowing system may denote the active Window * or its children with special decorations, such as a highlighted title * bar. The active Window is always either the focused Window, or the first * Frame that is an owner of the focused Window. *

* This method will throw a SecurityException if this KeyboardFocusManager * is not the current KeyboardFocusManager for the calling thread's * context. * * @return the active Window * @see #getActiveWindow * * @throws SecurityException if this KeyboardFocusManager is not the * current KeyboardFocusManager for the calling thread's context */ // protected Window getGlobalActiveWindow() throws SecurityException { return null; } // PBP/PP 6214654 /** * Sets the active Window. Only a Frame can be the active * Window. The native windowing system may denote the active Window or its * children with special decorations, such as a highlighted title bar. The * active Window is always either the focused Window, or the first Frame that is an owner of the focused Window. *

* This method does not actually change the active Window as far as the * native windowing system is concerned. It merely stores the value to be * subsequently returned by getActiveWindow(). Use * Component.requestFocus() or * Component.requestFocusInWindow()to change the active * Window, subject to platform limitations. * * @param activeWindow the active Window * @see #getActiveWindow * @see #getGlobalActiveWindow * @see Component#requestFocus() * @see Component#requestFocusInWindow() * @beaninfo * bound: true */ // protected void setGlobalActiveWindow(Window activeWindow) { } /** * Returns the default FocusTraversalPolicy. Top-level components * use this value on their creation to initialize their own focus traversal * policy by explicit call to Container.setFocusTraversalPolicy. * * @return the default FocusTraversalPolicy. null will never be returned. * @see #setDefaultFocusTraversalPolicy * @see Container#setFocusTraversalPolicy * @see Container#getFocusTraversalPolicy */ public synchronized FocusTraversalPolicy getDefaultFocusTraversalPolicy() {return null; } /** * Sets the default FocusTraversalPolicy. Top-level components * use this value on their creation to initialize their own focus traversal * policy by explicit call to Container.setFocusTraversalPolicy. * Note: this call doesn't affect already created components as they have * their policy initialized. Only new components will use this policy as * their default policy. * * @param defaultPolicy the new, default FocusTraversalPolicy * @see #getDefaultFocusTraversalPolicy * @see Container#setFocusTraversalPolicy * @see Container#getFocusTraversalPolicy * @throws IllegalArgumentException if defaultPolicy is null * @beaninfo * bound: true */ public void setDefaultFocusTraversalPolicy(FocusTraversalPolicy defaultPolicy) { } /** * Sets the default focus traversal keys for a given traversal operation. * This traversal key Set will be in effect on all * Windows that have no such Set of * their own explicitly defined. This Set will also be * inherited, recursively, by any child Component of * those Windows that has * no such Set of its own explicitly defined. *

* The default values for the default focus traversal keys are * implementation-dependent. Sun recommends that all implementations for a * particular native platform use the same default values. The * recommendations for Windows and Unix are listed below. These * recommendations are used in the Sun AWT implementations. * *

* * * * * * * * * * * * * * * * * * * * * * * * * *
IdentifierMeaningDefault
KeyboardFocusManager.FORWARD_TRAVERSAL_KEYSNormal forward keyboard traversalTAB on KEY_PRESSED, * CTRL-TAB on KEY_PRESSED
KeyboardFocusManager.BACKWARD_TRAVERSAL_KEYSNormal reverse keyboard traversalSHIFT-TAB on KEY_PRESSED, * CTRL-SHIFT-TAB on KEY_PRESSED
KeyboardFocusManager.UP_CYCLE_TRAVERSAL_KEYSGo up one focus traversal cyclenone
KeyboardFocusManager.DOWN_CYCLE_TRAVERSAL_KEYSGo down one focus traversal cyclenone
* * To disable a traversal key, use an empty Set; * Collections.EMPTY_SET is recommended. *

* Using the AWTKeyStroke API, client code can * specify on which of two * specific KeyEvents, KEY_PRESSED or * KEY_RELEASED, the focus traversal operation will * occur. Regardless of which KeyEvent is specified, * however, all KeyEvents related to the focus * traversal key, including the associated KEY_TYPED * event, will be consumed, and will not be dispatched * to any Component. It is a runtime error to * specify a KEY_TYPED event as * mapping to a focus traversal operation, or to map the same event to * multiple default focus traversal operations. * * @param id one of * KeyboardFocusManager.FORWARD_TRAVERSAL_KEYS, * KeyboardFocusManager.BACKWARD_TRAVERSAL_KEYS, * KeyboardFocusManager.UP_CYCLE_TRAVERSAL_KEYS, or * KeyboardFocusManager.DOWN_CYCLE_TRAVERSAL_KEYS * @param keystrokes the Set of AWTKeyStrokes for the * specified operation * @see #getDefaultFocusTraversalKeys * @see Component#setFocusTraversalKeys * @see Component#getFocusTraversalKeys * @throws IllegalArgumentException if id is not one of * KeyboardFocusManager.FORWARD_TRAVERSAL_KEYS, * KeyboardFocusManager.BACKWARD_TRAVERSAL_KEYS, * KeyboardFocusManager.UP_CYCLE_TRAVERSAL_KEYS, or * KeyboardFocusManager.DOWN_CYCLE_TRAVERSAL_KEYS, * or if keystrokes is null, * or if keystrokes contains null, * or if any Object in * keystrokes is not an AWTKeyStroke, * or if any keystroke * represents a KEY_TYPED event, * or if any keystroke already maps * to another default focus traversal operation * @beaninfo * bound: true */ public void setDefaultFocusTraversalKeys(int id, Set keystrokes) { } /** * Returns a Set of default focus traversal keys for a given traversal * operation. This traversal key Set will be in effect on all Windows that * have no such Set of their own explicitly defined. This Set will also be * inherited, recursively, by any child Component of those Windows that has * no such Set of its own explicitly defined. (See * setDefaultFocusTraversalKeys for a full description of each * operation.) * * @param id one of KeyboardFocusManager.FORWARD_TRAVERSAL_KEYS, * KeyboardFocusManager.BACKWARD_TRAVERSAL_KEYS, * KeyboardFocusManager.UP_CYCLE_TRAVERSAL_KEYS, or * KeyboardFocusManager.DOWN_CYCLE_TRAVERSAL_KEYS * @return the Set of AWTKeyStrokes * for the specified operation; the Set * will be unmodifiable, and may be empty; null * will never be returned * @see #setDefaultFocusTraversalKeys * @see Component#setFocusTraversalKeys * @see Component#getFocusTraversalKeys * @throws IllegalArgumentException if id is not one of * KeyboardFocusManager.FORWARD_TRAVERSAL_KEYS, * KeyboardFocusManager.BACKWARD_TRAVERSAL_KEYS, * KeyboardFocusManager.UP_CYCLE_TRAVERSAL_KEYS, or * KeyboardFocusManager.DOWN_CYCLE_TRAVERSAL_KEYS */ public Set getDefaultFocusTraversalKeys(int id) { return null; } // PBP/PP // [6238153] /** * Returns the current focus cycle root, if the current focus cycle root is * in the same context as the calling thread. If the focus owner is itself * a focus cycle root, then it may be ambiguous as to which Components * represent the next and previous Components to focus during normal focus * traversal. In that case, the current focus cycle root is used to * differentiate among the possibilities. * * * @return the current focus cycle root, or null if the current focus cycle * root is not a member of the calling thread's context * */ public Container getCurrentFocusCycleRoot() { return null; } // PBP/PP 6203831 removed ref to *GlobalCurrentFocusCycleRoot /** * Returns the current focus cycle root, even if the calling thread is in a * different context than the current focus cycle root. If the focus owner * is itself a focus cycle root, then it may be ambiguous as to which * Components represent the next and previous Components to focus during * normal focus traversal. In that case, the current focus cycle root is * used to differentiate among the possibilities. *

* This method will throw a SecurityException if this KeyboardFocusManager * is not the current KeyboardFocusManager for the calling thread's * context. * * @return the current focus cycle root, or null if the current focus cycle * root is not a member of the calling thread's context * @see #getCurrentFocusCycleRoot * * @throws SecurityException if this KeyboardFocusManager is not the * current KeyboardFocusManager for the calling thread's context */ // protected Container getGlobalCurrentFocusCycleRoot() // throws SecurityException // { return null; } // PBP/PP 6203831 removed ref to *GlobalCurrentFocusCycleRoot /** * Sets the current focus cycle root. If the focus owner is itself a focus * cycle root, then it may be ambiguous as to which Components represent * the next and previous Components to focus during normal focus traversal. * In that case, the current focus cycle root is used to differentiate * among the possibilities. *

* This method is intended to be used only by KeyboardFocusManagers and * focus implementations. It is not for general client use. * * @param newFocusCycleRoot the new focus cycle root * @see #getCurrentFocusCycleRoot * * @beaninfo * bound: true */ // public void setGlobalCurrentFocusCycleRoot(Container newFocusCycleRoot) { } // PBP/PP 6203831 /** * Adds a PropertyChangeListener to the listener list. The listener is * registered for all bound properties of this class, including the * following: *

    *
  • the focus owner ("focusOwner")
  • *
  • the permanent focus owner ("permanentFocusOwner")
  • *
  • the focused Window ("focusedWindow")
  • *
  • the active Window ("activeWindow")
  • *
  • the default focus traversal policy * ("defaultFocusTraversalPolicy")
  • *
  • the Set of default FORWARD_TRAVERSAL_KEYS * ("forwardDefaultFocusTraversalKeys")
  • *
  • the Set of default BACKWARD_TRAVERSAL_KEYS * ("backwardDefaultFocusTraversalKeys")
  • *
  • the Set of default UP_CYCLE_TRAVERSAL_KEYS * ("upCycleDefaultFocusTraversalKeys")
  • *
  • the Set of default DOWN_CYCLE_TRAVERSAL_KEYS * ("downCycleDefaultFocusTraversalKeys")
  • *
  • the current focus cycle root ("currentFocusCycleRoot")
  • *
* If listener is null, no exception is thrown and no action is performed. * * @param listener the PropertyChangeListener to be added * @see #removePropertyChangeListener * @see #getPropertyChangeListeners * */ public void addPropertyChangeListener(PropertyChangeListener listener) { } // PBP/PP removed broken ref /** * Removes a PropertyChangeListener from the listener list. This method * should be used to remove the PropertyChangeListeners that were * registered for all bound properties of this class. *

* If listener is null, no exception is thrown and no action is performed. * * @param listener the PropertyChangeListener to be removed * @see #addPropertyChangeListener * @see #getPropertyChangeListeners * */ public void removePropertyChangeListener(PropertyChangeListener listener) { } // PBP/PP 6203831 /** * Returns an array of all the property change listeners * registered on this keyboard focus manager. * * @return all of this keyboard focus manager's * PropertyChangeListeners * or an empty array if no property change * listeners are currently registered * * @see #addPropertyChangeListener * @see #removePropertyChangeListener * * @since 1.4 */ public synchronized PropertyChangeListener[] getPropertyChangeListeners() {return null; } /** * Adds a PropertyChangeListener to the listener list for a specific * property. The specified property may be user-defined, or one of the * following: *

    *
  • the focus owner ("focusOwner")
  • *
  • the permanent focus owner ("permanentFocusOwner")
  • *
  • the focused Window ("focusedWindow")
  • *
  • the active Window ("activeWindow")
  • *
  • the default focus traversal policy * ("defaultFocusTraversalPolicy")
  • *
  • the Set of default FORWARD_TRAVERSAL_KEYS * ("forwardDefaultFocusTraversalKeys")
  • *
  • the Set of default BACKWARD_TRAVERSAL_KEYS * ("backwardDefaultFocusTraversalKeys")
  • *
  • the Set of default UP_CYCLE_TRAVERSAL_KEYS * ("upCycleDefaultFocusTraversalKeys")
  • *
  • the Set of default DOWN_CYCLE_TRAVERSAL_KEYS * ("downCycleDefaultFocusTraversalKeys")
  • *
  • the current focus cycle root ("currentFocusCycleRoot")
  • *
* If listener is null, no exception is thrown and no action is performed. * * @param propertyName one of the property names listed above * @param listener the PropertyChangeListener to be added * @see #addPropertyChangeListener(java.beans.PropertyChangeListener) * @see #removePropertyChangeListener(java.lang.String,java.beans.PropertyChangeListener) * @see #getPropertyChangeListeners(java.lang.String) */ // public void addPropertyChangeListener(String propertyName, // PropertyChangeListener listener) // { } /** * Removes a PropertyChangeListener from the listener list for a specific * property. This method should be used to remove PropertyChangeListeners * that were registered for a specific bound property. *

* If listener is null, no exception is thrown and no action is performed. * * @param propertyName a valid property name * @param listener the PropertyChangeListener to be removed * @see #addPropertyChangeListener(java.lang.String,java.beans.PropertyChangeListener) * @see #getPropertyChangeListeners(java.lang.String) * @see #removePropertyChangeListener(java.beans.PropertyChangeListener) */ // public void removePropertyChangeListener(String propertyName, // PropertyChangeListener listener) // { } /** * Returns an array of all the PropertyChangeListeners * associated with the named property. * * @return all of the PropertyChangeListeners associated with * the named property or an empty array if no such listeners have * been added. * * @see #addPropertyChangeListener(java.lang.String,java.beans.PropertyChangeListener) * @see #removePropertyChangeListener(java.lang.String,java.beans.PropertyChangeListener) * @since 1.4 */ // public synchronized PropertyChangeListener[] // getPropertyChangeListeners(String propertyName) // { return null; } /** * Fires a PropertyChangeEvent in response to a change in a bound property. * The event will be delivered to all registered PropertyChangeListeners. * No event will be delivered if oldValue and newValue are the same. * * @param propertyName the name of the property that has changed * @param oldValue the property's previous value * @param newValue the property's new value */ // protected void firePropertyChange(String propertyName, Object oldValue, // Object newValue) // { } // PBP/PP 6203831 /** * Adds a VetoableChangeListener to the listener list. The listener is * registered for all vetoable properties of this class, including the * following: *

    *
  • the focus owner ("focusOwner")
  • *
  • the permanent focus owner ("permanentFocusOwner")
  • *
  • the focused Window ("focusedWindow")
  • *
  • the active Window ("activeWindow")
  • *
* If listener is null, no exception is thrown and no action is performed. * * @param listener the VetoableChangeListener to be added * @see #removeVetoableChangeListener * @see #getVetoableChangeListeners * */ public void addVetoableChangeListener(VetoableChangeListener listener) { } // PBP/PP 6203831 /** * Removes a VetoableChangeListener from the listener list. This method * should be used to remove the VetoableChangeListeners that were * registered for all vetoable properties of this class. *

* If listener is null, no exception is thrown and no action is performed. * * @param listener the VetoableChangeListener to be removed * @see #addVetoableChangeListener * @see #getVetoableChangeListeners * */ public void removeVetoableChangeListener(VetoableChangeListener listener) { } // PBP/PP 6203831 /** * Returns an array of all the vetoable change listeners * registered on this keyboard focus manager. * * @return all of this keyboard focus manager's * VetoableChangeListeners * or an empty array if no vetoable change * listeners are currently registered * * @see #addVetoableChangeListener * @see #removeVetoableChangeListener * * @since 1.4 */ public synchronized VetoableChangeListener[] getVetoableChangeListeners() { return null; } /** * Adds a VetoableChangeListener to the listener list for a specific * property. The specified property may be user-defined, or one of the * following: *

    *
  • the focus owner ("focusOwner")
  • *
  • the permanent focus owner ("permanentFocusOwner")
  • *
  • the focused Window ("focusedWindow")
  • *
  • the active Window ("activeWindow")
  • *
* If listener is null, no exception is thrown and no action is performed. * * @param propertyName one of the property names listed above * @param listener the VetoableChangeListener to be added * @see #addVetoableChangeListener(java.beans.VetoableChangeListener) * @see #removeVetoableChangeListener * @see #getVetoableChangeListeners */ // public void addVetoableChangeListener(String propertyName, // VetoableChangeListener listener) // { } /** * Removes a VetoableChangeListener from the listener list for a specific * property. This method should be used to remove VetoableChangeListeners * that were registered for a specific bound property. *

* If listener is null, no exception is thrown and no action is performed. * * @param propertyName a valid property name * @param listener the VetoableChangeListener to be removed * @see #addVetoableChangeListener * @see #getVetoableChangeListeners * @see #removeVetoableChangeListener(java.beans.VetoableChangeListener) */ // public void removeVetoableChangeListener(String propertyName, // VetoableChangeListener listener) // { } /** * Returns an array of all the VetoableChangeListeners * associated with the named property. * * @return all of the VetoableChangeListeners associated with * the named property or an empty array if no such listeners have * been added. * * @see #addVetoableChangeListener(java.lang.String,java.beans.VetoableChangeListener) * @see #removeVetoableChangeListener(java.lang.String,java.beans.VetoableChangeListener) * @see #getVetoableChangeListeners * @since 1.4 */ // public synchronized VetoableChangeListener[] // getVetoableChangeListeners(String propertyName) // { return null; } /** * Fires a PropertyChangeEvent in response to a change in a vetoable * property. The event will be delivered to all registered * VetoableChangeListeners. If a VetoableChangeListener throws a * PropertyVetoException, a new event is fired reverting all * VetoableChangeListeners to the old value and the exception is then * rethrown. No event will be delivered if oldValue and newValue are the * same. * * @param propertyName the name of the property that has changed * @param oldValue the property's previous value * @param newValue the property's new value * @throws java.beans.PropertyVetoException if a * VetoableChangeListener threw * PropertyVetoException */ // protected void fireVetoableChange(String propertyName, Object oldValue, // Object newValue) throws PropertyVetoException // { } /** * Adds a KeyEventDispatcher to this KeyboardFocusManager's dispatcher * chain. This KeyboardFocusManager will request that each * KeyEventDispatcher dispatch KeyEvents generated by the user before * finally dispatching the KeyEvent itself. KeyEventDispatchers will be * notified in the order in which they were added. Notifications will halt * as soon as one KeyEventDispatcher returns true from its * dispatchKeyEvent method. There is no limit to the total * number of KeyEventDispatchers which can be added, nor to the number of * times which a particular KeyEventDispatcher instance can be added. *

* If a null dispatcher is specified, no action is taken and no exception * is thrown. * * @param dispatcher the KeyEventDispatcher to add to the dispatcher chain * @see #removeKeyEventDispatcher */ public void addKeyEventDispatcher(KeyEventDispatcher dispatcher) { } /** * Removes a KeyEventDispatcher which was previously added to this * KeyboardFocusManager's dispatcher chain. This KeyboardFocusManager * cannot itself be removed, unless it was explicitly re-registered via a * call to addKeyEventDispatcher. *

* If a null dispatcher is specified, if the specified dispatcher is not * in the dispatcher chain, or if this KeyboardFocusManager is specified * without having been explicitly re-registered, no action is taken and no * exception is thrown. * * @param dispatcher the KeyEventDispatcher to remove from the dispatcher * chain * @see #addKeyEventDispatcher */ public void removeKeyEventDispatcher(KeyEventDispatcher dispatcher) { } /** * Returns this KeyboardFocusManager's KeyEventDispatcher chain as a List. * The List will not include this KeyboardFocusManager unless it was * explicitly re-registered via a call to * addKeyEventDispatcher. If no other KeyEventDispatchers are * registered, implementations are free to return null or a List of length * 0. Client code should not assume one behavior over another, nor should * it assume that the behavior, once established, will not change. * * @return a possibly null or empty List of KeyEventDispatchers * @see #addKeyEventDispatcher * @see #removeKeyEventDispatcher */ // protected synchronized java.util.List getKeyEventDispatchers() { return null; } /** * Adds a KeyEventPostProcessor to this KeyboardFocusManager's post- * processor chain. After a KeyEvent has been dispatched to and handled by * its target, KeyboardFocusManager will request that each * KeyEventPostProcessor perform any necessary post-processing as part * of the KeyEvent's final resolution. KeyEventPostProcessors * will be notified in the order in which they were added; the current * KeyboardFocusManager will be notified last. Notifications will halt * as soon as one KeyEventPostProcessor returns true from its * postProcessKeyEvent method. There is no limit to the the * total number of KeyEventPostProcessors that can be added, nor to the * number of times that a particular KeyEventPostProcessor instance can be * added. *

* If a null post-processor is specified, no action is taken and no * exception is thrown. * * @param processor the KeyEventPostProcessor to add to the post-processor * chain * @see #removeKeyEventPostProcessor */ public void addKeyEventPostProcessor(KeyEventPostProcessor processor) { } /** * Removes a previously added KeyEventPostProcessor from this * KeyboardFocusManager's post-processor chain. This KeyboardFocusManager * cannot itself be entirely removed from the chain. Only additional * references added via addKeyEventPostProcessor can be * removed. *

* If a null post-processor is specified, if the specified post-processor * is not in the post-processor chain, or if this KeyboardFocusManager is * specified without having been explicitly added, no action is taken and * no exception is thrown. * * @param processor the KeyEventPostProcessor to remove from the post- * processor chain * @see #addKeyEventPostProcessor */ public void removeKeyEventPostProcessor(KeyEventPostProcessor processor) { } /** * Returns this KeyboardFocusManager's KeyEventPostProcessor chain as a * List. The List will not include this KeyboardFocusManager unless it was * explicitly added via a call to addKeyEventPostProcessor. If * no KeyEventPostProcessors are registered, implementations are free to * return null or a List of length 0. Client code should not assume one * behavior over another, nor should it assume that the behavior, once * established, will not change. * * @return a possibly null or empty List of KeyEventPostProcessors * @see #addKeyEventPostProcessor * @see #removeKeyEventPostProcessor */ // protected java.util.List getKeyEventPostProcessors() { return null; } /** * This method is called by the AWT event dispatcher requesting that the * current KeyboardFocusManager dispatch the specified event on its behalf. * It is expected that all KeyboardFocusManagers will dispatch all * FocusEvents, all WindowEvents related to focus, and all KeyEvents. * These events should be dispatched based on the KeyboardFocusManager's * notion of the focus owner and the focused and active Windows, sometimes * overriding the source of the specified AWTEvent. Dispatching must be * done using redispatchEvent to prevent the AWT event * dispatcher from recursively requesting that the KeyboardFocusManager * dispatch the event again. If this method returns false, * then the AWT event dispatcher will attempt to dispatch the event itself. * * @param e the AWTEvent to be dispatched * @return true if this method dispatched the event; * false otherwise * @see #redispatchEvent * @see #dispatchKeyEvent */ public abstract boolean dispatchEvent(AWTEvent e); /** * Redispatches an AWTEvent in such a way that the AWT event dispatcher * will not recursively request that the KeyboardFocusManager, or any * installed KeyEventDispatchers, dispatch the event again. Client * implementations of dispatchEvent and client-defined * KeyEventDispatchers must call redispatchEvent(target, e) * instead of target.dispatchEvent(e) to dispatch an event. *

* This method is intended to be used only by KeyboardFocusManagers and * KeyEventDispatchers. It is not for general client use. * * @param target the Component to which the event should be dispatched * @param e the event to dispatch * @see #dispatchEvent * @see KeyEventDispatcher */ public final void redispatchEvent(Component target, AWTEvent e) { } /** * Typically this method will be called by dispatchEvent if no * other KeyEventDispatcher in the dispatcher chain dispatched the * KeyEvent, or if no other KeyEventDispatchers are registered. If an * implementation of this method returns false, * dispatchEvent may try to dispatch the KeyEvent itself, or * may simply return false. If true is returned, * dispatchEvent should return true as well. * * @param e the KeyEvent which the current KeyboardFocusManager has * requested that this KeyEventDispatcher dispatch * @return true if the KeyEvent was dispatched; * false otherwise * @see #dispatchEvent */ public abstract boolean dispatchKeyEvent(KeyEvent e); // PBP/PP 6214663 // PBP/PP 6217646 /** * This method will be called by dispatchKeyEvent. * By default, this method will handle any unconsumed KeyEvents by consuming the event * . * * @param e the KeyEvent to post-process * @return true to indicate that no other * KeyEventPostProcessor will be notified of the KeyEvent. * @see #dispatchKeyEvent * */ public abstract boolean postProcessKeyEvent(KeyEvent e); /** * This method initiates a focus traversal operation if and only if the * KeyEvent represents a focus traversal key for the specified * focusedComponent. It is expected that focusedComponent is the current * focus owner, although this need not be the case. If it is not, * focus traversal will nevertheless proceed as if focusedComponent * were the current focus owner. * * @param focusedComponent the Component that will be the basis for a focus * traversal operation if the specified event represents a focus * traversal key for the Component * @param e the event that may represent a focus traversal key */ public abstract void processKeyEvent(Component focusedComponent, KeyEvent e); /** * Called by the AWT to notify the KeyboardFocusManager that it should * delay dispatching of KeyEvents until the specified Component becomes * the focus owner. If client code requests a focus change, and the AWT * determines that this request might be granted by the native windowing * system, then the AWT will call this method. It is the responsibility of * the KeyboardFocusManager to delay dispatching of KeyEvents with * timestamps later than the specified time stamp until the specified * Component receives a FOCUS_GAINED event, or the AWT cancels the delay * request by invoking dequeueKeyEvents or * discardKeyEvents. * * @param after timestamp of current event, or the current, system time if * the current event has no timestamp, or the AWT cannot determine * which event is currently being handled * @param untilFocused Component which should receive a FOCUS_GAINED event * before any pending KeyEvents * @see #dequeueKeyEvents * @see #discardKeyEvents */ // protected abstract void enqueueKeyEvents(long after, Component // untilFocused); /** * Called by the AWT to notify the KeyboardFocusManager that it should * cancel delayed dispatching of KeyEvents. All KeyEvents which were * enqueued because of a call to enqueueKeyEvents with the * same timestamp and Component should be released for normal dispatching * to the current focus owner. If the given timestamp is less than zero, * the outstanding enqueue request for the given Component with the * oldest timestamp (if any) should be cancelled. * * @param after the timestamp specified in the call to * enqueueKeyEvents, or any value < 0 * @param untilFocused the Component specified in the call to * enqueueKeyEvents * @see #enqueueKeyEvents * @see #discardKeyEvents */ // protected abstract void dequeueKeyEvents(long after, Component // untilFocused); /** * Called by the AWT to notify the KeyboardFocusManager that it should * cancel delayed dispatching of KeyEvents. All KeyEvents which were * enqueued because of one or more calls to enqueueKeyEvents * with the same Component should be discarded. * * @param comp the Component specified in one or more calls to * enqueueKeyEvents * @see #enqueueKeyEvents * @see #dequeueKeyEvents */ // protected abstract void discardKeyEvents(Component comp); /** * Focuses the Component after aComponent, typically based on a * FocusTraversalPolicy. * * @param aComponent the Component that is the basis for the focus * traversal operation * @see FocusTraversalPolicy */ public abstract void focusNextComponent(Component aComponent); /** * Focuses the Component before aComponent, typically based on a * FocusTraversalPolicy. * * @param aComponent the Component that is the basis for the focus * traversal operation * @see FocusTraversalPolicy */ public abstract void focusPreviousComponent(Component aComponent); /** * Moves the focus up one focus traversal cycle. Typically, the focus owner * is set to aComponent's focus cycle root, and the current focus cycle * root is set to the new focus owner's focus cycle root. If, however, * aComponent's focus cycle root is a Window, then typically the focus * owner is set to the Window's default Component to focus, and the current * focus cycle root is unchanged. * * @param aComponent the Component that is the basis for the focus * traversal operation */ public abstract void upFocusCycle(Component aComponent); /** * Moves the focus down one focus traversal cycle. Typically, if * aContainer is a focus cycle root, then the focus owner is set to * aContainer's default Component to focus, and the current focus cycle * root is set to aContainer. If aContainer is not a focus cycle root, then * no focus traversal operation occurs. * * @param aContainer the Container that is the basis for the focus * traversal operation */ public abstract void downFocusCycle(Container aContainer); /** * Focuses the Component after the current focus owner. */ public final void focusNextComponent() { } /** * Focuses the Component before the current focus owner. */ public final void focusPreviousComponent() { } /** * Moves the focus up one focus traversal cycle from the current focus * owner. Typically, the new focus owner is set to the current focus * owner's focus cycle root, and the current focus cycle root is set to the * new focus owner's focus cycle root. If, however, the current focus * owner's focus cycle root is a Window, then typically the focus owner is * set to the focus cycle root's default Component to focus, and the * current focus cycle root is unchanged. */ public final void upFocusCycle() { } /** * Moves the focus down one focus traversal cycle from the current focus * owner, if and only if the current focus owner is a Container that is a * focus cycle root. Typically, the focus owner is set to the current focus * owner's default Component to focus, and the current focus cycle root is * set to the current focus owner. If the current focus owner is not a * Container that is a focus cycle root, then no focus traversal operation * occurs. */ public final void downFocusCycle() { } }





© 2015 - 2024 Weber Informatics LLC | Privacy Policy