Java Doc for KeyboardFocusManager.java in  » 6.0-JDK-Core » AWT » java » awt » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Home
Java Source Code / Java Documentation
1.6.0 JDK Core
2.6.0 JDK Modules
3.6.0 JDK Modules com.sun
4.6.0 JDK Modules com.sun.java
5.6.0 JDK Modules sun
6.6.0 JDK Platform
7.Ajax
8.Apache Harmony Java SE
9.Aspect oriented
10.Authentication Authorization
11.Blogger System
12.Build
13.Byte Code
14.Cache
15.Chart
16.Chat
17.Code Analyzer
18.Collaboration
19.Content Management System
20.Database Client
21.Database DBMS
22.Database JDBC Connection Pool
23.Database ORM
24.Development
25.EJB Server
26.ERP CRM Financial
27.ESB
28.Forum
29.Game
30.GIS
31.Graphic 3D
32.Graphic Library
33.Groupware
34.HTML Parser
35.IDE
36.IDE Eclipse
37.IDE Netbeans
38.Installer
39.Internationalization Localization
40.Inversion of Control
41.Issue Tracking
42.J2EE
43.J2ME
44.JBoss
45.JMS
46.JMX
47.Library
48.Mail Clients
49.Music
50.Net
51.Parser
52.PDF
53.Portal
54.Profiler
55.Project Management
56.Report
57.RSS RDF
58.Rule Engine
59.Science
60.Scripting
61.Search Engine
62.Security
63.Sevlet Container
64.Source Control
65.Swing Library
66.Template Engine
67.Test Coverage
68.Testing
69.UML
70.Web Crawler
71.Web Framework
72.Web Mail
73.Web Server
74.Web Services
75.Web Services apache cxf 2.2.6
76.Web Services AXIS2
77.Wiki Engine
78.Workflow Engines
79.XML
80.XML UI
Java Source Code / Java Documentation » 6.0 JDK Core » AWT » java.awt 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   java.awt.KeyboardFocusManager

All known Subclasses:   java.awt.DefaultKeyboardFocusManager,
KeyboardFocusManager
abstract public class KeyboardFocusManager implements KeyEventDispatcher,KeyEventPostProcessor(Code)
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 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.

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.

Please see How to Use the Focus Subsystem, a section in The Java Tutorial, and the Focus Specification for more information.
author:
   David Mendenhall
version:
   1.83, 06/25/07
See Also:   Window
See Also:   Frame
See Also:   Dialog
See Also:   java.awt.event.FocusEvent
See Also:   java.awt.event.WindowEvent
See Also:   java.awt.event.KeyEvent
since:
   1.4



Field Summary
final public static  intBACKWARD_TRAVERSAL_KEYS
     The identifier for the Backward focus traversal keys.
final public static  intDOWN_CYCLE_TRAVERSAL_KEYS
     The identifier for the Down Cycle focus traversal keys.
final public static  intFORWARD_TRAVERSAL_KEYS
     The identifier for the Forward focus traversal keys.
final static  intSNFH_FAILURE
    
final static  intSNFH_SUCCESS_HANDLED
    
final static  intSNFH_SUCCESS_PROCEED
    
final static  intTRAVERSAL_KEY_LENGTH
    
final public static  intUP_CYCLE_TRAVERSAL_KEYS
     The identifier for the Up Cycle focus traversal keys.
transient  SequencedEventcurrentSequencedEvent
    
transient  KeyboardFocusManagerPeerpeer
    
static  FieldproxyActive
    

Constructor Summary
public  KeyboardFocusManager()
     Initializes a KeyboardFocusManager.

Method Summary
public  voidaddKeyEventDispatcher(KeyEventDispatcher dispatcher)
     Adds a KeyEventDispatcher to this KeyboardFocusManager's dispatcher chain.
public  voidaddKeyEventPostProcessor(KeyEventPostProcessor processor)
     Adds a KeyEventPostProcessor to this KeyboardFocusManager's post- processor chain.
public  voidaddPropertyChangeListener(PropertyChangeListener listener)
     Adds a PropertyChangeListener to the listener list.
public  voidaddPropertyChangeListener(String propertyName, PropertyChangeListener listener)
     Adds a PropertyChangeListener to the listener list for a specific property.
public  voidaddVetoableChangeListener(VetoableChangeListener listener)
     Adds a VetoableChangeListener to the listener list.
public  voidaddVetoableChangeListener(String propertyName, VetoableChangeListener listener)
     Adds a VetoableChangeListener to the listener list for a specific property.
public  voidclearGlobalFocusOwner()
     Clears the global focus owner at both the Java and native levels.
 voidclearMarkers()
     Clears markers queue This method is not intended to be overridden by KFM's.
static  voidclearMostRecentFocusOwner(Component comp)
    
abstract protected  voiddequeueKeyEvents(long after, Component untilFocused)
     Called by the AWT to notify the KeyboardFocusManager that it should cancel delayed dispatching of KeyEvents.
abstract protected  voiddiscardKeyEvents(Component comp)
     Called by the AWT to notify the KeyboardFocusManager that it should cancel delayed dispatching of KeyEvents.
abstract public  booleandispatchEvent(AWTEvent e)
     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.
