API Overview API Index Package Overview Direct link to this page
JDK 1.6
  java.awt. KeyboardFocusManager View Source
Author(s)
David Mendenhall
Since
1.4
Version
1.74, 03/15/07
Serial
Hierarchy
 Object
      KeyboardFocusManager
Implements
 KeyEventDispatcher
 KeyEventPostProcessor
Subclasses
Description
publicabstract abstract class KeyboardFocusManager
  The KeyboardFocusManager is responsible for managing the active and focused Windows, and the current focus owner.
Constructors
public KeyboardFocusManager ()
Initializes a KeyboardFocusManager.
Methods
Hide/Show inherited methods
public void addKeyEventDispatcher (KeyEventDispatcher dispatcher)
  Adds a KeyEventDispatcher to this KeyboardFocusManager's dispatcher chain.
public void addKeyEventPostProcessor (KeyEventPostProcessor processor)
  Adds a KeyEventPostProcessor to this KeyboardFocusManager's post- processor chain.
public void addPropertyChangeListener (PropertyChangeListener listener)
  Adds a PropertyChangeListener to the listener list.
public void addPropertyChangeListener (String propertyName, PropertyChangeListener listener)
  Adds a PropertyChangeListener to the listener list for a specific property.
public void addVetoableChangeListener (String propertyName, VetoableChangeListener listener)
  Adds a VetoableChangeListener to the listener list for a specific property.
public void addVetoableChangeListener (VetoableChangeListener listener)
  Adds a VetoableChangeListener to the listener list.
public void clearGlobalFocusOwner ()
  Clears the global focus owner at both the Java and native levels.
pack-private void clearMarkers ()
  Clears markers queue This method is not intended to be overridden by KFM's.
pack-privatestatic void clearMostRecentFocusOwner (Component comp)
protectedabstract void dequeueKeyEvents (long after, Component untilFocused)
  Called by the AWT to notify the KeyboardFocusManager that it should cancel delayed dispatching of KeyEvents.
protectedabstract void discardKeyEvents (Component comp)
  Called by the AWT to notify the KeyboardFocusManager that it should cancel delayed dispatching of KeyEvents.
publicabstract 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.
publicabstract boolean dispatchKeyEvent (KeyEvent e) [Specified in KeyEventDispatcher]
  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.
publicfinal void downFocusCycle ()
  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.
publicabstract void downFocusCycle (Container aContainer)
  Moves the focus down one focus traversal cycle.
pack-private void dumpRequests ()
Dumps the list of focus requests to stderr
protectedabstract void enqueueKeyEvents (long after, Component untilFocused)
  Called by the AWT to notify the KeyboardFocusManager that it should delay dispatching of KeyEvents until the specified Component becomes the focus owner.
protected void firePropertyChange (String propertyName, Object oldValue, Object newValue)
  Fires a PropertyChangeEvent in response to a change in a bound property.
protected void fireVetoableChange (String propertyName, Object oldValue, Object newValue) throws PropertyVetoException
  Fires a PropertyChangeEvent in response to a change in a vetoable property.
publicfinal void focusNextComponent ()
Focuses the Component after the current focus owner.
publicabstract void focusNextComponent (Component aComponent)
  Focuses the Component after aComponent, typically based on a FocusTraversalPolicy.
publicfinal void focusPreviousComponent ()
Focuses the Component before the current focus owner.
publicabstract void focusPreviousComponent (Component aComponent)
  Focuses the Component before aComponent, typically based on a FocusTraversalPolicy.
public Window getActiveWindow ()
  Returns the active Window, if the active Window is in the same context as the calling thread.
public Container getCurrentFocusCycleRoot ()
  Returns the current focus cycle root, if the current focus cycle root is in the same context as the calling thread.
publicstatic KeyboardFocusManager getCurrentKeyboardFocusManager ()
  Returns the current KeyboardFocusManager instance for the calling thread's context.
