javax.swing
Class DelegatingDefaultFocusManager

java.lang.Object
  extended byjava.awt.KeyboardFocusManager
      extended byjava.awt.DefaultKeyboardFocusManager
          extended byjavax.swing.FocusManager
              extended byjavax.swing.DefaultFocusManager
                  extended byjavax.swing.DelegatingDefaultFocusManager
All Implemented Interfaces:
KeyEventDispatcher, KeyEventPostProcessor

final class DelegatingDefaultFocusManager
extends DefaultFocusManager

Provides a javax.swing.DefaultFocusManager view onto an arbitrary java.awt.KeyboardFocusManager. We subclass DefaultFocusManager instead of FocusManager because it seems more backward-compatible. It is likely that some pre-1.4 code assumes that the object returned by FocusManager.getCurrentManager is an instance of DefaultFocusManager unless set explicitly.


Nested Class Summary
 
Nested classes inherited from class java.awt.DefaultKeyboardFocusManager
 
Nested classes inherited from class java.awt.KeyboardFocusManager
 
Field Summary
private  KeyboardFocusManager delegate
           
 
Fields inherited from class javax.swing.DefaultFocusManager
gluePolicy
 
Fields inherited from class javax.swing.FocusManager
FOCUS_MANAGER_CLASS_PROPERTY
 
Fields inherited from class java.awt.DefaultKeyboardFocusManager
 
Fields inherited from class java.awt.KeyboardFocusManager
BACKWARD_TRAVERSAL_KEYS, DOWN_CYCLE_TRAVERSAL_KEYS, FORWARD_TRAVERSAL_KEYS, UP_CYCLE_TRAVERSAL_KEYS
 
Constructor Summary
(package private) DelegatingDefaultFocusManager(KeyboardFocusManager delegate)
           
 
Method Summary
 void addKeyEventDispatcher(KeyEventDispatcher dispatcher)
          Adds a KeyEventDispatcher to this KeyboardFocusManager's dispatcher chain.
 void addPropertyChangeListener(java.beans.PropertyChangeListener listener)
          Adds a PropertyChangeListener to the listener list.
 void addPropertyChangeListener(String propertyName, java.beans.PropertyChangeListener listener)
          Adds a PropertyChangeListener to the listener list for a specific property.
 void addVetoableChangeListener(String propertyName, java.beans.VetoableChangeListener listener)
          Adds a VetoableChangeListener to the listener list for a specific property.
 void addVetoableChangeListener(java.beans.VetoableChangeListener listener)
          Adds a VetoableChangeListener to the listener list.
 void clearGlobalFocusOwner()
          Clears the global focus owner at both the Java and native levels.
 boolean dispatchEvent(AWTEvent e)
          This method is called by the AWT event dispatcher requesting that the current KeyboardFocusManager dispatch the specified event on its behalf.
 boolean dispatchKeyEvent(KeyEvent e)
          Called by dispatchEvent if no other KeyEventDispatcher in the dispatcher chain dispatched the KeyEvent, or if no other KeyEventDispatchers are registered.
 void downFocusCycle(Container aContainer)
          Moves the focus down one focus traversal cycle.
 void focusNextComponent(Component aComponent)
          Focuses the Component after aComponent, typically based on a FocusTraversalPolicy.
 void focusPreviousComponent(Component aComponent)
          Focuses the Component before aComponent, typically based on a FocusTraversalPolicy.
 Window getActiveWindow()
          Returns the active Window, if the active Window is in the same context as the calling thread.
 Container getCurrentFocusCycleRoot()
          Returns the current focus cycle root, if the current focus cycle root is in the same context as the calling thread.
 Set getDefaultFocusTraversalKeys(int id)
          Returns a Set of default focus traversal keys for a given traversal operation.
 FocusTraversalPolicy getDefaultFocusTraversalPolicy()
          Returns the default FocusTraversalPolicy.