abstract public  booleandispatchKeyEvent(KeyEvent 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.
abstract public  voiddownFocusCycle(Container aContainer)
     Moves the focus down one focus traversal cycle.
final public  voiddownFocusCycle()
     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.
 voiddumpRequests()
    
abstract protected  voidenqueueKeyEvents(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  voidfirePropertyChange(String propertyName, Object oldValue, Object newValue)
     Fires a PropertyChangeEvent in response to a change in a bound property.
protected  voidfireVetoableChange(String propertyName, Object oldValue, Object newValue)
     Fires a PropertyChangeEvent in response to a change in a vetoable property.
abstract public  voidfocusNextComponent(Component aComponent)
     Focuses the Component after aComponent, typically based on a FocusTraversalPolicy.
final public  voidfocusNextComponent()
     Focuses the Component after the current focus owner.
abstract public  voidfocusPreviousComponent(Component aComponent)
     Focuses the Component before aComponent, typically based on a FocusTraversalPolicy.
final public  voidfocusPreviousComponent()
     Focuses the Component before the current focus owner.
public  WindowgetActiveWindow()
     Returns the active Window, if the active Window is in the same context as the calling thread.
public  ContainergetCurrentFocusCycleRoot()
     Returns the current focus cycle root, if the current focus cycle root is in the same context as the calling thread.
public static  KeyboardFocusManagergetCurrentKeyboardFocusManager()
     Returns the current KeyboardFocusManager instance for the calling thread's context.
static synchronized  KeyboardFocusManagergetCurrentKeyboardFocusManager(AppContext appcontext)
    
final  SequencedEventgetCurrentSequencedEvent()
    
 ComponentgetCurrentWaitingRequest(Component parent)
    
public  Set<AWTKeyStroke>getDefaultFocusTraversalKeys(int id)
     Returns a Set of default focus traversal keys for a given traversal operation.
public synchronized  FocusTraversalPolicygetDefaultFocusTraversalPolicy()
     Returns the default FocusTraversalPolicy.
public  ComponentgetFocusOwner()
     Returns the focus owner, if the focus owner is in the same context as the calling thread.
public  WindowgetFocusedWindow()
     Returns the focused Window, if the focused Window is in the same context as the calling thread.
protected  WindowgetGlobalActiveWindow()
     Returns the active Window, even if the calling thread is in a different context than the active Window.
protected  ContainergetGlobalCurrentFocusCycleRoot()
     Returns the current focus cycle root, even if the calling thread is in a different context than the current focus cycle root.
protected  ComponentgetGlobalFocusOwner()
     Returns the focus owner, even if the calling thread is in a different context than the focus owner.
protected  WindowgetGlobalFocusedWindow()
     Returns the focused Window, even if the calling thread is in a different context than the focused Window.
protected  ComponentgetGlobalPermanentFocusOwner()
     Returns the permanent focus owner, even if the calling thread is in a different context than the permanent focus owner.
static  ComponentgetHeavyweight(Component comp)
    
protected synchronized  java.util.List<KeyEventDispatcher>getKeyEventDispatchers()
     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.
protected  java.util.List<KeyEventPostProcessor>getKeyEventPostProcessors()
     Returns this KeyboardFocusManager's KeyEventPostProcessor chain as a List.
static synchronized  ComponentgetMostRecentFocusOwner(Window window)
    
 ComponentgetNativeFocusOwner()
    
 WindowgetNativeFocusedWindow()
    
public  ComponentgetPermanentFocusOwner()
     Returns the permanent focus owner, if the permanent focus owner is in the same context as the calling thread.
public synchronized  PropertyChangeListener[]getPropertyChangeListeners()
     Returns an array of all the property change listeners registered on this keyboard focus manager.
public synchronized  PropertyChangeListener[]getPropertyChangeListeners(String propertyName)
     Returns an array of all the PropertyChangeListeners associated with the named property.
public synchronized  VetoableChangeListener[]getVetoableChangeListeners()
     Returns an array of all the vetoable change listeners registered on this keyboard focus manager.
public synchronized  VetoableChangeListener[]getVetoableChangeListeners(String propertyName)
     Returns an array of all the VetoableChangeListeners associated with the named property.
static  voidheavyweightButtonDown(Component heavyweight, long time)
    
static  voidheavyweightButtonDown(Component heavyweight, long time, boolean acceptDuplicates)
    
static  SetinitFocusTraversalKeysSet(String value, Set targetSet)
    
static  booleanisAutoFocusTransferEnabled()
    
static  booleanisProxyActive(KeyEvent e)
    
static  WindowmarkClearGlobalFocusOwner()
     Returns the Window which will be active after processing this request, or null if this is a duplicate request.
abstract public  booleanpostProcessKeyEvent(KeyEvent e)
     This method will be called by dispatchKeyEvent.
static  voidprocessCurrentLightweightRequests()
    
abstract public  voidprocessKeyEvent(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.
static  booleanprocessSynchronousLightweightTransfer(Component heavyweight, Component descendant, boolean temporary, boolean focusedWindowChangeAllowed, long time)
    
final public  voidredispatchEvent(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.
static  booleanremoveFirstRequest()
    
public  voidremoveKeyEventDispatcher(KeyEventDispatcher dispatcher)
     Removes a KeyEventDispatcher which was previously added to this KeyboardFocusManager's dispatcher chain.
public  voidremoveKeyEventPostProcessor(KeyEventPostProcessor processor)
     Removes a previously added KeyEventPostProcessor from this KeyboardFocusManager's post-processor chain.
static  voidremoveLastFocusRequest(Component heavyweight)
    
public  voidremovePropertyChangeListener(PropertyChangeListener listener)
     Removes a PropertyChangeListener from the listener list.
public  voidremovePropertyChangeListener(String propertyName, PropertyChangeListener listener)
     Removes a PropertyChangeListener from the listener list for a specific property.
public  voidremoveVetoableChangeListener(VetoableChangeListener listener)
     Removes a VetoableChangeListener from the listener list.
public  voidremoveVetoableChangeListener(String propertyName, VetoableChangeListener listener)
     Removes a VetoableChangeListener from the listener list for a specific property.
static  AWTEventretargetFocusEvent(AWTEvent event)
    
static  FocusEventretargetFocusGained(FocusEvent fe)
    
static  FocusEventretargetFocusLost(FocusEvent fe)
    
static  FocusEventretargetUnexpectedFocusEvent(FocusEvent fe)
    
public static  voidsetCurrentKeyboardFocusManager(KeyboardFocusManager newManager)
     Sets the current KeyboardFocusManager instance for the calling thread's context.
final  voidsetCurrentSequencedEvent(SequencedEvent current)
    
public  voidsetDefaultFocusTraversalKeys(int id, Set<? extends AWTKeyStroke> keystrokes)
     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.
public  voidsetDefaultFocusTraversalPolicy(FocusTraversalPolicy defaultPolicy)
     Sets the default FocusTraversalPolicy.
protected  voidsetGlobalActiveWindow(Window activeWindow)
     Sets the active Window.
public  voidsetGlobalCurrentFocusCycleRoot(Container newFocusCycleRoot)
     Sets the current focus cycle root.
protected  voidsetGlobalFocusOwner(Component focusOwner)
     Sets the focus owner.
protected  voidsetGlobalFocusedWindow(Window focusedWindow)
     Sets the focused Window.
protected  voidsetGlobalPermanentFocusOwner(Component permanentFocusOwner)
     Sets the permanent focus owner.
static  voidsetMostRecentFocusOwner(Component component)
    
static synchronized  voidsetMostRecentFocusOwner(Window window, Component component)
    
 voidsetNativeFocusOwner(Component comp)
    
static  intshouldNativelyFocusHeavyweight(Component heavyweight, Component descendant, boolean temporary, boolean focusedWindowChangeAllowed, long time, CausedFocusEvent.Cause cause)
     Indicates whether the native implementation should proceed with a pending, native focus request.
abstract public  voidupFocusCycle(Component aComponent)
     Moves the focus up one focus traversal cycle.
final public  voidupFocusCycle()
     Moves the focus up one focus traversal cycle from the current focus owner.

Field Detail
BACKWARD_TRAVERSAL_KEYS
final public static int BACKWARD_TRAVERSAL_KEYS(Code)
The identifier for the Backward focus traversal keys.
See Also:   KeyboardFocusManager.setDefaultFocusTraversalKeys
See Also:   KeyboardFocusManager.getDefaultFocusTraversalKeys
See Also:   Component.setFocusTraversalKeys
See Also:   Component.getFocusTraversalKeys



DOWN_CYCLE_TRAVERSAL_KEYS
final public static int DOWN_CYCLE_TRAVERSAL_KEYS(Code)
The identifier for the Down Cycle focus traversal keys.
See Also:   KeyboardFocusManager.setDefaultFocusTraversalKeys
See Also:   KeyboardFocusManager.getDefaultFocusTraversalKeys
See Also:   Component.setFocusTraversalKeys
See Also:   Component.getFocusTraversalKeys



FORWARD_TRAVERSAL_KEYS
final public static int FORWARD_TRAVERSAL_KEYS(Code)
The identifier for the Forward focus traversal keys.
See Also:   KeyboardFocusManager.setDefaultFocusTraversalKeys
See Also:   KeyboardFocusManager.getDefaultFocusTraversalKeys
See Also:   Component.setFocusTraversalKeys
See Also:   Component.getFocusTraversalKeys



SNFH_FAILURE
final static int SNFH_FAILURE(Code)



SNFH_SUCCESS_HANDLED
final static int SNFH_SUCCESS_HANDLED(Code)



SNFH_SUCCESS_PROCEED
final static int SNFH_SUCCESS_PROCEED(Code)



TRAVERSAL_KEY_LENGTH
final static int TRAVERSAL_KEY_LENGTH(Code)



UP_CYCLE_TRAVERSAL_KEYS
final public static int UP_CYCLE_TRAVERSAL_KEYS(Code)
The identifier for the Up Cycle focus traversal keys.
See Also:   KeyboardFocusManager.setDefaultFocusTraversalKeys
See Also:   KeyboardFocusManager.getDefaultFocusTraversalKeys
See Also:   Component.setFocusTraversalKeys
See Also:   Component.getFocusTraversalKeys



currentSequencedEvent
transient SequencedEvent currentSequencedEvent(Code)



peer
transient KeyboardFocusManagerPeer peer(Code)



proxyActive
static Field proxyActive(Code)




Constructor Detail
KeyboardFocusManager
public KeyboardFocusManager()(Code)
Initializes a KeyboardFocusManager.




Method Detail
addKeyEventDispatcher
public void addKeyEventDispatcher(KeyEventDispatcher dispatcher)(Code)
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.

In a multithreaded application, KeyEventDispatcher behaves the same as other AWT listeners. See AWT Threading Issues for more details.
Parameters:
  dispatcher - the KeyEventDispatcher to add to the dispatcher chain
See Also:   KeyboardFocusManager.removeKeyEventDispatcher




addKeyEventPostProcessor
public void addKeyEventPostProcessor(KeyEventPostProcessor processor)(Code)
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.

In a multithreaded application, KeyEventPostProcessor behaves the same as other AWT listeners. See AWT Threading Issues for more details.
Parameters:
  processor - the KeyEventPostProcessor to add to the post-processorchain
See Also:   KeyboardFocusManager.removeKeyEventPostProcessor




addPropertyChangeListener
public void addPropertyChangeListener(PropertyChangeListener listener)(Code)
Adds a PropertyChangeListener to the listener list. The listener is registered for all bound properties of this class, including the following:
  • whether the KeyboardFocusManager is currently managing focus for this application or applet's browser context ("managingFocus")
  • 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.
Parameters:
  listener - the PropertyChangeListener to be added
See Also:   KeyboardFocusManager.removePropertyChangeListener
See Also:   KeyboardFocusManager.getPropertyChangeListeners
See Also:   KeyboardFocusManager.addPropertyChangeListener(java.lang.String,java.beans.PropertyChangeListener)



addPropertyChangeListener
public void addPropertyChangeListener(String propertyName, PropertyChangeListener listener)(Code)
Adds a PropertyChangeListener to the listener list for a specific property. The specified property may be user-defined, or one of the following:
  • whether the KeyboardFocusManager is currently managing focus for this application or applet's browser context ("managingFocus")
  • 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.
Parameters:
  propertyName - one of the property names listed above
Parameters:
  listener - the PropertyChangeListener to be added
See Also:   KeyboardFocusManager.addPropertyChangeListener(java.beans.PropertyChangeListener)
See Also:   KeyboardFocusManager.removePropertyChangeListener(java.lang.String,java.beans.PropertyChangeListener)
See Also:   KeyboardFocusManager.getPropertyChangeListeners(java.lang.String)



addVetoableChangeListener
public void addVetoableChangeListener(VetoableChangeListener listener)(Code)
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.
Parameters:
  listener - the VetoableChangeListener to be added
See Also:   KeyboardFocusManager.removeVetoableChangeListener
See Also:   KeyboardFocusManager.getVetoableChangeListeners
See Also:   KeyboardFocusManager.addVetoableChangeListener(java.lang.String,java.beans.VetoableChangeListener)



addVetoableChangeListener
public void addVetoableChangeListener(String propertyName, VetoableChangeListener listener)(Code)
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.
Parameters:
  propertyName - one of the property names listed above
Parameters:
  listener - the VetoableChangeListener to be added
See Also:   KeyboardFocusManager.addVetoableChangeListener(java.beans.VetoableChangeListener)
See Also:   KeyboardFocusManager.removeVetoableChangeListener
See Also:   KeyboardFocusManager.getVetoableChangeListeners



clearGlobalFocusOwner
public void clearGlobalFocusOwner()(Code)
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 Also:   Component.requestFocus
See Also:   java.awt.event.FocusEvent.FOCUS_LOST



clearMarkers
void clearMarkers()(Code)
Clears markers queue This method is not intended to be overridden by KFM's. Only DefaultKeyboardFocusManager can implement it.
since:
   1.5



clearMostRecentFocusOwner
static void clearMostRecentFocusOwner(Component comp)(Code)



dequeueKeyEvents
abstract protected void dequeueKeyEvents(long after, Component untilFocused)(Code)
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.
Parameters:
  after - the timestamp specified in the call toenqueueKeyEvents, or any value < 0
Parameters:
  untilFocused - the Component specified in the call toenqueueKeyEvents
See Also:   KeyboardFocusManager.enqueueKeyEvents
See Also:   KeyboardFocusManager.discardKeyEvents



discardKeyEvents
abstract protected void discardKeyEvents(Component comp)(Code)
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.
Parameters:
  comp - the Component specified in one or more calls toenqueueKeyEvents
See Also:   KeyboardFocusManager.enqueueKeyEvents
See Also:   KeyboardFocusManager.dequeueKeyEvents



dispatchEvent
abstract public boolean dispatchEvent(AWTEvent e)(Code)
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.
Parameters:
  e - the AWTEvent to be dispatched true if this method dispatched the event;false otherwise
See Also:   KeyboardFocusManager.redispatchEvent
See Also:   KeyboardFocusManager.dispatchKeyEvent



dispatchKeyEvent
abstract public boolean dispatchKeyEvent(KeyEvent e)(Code)
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.
Parameters:
  e - the KeyEvent which the current KeyboardFocusManager hasrequested that this KeyEventDispatcher dispatch true if the KeyEvent was dispatched;false otherwise
See Also:   KeyboardFocusManager.dispatchEvent



downFocusCycle
abstract public void downFocusCycle(Container aContainer)(Code)
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.
Parameters:
  aContainer - the Container that is the basis for the focustraversal operation



downFocusCycle
final public void downFocusCycle()(Code)
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.



dumpRequests
void dumpRequests()(Code)
Dumps the list of focus requests to stderr



enqueueKeyEvents
abstract protected void enqueueKeyEvents(long after, Component untilFocused)(Code)
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.
Parameters:
  after - timestamp of current event, or the current, system time ifthe current event has no timestamp, or the AWT cannot determinewhich event is currently being handled
Parameters:
  untilFocused - Component which should receive a FOCUS_GAINED eventbefore any pending KeyEvents
See Also:   KeyboardFocusManager.dequeueKeyEvents
See Also:   KeyboardFocusManager.discardKeyEvents



firePropertyChange
protected void firePropertyChange(String propertyName, Object oldValue, Object newValue)(Code)
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.
Parameters:
  propertyName - the name of the property that has changed
Parameters:
  oldValue - the property's previous value
Parameters:
  newValue - the property's new value



fireVetoableChange
protected void fireVetoableChange(String propertyName, Object oldValue, Object newValue) throws PropertyVetoException(Code)
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.
Parameters:
  propertyName - the name of the property that has changed
Parameters:
  oldValue - the property's previous value
Parameters:
  newValue - the property's new value
throws:
  java.beans.PropertyVetoException - if aVetoableChangeListener threwPropertyVetoException



focusNextComponent
abstract public void focusNextComponent(Component aComponent)(Code)
Focuses the Component after aComponent, typically based on a FocusTraversalPolicy.
Parameters:
  aComponent - the Component that is the basis for the focustraversal operation
See Also:   FocusTraversalPolicy



focusNextComponent
final public void focusNextComponent()(Code)
Focuses the Component after the current focus owner.



focusPreviousComponent
abstract public void focusPreviousComponent(Component aComponent)(Code)
Focuses the Component before aComponent, typically based on a FocusTraversalPolicy.
Parameters:
  aComponent - the Component that is the basis for the focustraversal operation
See Also:   FocusTraversalPolicy



focusPreviousComponent
final public void focusPreviousComponent()(Code)
Focuses the Component before the current focus owner.



getActiveWindow
public Window getActiveWindow()(Code)
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. the active Window, or null if the active Window is not a memberof the calling thread's context
See Also:   KeyboardFocusManager.getGlobalActiveWindow
See Also:   KeyboardFocusManager.setGlobalActiveWindow



getCurrentFocusCycleRoot
public Container getCurrentFocusCycleRoot()(Code)
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. the current focus cycle root, or null if the current focus cycleroot is not a member of the calling thread's context
See Also:   KeyboardFocusManager.getGlobalCurrentFocusCycleRoot
See Also:   KeyboardFocusManager.setGlobalCurrentFocusCycleRoot




getCurrentKeyboardFocusManager
public static KeyboardFocusManager getCurrentKeyboardFocusManager()(Code)
Returns the current KeyboardFocusManager instance for the calling thread's context. this thread's context's KeyboardFocusManager
See Also:   KeyboardFocusManager.setCurrentKeyboardFocusManager



getCurrentKeyboardFocusManager
static synchronized KeyboardFocusManager getCurrentKeyboardFocusManager(AppContext appcontext)(Code)



getCurrentSequencedEvent
final SequencedEvent getCurrentSequencedEvent()(Code)



getCurrentWaitingRequest
Component getCurrentWaitingRequest(Component parent)(Code)



getDefaultFocusTraversalKeys
public Set<AWTKeyStroke> getDefaultFocusTraversalKeys(int id)(Code)
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.)
Parameters:
  id - one of KeyboardFocusManager.FORWARD_TRAVERSAL_KEYS,KeyboardFocusManager.BACKWARD_TRAVERSAL_KEYS,KeyboardFocusManager.UP_CYCLE_TRAVERSAL_KEYS, orKeyboardFocusManager.DOWN_CYCLE_TRAVERSAL_KEYS the Set of AWTKeyStrokesfor the specified operation; the Setwill be unmodifiable, and may be empty; nullwill never be returned
See Also:   KeyboardFocusManager.setDefaultFocusTraversalKeys
See Also:   Component.setFocusTraversalKeys
See Also:   Component.getFocusTraversalKeys
throws:
  IllegalArgumentException - if id is not one ofKeyboardFocusManager.FORWARD_TRAVERSAL_KEYS,KeyboardFocusManager.BACKWARD_TRAVERSAL_KEYS,KeyboardFocusManager.UP_CYCLE_TRAVERSAL_KEYS, orKeyboardFocusManager.DOWN_CYCLE_TRAVERSAL_KEYS



getDefaultFocusTraversalPolicy
public synchronized FocusTraversalPolicy getDefaultFocusTraversalPolicy()(Code)
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. the default FocusTraversalPolicy. null will never be returned.
See Also:   KeyboardFocusManager.setDefaultFocusTraversalPolicy
See Also:   Container.setFocusTraversalPolicy
See Also:   Container.getFocusTraversalPolicy



getFocusOwner
public Component getFocusOwner()(Code)
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. the focus owner, or null if the focus owner is not a member ofthe calling thread's context
See Also:   KeyboardFocusManager.getGlobalFocusOwner
See Also:   KeyboardFocusManager.setGlobalFocusOwner



getFocusedWindow
public Window getFocusedWindow()(Code)
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. the focused Window, or null if the focused Window is not amember of the calling thread's context
See Also:   KeyboardFocusManager.getGlobalFocusedWindow
See Also:   KeyboardFocusManager.setGlobalFocusedWindow



getGlobalActiveWindow
protected Window getGlobalActiveWindow() throws SecurityException(Code)
Returns the active Window, even if the calling thread is in a different context than 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.

This method will throw a SecurityException if this KeyboardFocusManager is not the current KeyboardFocusManager for the calling thread's context. the active Window
See Also:   KeyboardFocusManager.getActiveWindow
See Also:   KeyboardFocusManager.setGlobalActiveWindow
throws:
  SecurityException - if this KeyboardFocusManager is not thecurrent KeyboardFocusManager for the calling thread's context




getGlobalCurrentFocusCycleRoot
protected Container getGlobalCurrentFocusCycleRoot() throws SecurityException(Code)
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. the current focus cycle root, or null if the current focus cycleroot is not a member of the calling thread's context
See Also:   KeyboardFocusManager.getCurrentFocusCycleRoot
See Also:   KeyboardFocusManager.setGlobalCurrentFocusCycleRoot
throws:
  SecurityException - if this KeyboardFocusManager is not thecurrent KeyboardFocusManager for the calling thread's context




getGlobalFocusOwner
protected Component getGlobalFocusOwner() throws SecurityException(Code)
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. the focus owner
See Also:   KeyboardFocusManager.getFocusOwner
See Also:   KeyboardFocusManager.setGlobalFocusOwner
throws:
  SecurityException - if this KeyboardFocusManager is not thecurrent KeyboardFocusManager for the calling thread's context




getGlobalFocusedWindow
protected Window getGlobalFocusedWindow() throws SecurityException(Code)
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. the focused Window
See Also:   KeyboardFocusManager.getFocusedWindow
See Also:   KeyboardFocusManager.setGlobalFocusedWindow
throws:
  SecurityException - if this KeyboardFocusManager is not thecurrent KeyboardFocusManager for the calling thread's context




getGlobalPermanentFocusOwner
protected Component getGlobalPermanentFocusOwner() throws SecurityException(Code)
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. the permanent focus owner
See Also:   KeyboardFocusManager.getPermanentFocusOwner
See Also:   KeyboardFocusManager.setGlobalPermanentFocusOwner
throws:
  SecurityException - if this KeyboardFocusManager is not thecurrent KeyboardFocusManager for the calling thread's context




getHeavyweight
static Component getHeavyweight(Component comp)(Code)



getKeyEventDispatchers
protected synchronized java.util.List<KeyEventDispatcher> getKeyEventDispatchers()(Code)
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. a possibly null or empty List of KeyEventDispatchers
See Also:   KeyboardFocusManager.addKeyEventDispatcher
See Also:   KeyboardFocusManager.removeKeyEventDispatcher



getKeyEventPostProcessors
protected java.util.List<KeyEventPostProcessor> getKeyEventPostProcessors()(Code)
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. a possibly null or empty List of KeyEventPostProcessors
See Also:   KeyboardFocusManager.addKeyEventPostProcessor
See Also:   KeyboardFocusManager.removeKeyEventPostProcessor



getMostRecentFocusOwner
static synchronized Component getMostRecentFocusOwner(Window window)(Code)



getNativeFocusOwner
Component getNativeFocusOwner()(Code)



getNativeFocusedWindow
Window getNativeFocusedWindow()(Code)



getPermanentFocusOwner
public Component getPermanentFocusOwner()(Code)
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. the permanent focus owner, or null if the permanent focus owneris not a member of the calling thread's context
See Also:   KeyboardFocusManager.getGlobalPermanentFocusOwner
See Also:   KeyboardFocusManager.setGlobalPermanentFocusOwner



getPropertyChangeListeners
public synchronized PropertyChangeListener[] getPropertyChangeListeners()(Code)
Returns an array of all the property change listeners registered on this keyboard focus manager. all of this keyboard focus manager'sPropertyChangeListenersor an empty array if no property change listeners are currently registered
See Also:   KeyboardFocusManager.addPropertyChangeListener
See Also:   KeyboardFocusManager.removePropertyChangeListener
See Also:   KeyboardFocusManager.getPropertyChangeListeners(java.lang.String)
since:
   1.4



getPropertyChangeListeners
public synchronized PropertyChangeListener[] getPropertyChangeListeners(String propertyName)(Code)
Returns an array of all the PropertyChangeListeners associated with the named property. all of the PropertyChangeListeners associated withthe named property or an empty array if no such listeners havebeen added.
See Also:   KeyboardFocusManager.addPropertyChangeListener(java.lang.String,java.beans.PropertyChangeListener)
See Also:   KeyboardFocusManager.removePropertyChangeListener(java.lang.String,java.beans.PropertyChangeListener)
since:
   1.4



getVetoableChangeListeners
public synchronized VetoableChangeListener[] getVetoableChangeListeners()(Code)
Returns an array of all the vetoable change listeners registered on this keyboard focus manager. all of this keyboard focus manager'sVetoableChangeListenersor an empty array if no vetoable change listeners are currently registered
See Also:   KeyboardFocusManager.addVetoableChangeListener
See Also:   KeyboardFocusManager.removeVetoableChangeListener
See Also:   KeyboardFocusManager.getVetoableChangeListeners(java.lang.String)
since:
   1.4



getVetoableChangeListeners
public synchronized VetoableChangeListener[] getVetoableChangeListeners(String propertyName)(Code)
Returns an array of all the VetoableChangeListeners associated with the named property. all of the VetoableChangeListeners associated withthe named property or an empty array if no such listeners havebeen added.
See Also:   KeyboardFocusManager.addVetoableChangeListener(java.lang.String,java.beans.VetoableChangeListener)
See Also:   KeyboardFocusManager.removeVetoableChangeListener(java.lang.String,java.beans.VetoableChangeListener)
See Also:   KeyboardFocusManager.getVetoableChangeListeners
since:
   1.4



heavyweightButtonDown
static void heavyweightButtonDown(Component heavyweight, long time)(Code)



heavyweightButtonDown
static void heavyweightButtonDown(Component heavyweight, long time, boolean acceptDuplicates)(Code)



initFocusTraversalKeysSet
static Set initFocusTraversalKeysSet(String value, Set targetSet)(Code)



isAutoFocusTransferEnabled
static boolean isAutoFocusTransferEnabled()(Code)



isProxyActive
static boolean isProxyActive(KeyEvent e)(Code)



markClearGlobalFocusOwner
static Window markClearGlobalFocusOwner()(Code)
Returns the Window which will be active after processing this request, or null if this is a duplicate request. The active Window is useful because some native platforms do not support setting the native focus owner to null. On these platforms, the obvious choice is to set the focus owner to the focus proxy of the active Window.



postProcessKeyEvent
abstract public boolean postProcessKeyEvent(KeyEvent e)(Code)
This method will be called by dispatchKeyEvent. By default, this method will handle any unconsumed KeyEvents that map to an AWT MenuShortcut by consuming the event and activating the shortcut.
Parameters:
  e - the KeyEvent to post-process true to indicate that no otherKeyEventPostProcessor will be notified of the KeyEvent.
See Also:   KeyboardFocusManager.dispatchKeyEvent
See Also:   MenuShortcut



processCurrentLightweightRequests
static void processCurrentLightweightRequests()(Code)



processKeyEvent
abstract public void processKeyEvent(Component focusedComponent, KeyEvent e)(Code)
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.
Parameters:
  focusedComponent - the Component that will be the basis for a focustraversal operation if the specified event represents a focustraversal key for the Component
Parameters:
  e - the event that may represent a focus traversal key



processSynchronousLightweightTransfer
static boolean processSynchronousLightweightTransfer(Component heavyweight, Component descendant, boolean temporary, boolean focusedWindowChangeAllowed, long time)(Code)



redispatchEvent
final public void redispatchEvent(Component target, AWTEvent e)(Code)
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.
Parameters:
  target - the Component to which the event should be dispatched
Parameters:
  e - the event to dispatch
See Also:   KeyboardFocusManager.dispatchEvent
See Also:   KeyEventDispatcher




removeFirstRequest
static boolean removeFirstRequest()(Code)



removeKeyEventDispatcher
public void removeKeyEventDispatcher(KeyEventDispatcher dispatcher)(Code)
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.

In a multithreaded application, KeyEventDispatcher behaves the same as other AWT listeners. See AWT Threading Issues for more details.
Parameters:
  dispatcher - the KeyEventDispatcher to remove from the dispatcherchain
See Also:   KeyboardFocusManager.addKeyEventDispatcher




removeKeyEventPostProcessor
public void removeKeyEventPostProcessor(KeyEventPostProcessor processor)(Code)
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.

In a multithreaded application, KeyEventPostProcessor behaves the same as other AWT listeners. See AWT Threading Issues for more details.
Parameters:
  processor - the KeyEventPostProcessor to remove from the post-processor chain
See Also:   KeyboardFocusManager.addKeyEventPostProcessor




removeLastFocusRequest
static void removeLastFocusRequest(Component heavyweight)(Code)



removePropertyChangeListener
public void removePropertyChangeListener(PropertyChangeListener listener)(Code)
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.
Parameters:
  listener - the PropertyChangeListener to be removed
See Also:   KeyboardFocusManager.addPropertyChangeListener
See Also:   KeyboardFocusManager.getPropertyChangeListeners
See Also:   KeyboardFocusManager.removePropertyChangeListener(java.lang.String,java.beans.PropertyChangeListener)




removePropertyChangeListener
public void removePropertyChangeListener(String propertyName, PropertyChangeListener listener)(Code)
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.
Parameters:
  propertyName - a valid property name
Parameters:
  listener - the PropertyChangeListener to be removed
See Also:   KeyboardFocusManager.addPropertyChangeListener(java.lang.String,java.beans.PropertyChangeListener)
See Also:   KeyboardFocusManager.getPropertyChangeListeners(java.lang.String)
See Also:   KeyboardFocusManager.removePropertyChangeListener(java.beans.PropertyChangeListener)




removeVetoableChangeListener
public void removeVetoableChangeListener(VetoableChangeListener listener)(Code)
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.
Parameters:
  listener - the VetoableChangeListener to be removed
See Also:   KeyboardFocusManager.addVetoableChangeListener
See Also:   KeyboardFocusManager.getVetoableChangeListeners
See Also:   KeyboardFocusManager.removeVetoableChangeListener(java.lang.String,java.beans.VetoableChangeListener)




removeVetoableChangeListener
public void removeVetoableChangeListener(String propertyName, VetoableChangeListener listener)(Code)
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.
Parameters:
  propertyName - a valid property name
Parameters:
  listener - the VetoableChangeListener to be removed
See Also:   KeyboardFocusManager.addVetoableChangeListener
See Also:   KeyboardFocusManager.getVetoableChangeListeners
See Also:   KeyboardFocusManager.removeVetoableChangeListener(java.beans.VetoableChangeListener)




retargetFocusEvent
static AWTEvent retargetFocusEvent(AWTEvent event)(Code)



retargetFocusGained
static FocusEvent retargetFocusGained(FocusEvent fe)(Code)



retargetFocusLost
static FocusEvent retargetFocusLost(FocusEvent fe)(Code)



retargetUnexpectedFocusEvent
static FocusEvent retargetUnexpectedFocusEvent(FocusEvent fe)(Code)



setCurrentKeyboardFocusManager
public static void setCurrentKeyboardFocusManager(KeyboardFocusManager newManager) throws SecurityException(Code)
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.
Parameters:
  newManager - the new KeyboardFocusManager for this thread's context
See Also:   KeyboardFocusManager.getCurrentKeyboardFocusManager
See Also:   DefaultKeyboardFocusManager
throws:
  SecurityException - if the calling thread does not have permissionto replace the current KeyboardFocusManager




setCurrentSequencedEvent
final void setCurrentSequencedEvent(SequencedEvent current)(Code)



setDefaultFocusTraversalKeys
public void setDefaultFocusTraversalKeys(int id, Set<? extends AWTKeyStroke> keystrokes)(Code)
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.
Parameters:
  id - one ofKeyboardFocusManager.FORWARD_TRAVERSAL_KEYS,KeyboardFocusManager.BACKWARD_TRAVERSAL_KEYS,KeyboardFocusManager.UP_CYCLE_TRAVERSAL_KEYS, orKeyboardFocusManager.DOWN_CYCLE_TRAVERSAL_KEYS
Parameters:
  keystrokes - the Set of AWTKeyStrokes for thespecified operation
See Also:   KeyboardFocusManager.getDefaultFocusTraversalKeys
See Also:   Component.setFocusTraversalKeys
See Also:   Component.getFocusTraversalKeys
throws:
  IllegalArgumentException - if id is not one ofKeyboardFocusManager.FORWARD_TRAVERSAL_KEYS,KeyboardFocusManager.BACKWARD_TRAVERSAL_KEYS,KeyboardFocusManager.UP_CYCLE_TRAVERSAL_KEYS, orKeyboardFocusManager.DOWN_CYCLE_TRAVERSAL_KEYS,or if keystrokes is null,or if keystrokes contains null,or if any Object inkeystrokes is not an AWTKeyStroke,or if any keystrokerepresents a KEY_TYPED event,or if any keystroke already mapsto another default focus traversal operation




setDefaultFocusTraversalPolicy
public void setDefaultFocusTraversalPolicy(FocusTraversalPolicy defaultPolicy)(Code)
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.
Parameters:
  defaultPolicy - the new, default FocusTraversalPolicy
See Also:   KeyboardFocusManager.getDefaultFocusTraversalPolicy
See Also:   Container.setFocusTraversalPolicy
See Also:   Container.getFocusTraversalPolicy
throws:
  IllegalArgumentException - if defaultPolicy is null



setGlobalActiveWindow
protected void setGlobalActiveWindow(Window activeWindow)(Code)
Sets 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.

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.
Parameters:
  activeWindow - the active Window
See Also:   KeyboardFocusManager.getActiveWindow
See Also:   KeyboardFocusManager.getGlobalActiveWindow
See Also:   Component.requestFocus
See Also:   Component.requestFocusInWindow




setGlobalCurrentFocusCycleRoot
public void setGlobalCurrentFocusCycleRoot(Container newFocusCycleRoot)(Code)
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.
Parameters:
  newFocusCycleRoot - the new focus cycle root
See Also:   KeyboardFocusManager.getCurrentFocusCycleRoot
See Also:   KeyboardFocusManager.getGlobalCurrentFocusCycleRoot




setGlobalFocusOwner
protected void setGlobalFocusOwner(Component focusOwner)(Code)
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.
Parameters:
  focusOwner - the focus owner
See Also:   KeyboardFocusManager.getFocusOwner
See Also:   KeyboardFocusManager.getGlobalFocusOwner
See Also:   Component.requestFocus
See Also:   Component.requestFocusInWindow
See Also:   Component.isFocusable




setGlobalFocusedWindow
protected void setGlobalFocusedWindow(Window focusedWindow)(Code)
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.
Parameters:
  focusedWindow - the focused Window
See Also:   KeyboardFocusManager.getFocusedWindow
See Also:   KeyboardFocusManager.getGlobalFocusedWindow
See Also:   Component.requestFocus
See Also:   Component.requestFocusInWindow
See Also:   Window.isFocusableWindow




setGlobalPermanentFocusOwner
protected void setGlobalPermanentFocusOwner(Component permanentFocusOwner)(Code)
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.
Parameters:
  permanentFocusOwner - the permanent focus owner
See Also:   KeyboardFocusManager.getPermanentFocusOwner
See Also:   KeyboardFocusManager.getGlobalPermanentFocusOwner
See Also:   Component.requestFocus
See Also:   Component.requestFocusInWindow
See Also:   Component.isFocusable




setMostRecentFocusOwner
static void setMostRecentFocusOwner(Component component)(Code)



setMostRecentFocusOwner
static synchronized void setMostRecentFocusOwner(Window window, Component component)(Code)



setNativeFocusOwner
void setNativeFocusOwner(Component comp)(Code)



shouldNativelyFocusHeavyweight
static int shouldNativelyFocusHeavyweight(Component heavyweight, Component descendant, boolean temporary, boolean focusedWindowChangeAllowed, long time, CausedFocusEvent.Cause cause)(Code)
Indicates whether the native implementation should proceed with a pending, native focus request. Before changing the focus at the native level, the AWT implementation should always call this function for permission. This function will reject the request if a duplicate request preceded it, or if the specified heavyweight Component already owns the focus and no native focus changes are pending. Otherwise, the request will be approved and the focus request list will be updated so that, if necessary, the proper descendant will be focused when the corresponding FOCUS_GAINED event on the heavyweight is received. An implementation must ensure that calls to this method and native focus changes are atomic. If this is not guaranteed, then the ordering of the focus request list may be incorrect, leading to errors in the type-ahead mechanism. Typically this is accomplished by only calling this function from the native event pumping thread, or by holding a global, native lock during invocation.



upFocusCycle
abstract public void upFocusCycle(Component aComponent)(Code)
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.
Parameters:
  aComponent - the Component that is the basis for the focustraversal operation



upFocusCycle
final public void upFocusCycle()(Code)
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.



Methods inherited from java.lang.Object
native protected Object clone() throws CloneNotSupportedException(Code)(Java Doc)
public boolean equals(Object obj)(Code)(Java Doc)
protected void finalize() throws Throwable(Code)(Java Doc)
final native public Class getClass()(Code)(Java Doc)
native public int hashCode()(Code)(Java Doc)
final native public void notify()(Code)(Java Doc)
final native public void notifyAll()(Code)(Java Doc)
public String toString()(Code)(Java Doc)
final native public void wait(long timeout) throws InterruptedException(Code)(Java Doc)
final public void wait(long timeout, int nanos) throws InterruptedException(Code)(Java Doc)
final public void wait() throws InterruptedException(Code)(Java Doc)

www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.