pack-privatestaticsynchronized KeyboardFocusManager getCurrentKeyboardFocusManager (sun.awt.AppContext appcontext)
pack-privatefinal SequencedEvent getCurrentSequencedEvent ()
pack-private Component getCurrentWaitingRequest (Component parent)
public Set<AWTKeyStroke> getDefaultFocusTraversalKeys (int id)
  Returns a Set of default focus traversal keys for a given traversal operation.
publicsynchronized FocusTraversalPolicy getDefaultFocusTraversalPolicy ()
  Returns the default FocusTraversalPolicy.
public Window getFocusedWindow ()
  Returns the focused Window, if the focused Window is in the same context as the calling thread.
public Component getFocusOwner ()
  Returns the focus owner, if the focus owner is in the same context as the calling thread.
protected Window getGlobalActiveWindow () throws SecurityException
  Returns the active Window, even if the calling thread is in a different context than the active Window.
protected Container getGlobalCurrentFocusCycleRoot () throws SecurityException
  Returns the current focus cycle root, even if the calling thread is in a different context than the current focus cycle root.
protected Window getGlobalFocusedWindow () throws SecurityException
  Returns the focused Window, even if the calling thread is in a different context than the focused Window.
protected Component getGlobalFocusOwner () throws SecurityException
  Returns the focus owner, even if the calling thread is in a different context than the focus owner.
protected Component getGlobalPermanentFocusOwner () throws SecurityException
  Returns the permanent focus owner, even if the calling thread is in a different context than the permanent focus owner.
pack-privatestatic Component getHeavyweight (Component comp)
protectedsynchronized List<KeyEventDispatcher> getKeyEventDispatchers ()
  Returns this KeyboardFocusManager's KeyEventDispatcher chain as a List.
protected List<KeyEventPostProcessor> getKeyEventPostProcessors ()
  Returns this KeyboardFocusManager's KeyEventPostProcessor chain as a List.
pack-privatestaticsynchronized Component getMostRecentFocusOwner (Window window)
pack-private Window getNativeFocusedWindow ()
pack-private Component getNativeFocusOwner ()
public Component getPermanentFocusOwner ()
  Returns the permanent focus owner, if the permanent focus owner is in the same context as the calling thread.
publicsynchronized PropertyChangeListener getPropertyChangeListeners ()
  Returns an array of all the property change listeners registered on this keyboard focus manager.
publicsynchronized PropertyChangeListener getPropertyChangeListeners (String propertyName)
  Returns an array of all the PropertyChangeListeners associated with the named property.
publicsynchronized VetoableChangeListener getVetoableChangeListeners ()
  Returns an array of all the vetoable change listeners registered on this keyboard focus manager.
publicsynchronized VetoableChangeListener getVetoableChangeListeners (String propertyName)
  Returns an array of all the VetoableChangeListeners associated with the named property.
pack-privatestatic boolean hasFocusRequests ()
pack-privatestatic void heavyweightButtonDown (Component heavyweight, long time)
pack-privatestatic void heavyweightButtonDown (Component heavyweight, long time, boolean acceptDuplicates)
pack-privatestatic Set initFocusTraversalKeysSet (String value, Set targetSet)
pack-privatestatic boolean isProxyActive (KeyEvent e)
pack-privatestatic Window markClearGlobalFocusOwner ()
  Returns the Window which will be active after processing this request, or null if this is a duplicate request.
publicabstract boolean postProcessKeyEvent (KeyEvent e) [Specified in KeyEventPostProcessor]
  This method will be called by dispatchKeyEvent.
