| Modifier and Type | Field and Description |
|---|---|
| private final KeyboardFocusManager |
| Access | Constructor and Description |
|---|---|
| pack-priv |
| Modifier and Type | Method and Description |
|---|---|
| public void | addKeyEventDispatcher(KeyEventDispatcher dispatcher)
Overrides java. Adds a KeyEventDispatcher to this KeyboardFocusManager's dispatcher chain. |
| public void | addPropertyChangeListener(PropertyChangeListener listener)
Overrides java. Adds a PropertyChangeListener to the listener list. |
| public void | addPropertyChangeListener(String propertyName, PropertyChangeListener listener)
Overrides java. Adds a PropertyChangeListener to the listener list for a specific property. |
| public void | addVetoableChangeListener(VetoableChangeListener listener)
Overrides java. Adds a VetoableChangeListener to the listener list. |
| public void | addVetoableChangeListener(String propertyName, VetoableChangeListener listener)
Overrides java. Adds a VetoableChangeListener to the listener list for a specific property. |
| public void | clearGlobalFocusOwner()
Overrides java. Clears the global focus owner at both the Java and native levels. |
| public boolean | dispatchEvent(AWTEvent e)
Overrides java. This method is called by the AWT event dispatcher requesting that the current KeyboardFocusManager dispatch the specified event on its behalf. |
| public boolean | dispatchKeyEvent(KeyEvent e)
Overrides java. Implements java. Called by |
| public void | downFocusCycle(Container aContainer)
Overrides java. Moves the focus down one focus traversal cycle. |
| public void | focusNextComponent(Component aComponent)
Overrides java. Focuses the Component after aComponent, typically based on a FocusTraversalPolicy. |
| public void | focusPreviousComponent(Component aComponent)
Overrides java. Focuses the Component before aComponent, typically based on a FocusTraversalPolicy. |
| public Window | getActiveWindow()
Overrides java. Returns the active Window. |
| public Container | getCurrentFocusCycleRoot()
Overrides java. Returns the current focus cycle root, if the current focus cycle root is in the same context as the calling thread. |
| public Set | getDefaultFocusTraversalKeys(int id)
Overrides java. Returns a Set of default focus traversal keys for a given traversal operation. |
| public FocusTraversalPolicy | getDefaultFocusTraversalPolicy()
Overrides java. Returns the default FocusTraversalPolicy. |
| pack-priv KeyboardFocusManager | |
| public Window | getFocusedWindow()
Overrides java. Returns the focused Window. |
| public Component | getFocusOwner()
Overrides java. Returns the focus owner, if the focus owner is in the same context as the calling thread. |
| public Component | getPermanentFocusOwner()
Overrides java. Returns the permanent focus owner. |
| public void | processKeyEvent(Component focusedComponent, KeyEvent e)
Overrides java. This method initiates a focus traversal operation if and only if the KeyEvent represents a focus traversal key for the specified focusedComponent. |
| public void | removeKeyEventDispatcher(KeyEventDispatcher dispatcher)
Overrides java. Removes a KeyEventDispatcher which was previously added to this KeyboardFocusManager's dispatcher chain. |
| public void | removePropertyChangeListener(PropertyChangeListener listener)
Overrides java. Removes a PropertyChangeListener from the listener list. |
| public void | removePropertyChangeListener(String propertyName, PropertyChangeListener listener)
Overrides java. Removes a PropertyChangeListener from the listener list for a specific property. |
| public void | removeVetoableChangeListener(VetoableChangeListener listener)
Overrides java. Removes a VetoableChangeListener from the listener list. |
| public void | removeVetoableChangeListener(String propertyName, VetoableChangeListener listener)
Overrides java. Removes a VetoableChangeListener from the listener list for a specific property. |
| public void | setDefaultFocusTraversalKeys(int id, Set<? extends AWTKeyStroke> keystrokes)
Overrides java. Sets the default focus traversal keys for a given traversal operation. |
| public void | setDefaultFocusTraversalPolicy(FocusTraversalPolicy defaultPolicy)
Overrides java. Sets the default FocusTraversalPolicy. |
| public void | setGlobalCurrentFocusCycleRoot(Container newFocusCycleRoot)
Overrides java. Sets the current focus cycle root. |
| public void | upFocusCycle(Component aComponent)
Overrides java. Moves the focus up one focus traversal cycle. |
| delegate | back to summary |
|---|---|
| private final KeyboardFocusManager delegate | |
| DelegatingDefaultFocusManager | back to summary |
|---|---|
| pack-priv DelegatingDefaultFocusManager(KeyboardFocusManager delegate) | |
| addKeyEventDispatcher | back to summary |
|---|---|
| public void addKeyEventDispatcher(KeyEventDispatcher dispatcher) Overrides java. Doc from java. 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 If a null dispatcher is specified, no action is taken and no exception is thrown.
In a multithreaded application, | |
| addPropertyChangeListener | back to summary |
|---|---|
| public void addPropertyChangeListener(PropertyChangeListener listener) Overrides java. Doc from java. Adds a PropertyChangeListener to the listener list. The listener is registered for all bound properties of this class, including the following:
| |
| addPropertyChangeListener | back to summary |
|---|---|
| public void addPropertyChangeListener(String propertyName, PropertyChangeListener listener) Overrides java. Doc from java. Adds a PropertyChangeListener to the listener list for a specific property. The specified property may be user-defined, or one of the following:
| |
| addVetoableChangeListener | back to summary |
|---|---|
| public void addVetoableChangeListener(VetoableChangeListener listener) Overrides java. Doc from java. Adds a VetoableChangeListener to the listener list. The listener is registered for all vetoable properties of this class, including the following:
| |
| addVetoableChangeListener | back to summary |
|---|---|
| public void addVetoableChangeListener(String propertyName, VetoableChangeListener listener) Overrides java. Doc from java. Adds a VetoableChangeListener to the listener list for a specific property. The specified property may be user-defined, or one of the following:
| |
| clearGlobalFocusOwner | back to summary |
|---|---|
| public void clearGlobalFocusOwner() Overrides java. Doc from java. 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 This method is intended to be used only by KeyboardFocusManager set as current KeyboardFocusManager for the calling thread's context. It is not for general client use. | |
| dispatchEvent | back to summary |
|---|---|
| public boolean dispatchEvent(AWTEvent e) Overrides java. Doc from java. This method is called by the AWT event dispatcher requesting that the
current KeyboardFocusManager dispatch the specified event on its behalf.
DefaultKeyboardFocusManagers dispatch all FocusEvents, all WindowEvents
related to focus, and all KeyEvents. These events are 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. If this method returns | |
| dispatchKeyEvent | back to summary |
|---|---|
| public boolean dispatchKeyEvent(KeyEvent e) Overrides java. Implements java. Doc from java. Called by
In all cases, this method returns | |
| downFocusCycle | back to summary |
|---|---|
| public void downFocusCycle(Container aContainer) Overrides java. Doc from java. Moves the focus down one focus traversal cycle. 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. | |
| focusNextComponent | back to summary |
|---|---|
| public void focusNextComponent(Component aComponent) Overrides java. Doc from java. Focuses the Component after aComponent, typically based on a FocusTraversalPolicy. | |
| focusPreviousComponent | back to summary |
|---|---|
| public void focusPreviousComponent(Component aComponent) Overrides java. Doc from java. Focuses the Component before aComponent, typically based on a FocusTraversalPolicy. | |
| getActiveWindow | back to summary |
|---|---|
| public Window getActiveWindow() Overrides java. Doc from java. Returns the active Window. Only a Frame or a Dialog 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 or Dialog that is an owner of the focused Window. | |
| getCurrentFocusCycleRoot | back to summary |
|---|---|
| public Container getCurrentFocusCycleRoot() Overrides java. Doc from java. 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. This method is intended to be used only by KeyboardFocusManagers and focus implementations. It is not for general client use. | |
| getDefaultFocusTraversalKeys | back to summary |
|---|---|
| public Set Overrides java. Doc from java. 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
| |
| getDefaultFocusTraversalPolicy | back to summary |
|---|---|
| public FocusTraversalPolicy getDefaultFocusTraversalPolicy() Overrides java. Doc from java. 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. | |
| getDelegate | back to summary |
|---|---|
| pack-priv KeyboardFocusManager getDelegate() | |
| getFocusedWindow | back to summary |
|---|---|
| public Window getFocusedWindow() Overrides java. Doc from java. Returns the focused Window. The focused Window is the Window that is or contains the focus owner. | |
| getFocusOwner | back to summary |
|---|---|
| public Component getFocusOwner() Overrides java. Doc from java. 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. | |
| getPermanentFocusOwner | back to summary |
|---|---|
| public Component getPermanentFocusOwner() Overrides java. Doc from java. Returns 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. | |
| processKeyEvent | back to summary |
|---|---|
| public void processKeyEvent(Component focusedComponent, KeyEvent e) Overrides java. Doc from java. 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 focus owner. | |
| removeKeyEventDispatcher | back to summary |
|---|---|
| public void removeKeyEventDispatcher(KeyEventDispatcher dispatcher) Overrides java. Doc from java. 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 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.
In a multithreaded application, | |
| removePropertyChangeListener | back to summary |
|---|---|
| public void removePropertyChangeListener(PropertyChangeListener listener) Overrides java. Doc from java. 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. | |
| removePropertyChangeListener | back to summary |
|---|---|
| public void removePropertyChangeListener(String propertyName, PropertyChangeListener listener) Overrides java. Doc from java. 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. | |
| removeVetoableChangeListener | back to summary |
|---|---|
| public void removeVetoableChangeListener(VetoableChangeListener listener) Overrides java. Doc from java. 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. | |
| removeVetoableChangeListener | back to summary |
|---|---|
| public void removeVetoableChangeListener(String propertyName, VetoableChangeListener listener) Overrides java. Doc from java. 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. | |
| setDefaultFocusTraversalKeys | back to summary | |||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| public void setDefaultFocusTraversalKeys(int id, Set<? extends AWTKeyStroke> keystrokes) Overrides java. Doc from java. Sets the default focus traversal keys for a given traversal operation.
This traversal key 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.
Set;
Collections.EMPTY_SET is recommended.
Using the
This method may throw a | ||||||||||||||||
| setDefaultFocusTraversalPolicy | back to summary |
|---|---|
| public void setDefaultFocusTraversalPolicy(FocusTraversalPolicy defaultPolicy) Overrides java. Doc from java. 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. | |
| setGlobalCurrentFocusCycleRoot | back to summary |
|---|---|
| public void setGlobalCurrentFocusCycleRoot(Container newFocusCycleRoot) Overrides java. Doc from java. 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. | |
| upFocusCycle | back to summary |
|---|---|
| public void upFocusCycle(Component aComponent) Overrides java. Doc from java. 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 the focus owner is set to the focus cycle root's default Component to focus, and the current focus cycle root is unchanged. | |