(package private)  KeyboardFocusManager getDelegate()
           
 Window getFocusedWindow()
          Returns the focused Window, if the focused Window is in the same context as the calling thread.
 Component getFocusOwner()
          Returns the focus owner, if the focus owner is in the same context as the calling thread.
 Component getPermanentFocusOwner()
          Returns the permanent focus owner, if the permanent focus owner is in the same context as the calling thread.
 void processKeyEvent(Component focusedComponent, KeyEvent e)
          This method initiates a focus traversal operation if and only if the KeyEvent represents a focus traversal key for the specified focusedComponent.
 void removeKeyEventDispatcher(KeyEventDispatcher dispatcher)
          Removes a KeyEventDispatcher which was previously added to this KeyboardFocusManager's dispatcher chain.
 void removePropertyChangeListener(java.beans.PropertyChangeListener listener)
          Removes a PropertyChangeListener from the listener list.
 void removePropertyChangeListener(String propertyName, java.beans.PropertyChangeListener listener)
          Removes a PropertyChangeListener from the listener list for a specific property.
 void removeVetoableChangeListener(String propertyName, java.beans.VetoableChangeListener listener)
          Removes a VetoableChangeListener from the listener list for a specific property.
 void removeVetoableChangeListener(java.beans.VetoableChangeListener listener)
          Removes a VetoableChangeListener from the listener list.
 void setDefaultFocusTraversalKeys(int id, Set keystrokes)
          Sets the default focus traversal keys for a given traversal operation.
 void setDefaultFocusTraversalPolicy(FocusTraversalPolicy defaultPolicy)
          Sets the default FocusTraversalPolicy.
 void setGlobalCurrentFocusCycleRoot(Container newFocusCycleRoot)
          Sets the current focus cycle root.
 void upFocusCycle(Component aComponent)
          Moves the focus up one focus traversal cycle.
 
Methods inherited from class javax.swing.DefaultFocusManager
compareTabOrder, getComponentAfter, getComponentBefore, getFirstComponent, getLastComponent
 
Methods inherited from class javax.swing.FocusManager
disableSwingFocusManager, getCurrentManager, isFocusManagerEnabled, setCurrentManager
 
Methods inherited from class java.awt.DefaultKeyboardFocusManager
dequeueKeyEvents, discardKeyEvents, enqueueKeyEvents, postProcessKeyEvent
 
Methods inherited from class java.awt.KeyboardFocusManager
addKeyEventPostProcessor, downFocusCycle, firePropertyChange, fireVetoableChange, focusNextComponent, focusPreviousComponent, getCurrentKeyboardFocusManager, getGlobalActiveWindow, getGlobalCurrentFocusCycleRoot, getGlobalFocusedWindow, getGlobalFocusOwner, getGlobalPermanentFocusOwner, getKeyEventDispatchers, getKeyEventPostProcessors, getPropertyChangeListeners, getPropertyChangeListeners, getVetoableChangeListeners, getVetoableChangeListeners, redispatchEvent, removeKeyEventPostProcessor, setCurrentKeyboardFocusManager, setGlobalActiveWindow, setGlobalFocusedWindow, setGlobalFocusOwner, setGlobalPermanentFocusOwner, upFocusCycle
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

delegate

private final KeyboardFocusManager delegate
Constructor Detail

DelegatingDefaultFocusManager

DelegatingDefaultFocusManager(KeyboardFocusManager delegate)
Method Detail

getDelegate

KeyboardFocusManager getDelegate()

processKeyEvent

public void processKeyEvent(Component focusedComponent,
                            KeyEvent e)
Description copied from class: DefaultKeyboardFocusManager
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.

Overrides:
processKeyEvent in class DefaultKeyboardFocusManager
Parameters:
focusedComponent - the Component that is the basis for a focus traversal operation if the specified event represents a focus traversal key for the Component
e - the event that may represent a focus traversal key

focusNextComponent

public void focusNextComponent(Component aComponent)
Description copied from class: DefaultKeyboardFocusManager
Focuses the Component after aComponent, typically based on a FocusTraversalPolicy.