pack-privatestatic void processCurrentLightweightRequests ()
publicabstract 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.
pack-privatestatic boolean processSynchronousLightweightTransfer (Component heavyweight, Component descendant, boolean temporary, boolean focusedWindowChangeAllowed, long time)
publicfinal void redispatchEvent (Component target, 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.
pack-privatestatic boolean removeFirstRequest ()
public void removeKeyEventDispatcher (KeyEventDispatcher dispatcher)
  Removes a KeyEventDispatcher which was previously added to this KeyboardFocusManager's dispatcher chain.
public void removeKeyEventPostProcessor (KeyEventPostProcessor processor)
  Removes a previously added KeyEventPostProcessor from this KeyboardFocusManager's post-processor chain.
pack-privatestatic void removeLastFocusRequest (Component heavyweight)
public void removePropertyChangeListener (PropertyChangeListener listener)
  Removes a PropertyChangeListener from the listener list.
public void removePropertyChangeListener (String propertyName, PropertyChangeListener listener)
  Removes a PropertyChangeListener from the listener list for a specific property.
public void removeVetoableChangeListener (String propertyName, VetoableChangeListener listener)
  Removes a VetoableChangeListener from the listener list for a specific property.
public void removeVetoableChangeListener (VetoableChangeListener listener)
  Removes a VetoableChangeListener from the listener list.
pack-privatestatic AWTEvent retargetFocusEvent (AWTEvent event)
pack-privatestatic FocusEvent retargetFocusGained (FocusEvent fe)
pack-privatestatic FocusEvent retargetFocusLost (FocusEvent fe)
pack-privatestatic FocusEvent retargetUnexpectedFocusEvent (FocusEvent fe)
publicstatic void setCurrentKeyboardFocusManager (KeyboardFocusManager newManager) throws SecurityException
  Sets the current KeyboardFocusManager instance for the calling thread's context.
pack-privatefinal void setCurrentSequencedEvent (SequencedEvent current)
public void setDefaultFocusTraversalKeys (int id, Set<AWTKeyStroke> keystrokes)
  Sets the default focus traversal keys for a given traversal operation.
public void setDefaultFocusTraversalPolicy (FocusTraversalPolicy defaultPolicy)
  Sets the default FocusTraversalPolicy.
protected void setGlobalActiveWindow (Window activeWindow)
  Sets the active Window.
public void setGlobalCurrentFocusCycleRoot (Container newFocusCycleRoot)
  Sets the current focus cycle root.
protected void setGlobalFocusedWindow (Window focusedWindow)
  Sets the focused Window.
protected void setGlobalFocusOwner (Component focusOwner)
  Sets the focus owner.
protected void setGlobalPermanentFocusOwner (Component permanentFocusOwner)
  Sets the permanent focus owner.
pack-privatestatic void setMostRecentFocusOwner (Component component)
pack-privatestaticsynchronized void setMostRecentFocusOwner (Window window, Component component)
pack-private void setNativeFocusedWindow (Window win)
pack-private void setNativeFocusOwner (Component comp)
pack-privatestatic int shouldNativelyFocusHeavyweight (Component heavyweight, Component descendant, boolean temporary, boolean focusedWindowChangeAllowed, long time, sun.awt.CausedFocusEvent.Cause cause)
  Indicates whether the native implementation should proceed with a pending, native focus request.
publicfinal void upFocusCycle ()
  Moves the focus up one focus traversal cycle from the current focus owner.
publicabstract void upFocusCycle (Component aComponent)
  Moves the focus up one focus traversal cycle.
Fields
Hide/Show inherited fields
publicfinalstatic int BACKWARD_TRAVERSAL_KEYS = "1"
  The identifier for the Backward focus traversal keys.
pack-privatetransient SequencedEvent currentSequencedEvent
pack-privatestaticvolatile boolean disableRestoreFocus
publicfinalstatic int DOWN_CYCLE_TRAVERSAL_KEYS = "3"
  The identifier for the Down Cycle focus traversal keys.
publicfinalstatic int FORWARD_TRAVERSAL_KEYS = "0"
  The identifier for the Forward focus traversal keys.
pack-privatetransient KeyboardFocusManagerPeer peer
pack-privatestatic Field proxyActive
pack-privatefinalstatic int SNFH_FAILURE = "0"
pack-privatefinalstatic int SNFH_SUCCESS_HANDLED = "1"
pack-privatefinalstatic int SNFH_SUCCESS_PROCEED = "2"
pack-privatefinalstatic int TRAVERSAL_KEY_LENGTH = "4"
publicfinalstatic int UP_CYCLE_TRAVERSAL_KEYS = "2"
  The identifier for the Up Cycle focus traversal keys.
Nested Classes
Generated By: JavaOnTracks Doclet 0.1.4     ©Thibaut Colar