Overrides:
focusNextComponent in class DefaultKeyboardFocusManager
Parameters:
aComponent - the Component that is the basis for the focus traversal operation
See Also:
FocusTraversalPolicy, Component.transferFocus()

focusPreviousComponent

public void focusPreviousComponent(Component aComponent)
Description copied from class: DefaultKeyboardFocusManager
Focuses the Component before aComponent, typically based on a FocusTraversalPolicy.

Overrides:
focusPreviousComponent in class DefaultKeyboardFocusManager
Parameters:
aComponent - the Component that is the basis for the focus traversal operation
See Also:
FocusTraversalPolicy, Component.transferFocusBackward()

getFocusOwner

public Component getFocusOwner()
Description copied from class: KeyboardFocusManager
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.

Overrides:
getFocusOwner in class KeyboardFocusManager
Returns:
the focus owner, or null if the focus owner is not a member of the calling thread's context
See Also:
KeyboardFocusManager.getGlobalFocusOwner(), KeyboardFocusManager.setGlobalFocusOwner(java.awt.Component)

clearGlobalFocusOwner

public void clearGlobalFocusOwner()
Description copied from class: KeyboardFocusManager
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.

Overrides:
clearGlobalFocusOwner in class KeyboardFocusManager
See Also:
Component.requestFocus(), FocusEvent.FOCUS_LOST

getPermanentFocusOwner

public Component getPermanentFocusOwner()
Description copied from class: KeyboardFocusManager
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.

Overrides:
getPermanentFocusOwner in class KeyboardFocusManager
Returns:
the permanent focus owner, or null if the permanent focus owner is not a member of the calling thread's context
See Also:
KeyboardFocusManager.getGlobalPermanentFocusOwner(), KeyboardFocusManager.setGlobalPermanentFocusOwner(java.awt.Component)

getFocusedWindow

public Window getFocusedWindow()
Description copied from class: KeyboardFocusManager
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.

Overrides:
getFocusedWindow in class KeyboardFocusManager
Returns:
the focused Window, or null if the focused Window is not a member of the calling thread's context
See Also:
KeyboardFocusManager.getGlobalFocusedWindow(), KeyboardFocusManager.setGlobalFocusedWindow(java.awt.Window)

getActiveWindow

public Window getActiveWindow()
Description copied from class: KeyboardFocusManager
Returns the active Window, if the active Window is in the same context as the calling thread. 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.

Overrides:
getActiveWindow in class KeyboardFocusManager
Returns:
the active Window, or null if the active Window is not a member of the calling thread's context
See Also:
KeyboardFocusManager.getGlobalActiveWindow(), KeyboardFocusManager.setGlobalActiveWindow(java.awt.Window)

getDefaultFocusTraversalPolicy

public FocusTraversalPolicy getDefaultFocusTraversalPolicy()
Description copied from class: KeyboardFocusManager
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.

Overrides:
getDefaultFocusTraversalPolicy in class KeyboardFocusManager
Returns:
the default FocusTraversalPolicy. null will never be returned.
See Also:
KeyboardFocusManager.setDefaultFocusTraversalPolicy(java.awt.FocusTraversalPolicy), Container.setFocusTraversalPolicy(java.awt.FocusTraversalPolicy), Container.getFocusTraversalPolicy()

setDefaultFocusTraversalPolicy

public void setDefaultFocusTraversalPolicy(FocusTraversalPolicy defaultPolicy)
Description copied from class: KeyboardFocusManager
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.

Overrides:
setDefaultFocusTraversalPolicy in class KeyboardFocusManager
Parameters:
defaultPolicy - the new, default FocusTraversalPolicy
See Also:
KeyboardFocusManager.getDefaultFocusTraversalPolicy(), Container.setFocusTraversalPolicy(java.awt.FocusTraversalPolicy), Container.getFocusTraversalPolicy()

setDefaultFocusTraversalKeys

public void setDefaultFocusTraversalKeys(int id,
                                         Set keystrokes)
Description copied from class: KeyboardFocusManager
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.

Identifier Meaning Default
KeyboardFocusManager.FORWARD_TRAVERSAL_KEYS Normal forward keyboard traversal TAB on KEY_PRESSED, CTRL-TAB on KEY_PRESSED
KeyboardFocusManager.BACKWARD_TRAVERSAL_KEYS Normal reverse keyboard traversal SHIFT-TAB on KEY_PRESSED, CTRL-SHIFT-TAB on KEY_PRESSED
KeyboardFocusManager.UP_CYCLE_TRAVERSAL_KEYS Go up one focus traversal cycle none
KeyboardFocusManager.DOWN_CYCLE_TRAVERSAL_KEYS Go down one focus traversal cycle none
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.

Overrides:
setDefaultFocusTraversalKeys in class KeyboardFocusManager
Parameters:
id - one of KeyboardFocusManager.FORWARD_TRAVERSAL_KEYS, KeyboardFocusManager.BACKWARD_TRAVERSAL_KEYS, KeyboardFocusManager.UP_CYCLE_TRAVERSAL_KEYS, or KeyboardFocusManager.DOWN_CYCLE_TRAVERSAL_KEYS
keystrokes - the Set of AWTKeyStrokes for the specified operation
See Also:
KeyboardFocusManager.getDefaultFocusTraversalKeys(int), Component.setFocusTraversalKeys(int, java.util.Set), Component.getFocusTraversalKeys(int)

getDefaultFocusTraversalKeys

public Set getDefaultFocusTraversalKeys(int id)
Description copied from class: KeyboardFocusManager
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.)

Overrides:
getDefaultFocusTraversalKeys in class KeyboardFocusManager
Parameters:
id - one of KeyboardFocusManager.FORWARD_TRAVERSAL_KEYS, KeyboardFocusManager.BACKWARD_TRAVERSAL_KEYS, KeyboardFocusManager.UP_CYCLE_TRAVERSAL_KEYS, or KeyboardFocusManager.DOWN_CYCLE_TRAVERSAL_KEYS
Returns:
the Set of AWTKeyStrokes for the specified operation; the Set will be unmodifiable, and may be empty; null will never be returned
See Also:
KeyboardFocusManager.setDefaultFocusTraversalKeys(int, java.util.Set), Component.setFocusTraversalKeys(int, java.util.Set), Component.getFocusTraversalKeys(int)

getCurrentFocusCycleRoot

public Container getCurrentFocusCycleRoot()
Description copied from class: KeyboardFocusManager
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.

Overrides:
getCurrentFocusCycleRoot in class KeyboardFocusManager
Returns:
the current focus cycle root, or null if the current focus cycle root is not a member of the calling thread's context
See Also:
KeyboardFocusManager.getGlobalCurrentFocusCycleRoot(), KeyboardFocusManager.setGlobalCurrentFocusCycleRoot(java.awt.Container)

setGlobalCurrentFocusCycleRoot

public void setGlobalCurrentFocusCycleRoot(Container newFocusCycleRoot)
Description copied from class: KeyboardFocusManager
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.

Overrides:
setGlobalCurrentFocusCycleRoot in class KeyboardFocusManager
Parameters:
newFocusCycleRoot - the new focus cycle root
See Also:
KeyboardFocusManager.getCurrentFocusCycleRoot(), KeyboardFocusManager.getGlobalCurrentFocusCycleRoot()

addPropertyChangeListener

public void addPropertyChangeListener(java.beans.PropertyChangeListener listener)
Description copied from class: KeyboardFocusManager
Adds a PropertyChangeListener to the listener list. The listener is registered for all bound properties of this class, including the following: If listener is null, no exception is thrown and no action is performed.

Overrides:
addPropertyChangeListener in class KeyboardFocusManager
Parameters:
listener - the PropertyChangeListener to be added
See Also:
KeyboardFocusManager.removePropertyChangeListener(java.beans.PropertyChangeListener), KeyboardFocusManager.getPropertyChangeListeners(), KeyboardFocusManager.addPropertyChangeListener(java.lang.String,java.beans.PropertyChangeListener)

removePropertyChangeListener

public void removePropertyChangeListener(java.beans.PropertyChangeListener listener)
Description copied from class: KeyboardFocusManager
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.

Overrides:
removePropertyChangeListener in class KeyboardFocusManager
Parameters:
listener - the PropertyChangeListener to be removed
See Also:
KeyboardFocusManager.addPropertyChangeListener(java.beans.PropertyChangeListener), KeyboardFocusManager.getPropertyChangeListeners(), KeyboardFocusManager.removePropertyChangeListener(java.lang.String,java.beans.PropertyChangeListener)

addPropertyChangeListener

public void addPropertyChangeListener(String propertyName,
                                      java.beans.PropertyChangeListener listener)
Description copied from class: KeyboardFocusManager
Adds a PropertyChangeListener to the listener list for a specific property. The specified property may be user-defined, or one of the following: If listener is null, no exception is thrown and no action is performed.

Overrides:
addPropertyChangeListener in class KeyboardFocusManager
Parameters:
propertyName - one of the property names listed above
listener - the PropertyChangeListener to be added
See Also:
KeyboardFocusManager.addPropertyChangeListener(java.beans.PropertyChangeListener), KeyboardFocusManager.removePropertyChangeListener(java.lang.String,java.beans.PropertyChangeListener), KeyboardFocusManager.getPropertyChangeListeners(java.lang.String)

removePropertyChangeListener

public void removePropertyChangeListener(String propertyName,
                                         java.beans.PropertyChangeListener listener)
Description copied from class: KeyboardFocusManager
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.

Overrides:
removePropertyChangeListener in class KeyboardFocusManager
Parameters:
propertyName - a valid property name
listener - the PropertyChangeListener to be removed
See Also:
KeyboardFocusManager.addPropertyChangeListener(java.lang.String,java.beans.PropertyChangeListener), KeyboardFocusManager.getPropertyChangeListeners(java.lang.String), KeyboardFocusManager.removePropertyChangeListener(java.beans.PropertyChangeListener)

addVetoableChangeListener

public void addVetoableChangeListener(java.beans.VetoableChangeListener listener)
Description copied from class: KeyboardFocusManager
Adds a VetoableChangeListener to the listener list. The listener is registered for all vetoable properties of this class, including the following: If listener is null, no exception is thrown and no action is performed.

Overrides:
addVetoableChangeListener in class KeyboardFocusManager
Parameters:
listener - the VetoableChangeListener to be added
See Also:
KeyboardFocusManager.removeVetoableChangeListener(java.beans.VetoableChangeListener), KeyboardFocusManager.getVetoableChangeListeners(), KeyboardFocusManager.addVetoableChangeListener(java.lang.String,java.beans.VetoableChangeListener)

removeVetoableChangeListener

public void removeVetoableChangeListener(java.beans.VetoableChangeListener listener)
Description copied from class: KeyboardFocusManager
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.

Overrides:
removeVetoableChangeListener in class KeyboardFocusManager
Parameters:
listener - the VetoableChangeListener to be removed
See Also:
KeyboardFocusManager.addVetoableChangeListener(java.beans.VetoableChangeListener), KeyboardFocusManager.getVetoableChangeListeners(), KeyboardFocusManager.removeVetoableChangeListener(java.lang.String,java.beans.VetoableChangeListener)

addVetoableChangeListener

public void addVetoableChangeListener(String propertyName,
                                      java.beans.VetoableChangeListener listener)
Description copied from class: KeyboardFocusManager
Adds a VetoableChangeListener to the listener list for a specific property. The specified property may be user-defined, or one of the following: If listener is null, no exception is thrown and no action is performed.

Overrides:
addVetoableChangeListener in class KeyboardFocusManager
Parameters:
propertyName - one of the property names listed above
listener - the VetoableChangeListener to be added
See Also:
KeyboardFocusManager.addVetoableChangeListener(java.beans.VetoableChangeListener), KeyboardFocusManager.removeVetoableChangeListener(java.beans.VetoableChangeListener), KeyboardFocusManager.getVetoableChangeListeners()

removeVetoableChangeListener

public void removeVetoableChangeListener(String propertyName,
                                         java.beans.VetoableChangeListener listener)
Description copied from class: KeyboardFocusManager
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.

Overrides:
removeVetoableChangeListener in class KeyboardFocusManager
Parameters:
propertyName - a valid property name
listener - the VetoableChangeListener to be removed
See Also:
KeyboardFocusManager.addVetoableChangeListener(java.beans.VetoableChangeListener), KeyboardFocusManager.getVetoableChangeListeners(), KeyboardFocusManager.removeVetoableChangeListener(java.beans.VetoableChangeListener)

addKeyEventDispatcher

public void addKeyEventDispatcher(KeyEventDispatcher dispatcher)
Description copied from class: KeyboardFocusManager
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.

Overrides:
addKeyEventDispatcher in class KeyboardFocusManager
Parameters:
dispatcher - the KeyEventDispatcher to add to the dispatcher chain
See Also:
KeyboardFocusManager.removeKeyEventDispatcher(java.awt.KeyEventDispatcher)

removeKeyEventDispatcher

public void removeKeyEventDispatcher(KeyEventDispatcher dispatcher)
Description copied from class: KeyboardFocusManager
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.

Overrides:
removeKeyEventDispatcher in class KeyboardFocusManager
Parameters:
dispatcher - the KeyEventDispatcher to remove from the dispatcher chain
See Also:
KeyboardFocusManager.addKeyEventDispatcher(java.awt.KeyEventDispatcher)

dispatchEvent

public boolean dispatchEvent(AWTEvent e)
Description copied from class: DefaultKeyboardFocusManager
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 false, then the AWT event dispatcher will attempt to dispatch the event itself.

Overrides:
dispatchEvent in class DefaultKeyboardFocusManager
Parameters:
e - the AWTEvent to be dispatched
Returns:
true if this method dispatched the event; false otherwise

dispatchKeyEvent

public boolean dispatchKeyEvent(KeyEvent e)
Description copied from class: DefaultKeyboardFocusManager
Called by dispatchEvent if no other KeyEventDispatcher in the dispatcher chain dispatched the KeyEvent, or if no other KeyEventDispatchers are registered. If the event has not been consumed, its target is enabled, and the focus owner is not null, this method dispatches the event to its target. This method will also subsequently dispatch the event to all registered KeyEventPostProcessors. After all this operations are finished, the event is passed to peers for processing.

In all cases, this method returns true, since DefaultKeyboardFocusManager is designed so that neither dispatchEvent, nor the AWT event dispatcher, should take further action on the event in any situation.

Specified by:
dispatchKeyEvent in interface KeyEventDispatcher
Overrides:
dispatchKeyEvent in class DefaultKeyboardFocusManager
Parameters:
e - the KeyEvent to be dispatched
Returns:
true
See Also:
Component.dispatchEvent(java.awt.AWTEvent)

upFocusCycle

public void upFocusCycle(Component aComponent)
Description copied from class: DefaultKeyboardFocusManager
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.

Overrides:
upFocusCycle in class DefaultKeyboardFocusManager
Parameters:
aComponent - the Component that is the basis for the focus traversal operation
See Also:
Component.transferFocusUpCycle()

downFocusCycle

public void downFocusCycle(Container aContainer)
Description copied from class: DefaultKeyboardFocusManager
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.

Overrides:
downFocusCycle in class DefaultKeyboardFocusManager
Parameters:
aContainer - the Container that is the basis for the focus traversal operation
See Also:
Container.transferFocusDownCycle()