Java Doc for DefaultKeyboardFocusManager.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
      java.awt.DefaultKeyboardFocusManager

DefaultKeyboardFocusManager
public class DefaultKeyboardFocusManager extends KeyboardFocusManager (Code)
The default KeyboardFocusManager for AWT applications. Focus traversal is done in response to a Component's focus traversal keys, and using a Container's FocusTraversalPolicy.

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.51, 06/25/07
See Also:   FocusTraversalPolicy
See Also:   Component.setFocusTraversalKeys
See Also:   Component.getFocusTraversalKeys
since:
   1.4





Method Summary
 voidclearMarkers()
    
protected synchronized  voiddequeueKeyEvents(long after, Component untilFocused)
     Releases for normal dispatching to the current focus owner all KeyEvents which were enqueued because of a call to enqueueKeyEvents with the same timestamp and Component.
protected synchronized  voiddiscardKeyEvents(Component comp)
     Discards all KeyEvents which were enqueued because of one or more calls to enqueueKeyEvents with the specified Component, or one of its descendants.
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. DefaultKeyboardFocusManagers dispatch all FocusEvents, all WindowEvents related to focus, and all KeyEvents.
public  booleandispatchKeyEvent(KeyEvent e)
     Called by dispatchEvent if no other KeyEventDispatcher in the dispatcher chain dispatched the KeyEvent, or if no other KeyEventDispatchers are registered.
public  voiddownFocusCycle(Container aContainer)
     Moves the focus down one focus traversal cycle.
 voiddumpMarkers()
    
protected synchronized  voidenqueueKeyEvents(long after, Component untilFocused)
     Delays dispatching of KeyEvents until the specified Component becomes the focus owner.
public  voidfocusNextComponent(Component aComponent)
     Focuses the Component after aComponent, typically based on a FocusTraversalPolicy.
public  voidfocusPreviousComponent(Component aComponent)
     Focuses the Component before aComponent, typically based on a FocusTraversalPolicy.
public  booleanpostProcessKeyEvent(KeyEvent e)
     This method will be called by dispatchKeyEvent.
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  booleansendMessage(Component target, AWTEvent e)
     Sends a synthetic AWTEvent to a Component.
public  voidupFocusCycle(Component aComponent)
     Moves the focus up one focus traversal cycle.



Method Detail
clearMarkers
void clearMarkers()(Code)
Clears markers queue
since:
   1.5



dequeueKeyEvents
protected synchronized void dequeueKeyEvents(long after, Component untilFocused)(Code)
Releases for normal dispatching to the current focus owner all KeyEvents which were enqueued because of a call to enqueueKeyEvents with the same timestamp and Component. 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:   DefaultKeyboardFocusManager.enqueueKeyEvents
See Also:   DefaultKeyboardFocusManager.discardKeyEvents



discardKeyEvents
protected synchronized void discardKeyEvents(Component comp)(Code)
Discards all KeyEvents which were enqueued because of one or more calls to enqueueKeyEvents with the specified Component, or one of its descendants.
Parameters:
  comp - the Component specified in one or more calls toenqueueKeyEvents, or a parent of such a Component
See Also:   DefaultKeyboardFocusManager.enqueueKeyEvents
See Also:   DefaultKeyboardFocusManager.dequeueKeyEvents



dispatchEvent
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. 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.
Parameters:
  e - the AWTEvent to be dispatched true if this method dispatched the event;false otherwise



dispatchKeyEvent
public boolean dispatchKeyEvent(KeyEvent e)(Code)
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.
Parameters:
  e - the KeyEvent to be dispatched true
See Also:   Component.dispatchEvent




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



dumpMarkers
void dumpMarkers()(Code)
Dumps the list of type-ahead queue markers to stderr



enqueueKeyEvents
protected synchronized void enqueueKeyEvents(long after, Component untilFocused)(Code)
Delays dispatching of KeyEvents until the specified Component becomes the focus owner. KeyEvents with timestamps later than the specified timestamp will be enqueued 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 will receive a FOCUS_GAINED eventbefore any pending KeyEvents
See Also:   DefaultKeyboardFocusManager.dequeueKeyEvents
See Also:   DefaultKeyboardFocusManager.discardKeyEvents



focusNextComponent
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
See Also:   Component.transferFocus



focusPreviousComponent
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
See Also:   Component.transferFocusBackward



postProcessKeyEvent
public boolean postProcessKeyEvent(KeyEvent e)(Code)
This method will be called by dispatchKeyEvent. It 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
See Also:   DefaultKeyboardFocusManager.dispatchKeyEvent
See Also:   MenuShortcut



processKeyEvent
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 focus owner.
Parameters:
  focusedComponent - the Component that is 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



sendMessage
static boolean sendMessage(Component target, AWTEvent e)(Code)
Sends a synthetic AWTEvent to a Component. If the Component is in the current AppContext, then the event is immediately dispatched. If the Component is in a different AppContext, then the event is posted to the other AppContext's EventQueue, and this method blocks until the event is handled or target AppContext is disposed. Returns true if successfuly dispatched event, false if failed to dispatch.



upFocusCycle
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 the focus owner is set to the focus cycle root'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
See Also:   Component.transferFocusUpCycle



Fields inherited from java.awt.KeyboardFocusManager
final public static int BACKWARD_TRAVERSAL_KEYS(Code)(Java Doc)
final public static int DOWN_CYCLE_TRAVERSAL_KEYS(Code)(Java Doc)
final public static int FORWARD_TRAVERSAL_KEYS(Code)(Java Doc)
final static int SNFH_FAILURE(Code)(Java Doc)
final static int SNFH_SUCCESS_HANDLED(Code)(Java Doc)
final static int SNFH_SUCCESS_PROCEED(Code)(Java Doc)
final static int TRAVERSAL_KEY_LENGTH(Code)(Java Doc)
final public static int UP_CYCLE_TRAVERSAL_KEYS(Code)(Java Doc)
transient SequencedEvent currentSequencedEvent(Code)(Java Doc)
transient KeyboardFocusManagerPeer peer(Code)(Java Doc)
static Field proxyActive(Code)(Java Doc)

Methods inherited from java.awt.KeyboardFocusManager
public void addKeyEventDispatcher(KeyEventDispatcher dispatcher)(Code)(Java Doc)
public void addKeyEventPostProcessor(KeyEventPostProcessor processor)(Code)(Java Doc)
public void addPropertyChangeListener(PropertyChangeListener listener)(Code)(Java Doc)
public void addPropertyChangeListener(String propertyName, PropertyChangeListener listener)(Code)(Java Doc)
public void addVetoableChangeListener(VetoableChangeListener listener)(Code)(Java Doc)
public void addVetoableChangeListener(String propertyName, VetoableChangeListener listener)(Code)(Java Doc)
public void clearGlobalFocusOwner()(Code)(Java Doc)
void clearMarkers()(Code)(Java Doc)
static void clearMostRecentFocusOwner(Component comp)(Code)(Java Doc)
abstract protected void dequeueKeyEvents(long after, Component untilFocused)(Code)(Java Doc)
abstract protected void discardKeyEvents(Component comp)(Code)(Java Doc)
abstract public boolean dispatchEvent(AWTEvent e)(Code)(Java Doc)
abstract public boolean dispatchKeyEvent(KeyEvent e)(Code)(Java Doc)
abstract public void downFocusCycle(Container aContainer)(Code)(Java Doc)
final public void downFocusCycle()(Code)(Java Doc)
void dumpRequests()(Code)(Java Doc)
abstract protected void enqueueKeyEvents(long after, Component untilFocused)(Code)(Java Doc)
protected void firePropertyChange(String propertyName, Object oldValue, Object newValue)(Code)(Java Doc)
protected void fireVetoableChange(String propertyName, Object oldValue, Object newValue) throws PropertyVetoException(Code)(Java Doc)
abstract public void focusNextComponent(Component aComponent)(Code)(Java Doc)
final public void focusNextComponent()(Code)(Java Doc)
abstract public void focusPreviousComponent(Component aComponent)(Code)(Java Doc)
final public void focusPreviousComponent()(Code)(Java Doc)
public Window getActiveWindow()(Code)(Java Doc)
public Container getCurrentFocusCycleRoot()(Code)(Java Doc)
public static KeyboardFocusManager getCurrentKeyboardFocusManager()(Code)(Java Doc)
static synchronized KeyboardFocusManager getCurrentKeyboardFocusManager(AppContext appcontext)(Code)(Java Doc)
final SequencedEvent getCurrentSequencedEvent()(Code)(Java Doc)
Component getCurrentWaitingRequest(Component parent)(Code)(Java Doc)
public Set<AWTKeyStroke> getDefaultFocusTraversalKeys(int id)(Code)(Java Doc)
public synchronized FocusTraversalPolicy getDefaultFocusTraversalPolicy()(Code)(Java Doc)
public Component getFocusOwner()(Code)(Java Doc)
public Window getFocusedWindow()(Code)(Java Doc)
protected Window getGlobalActiveWindow() throws SecurityException(Code)(Java Doc)
protected Container getGlobalCurrentFocusCycleRoot() throws SecurityException(Code)(Java Doc)
protected Component getGlobalFocusOwner() throws SecurityException(Code)(Java Doc)
protected Window getGlobalFocusedWindow() throws SecurityException(Code)(Java Doc)
protected Component getGlobalPermanentFocusOwner() throws SecurityException(Code)(Java Doc)
static Component getHeavyweight(Component comp)(Code)(Java Doc)
protected synchronized java.util.List<KeyEventDispatcher> getKeyEventDispatchers()(Code)(Java Doc)
protected java.util.List<KeyEventPostProcessor> getKeyEventPostProcessors()(Code)(Java Doc)
static synchronized Component getMostRecentFocusOwner(Window window)(Code)(Java Doc)
Component getNativeFocusOwner()(Code)(Java Doc)
Window getNativeFocusedWindow()(Code)(Java Doc)
public Component getPermanentFocusOwner()(Code)(Java Doc)
public synchronized PropertyChangeListener[] getPropertyChangeListeners()(Code)(Java Doc)
public synchronized PropertyChangeListener[] getPropertyChangeListeners(String propertyName)(Code)(Java Doc)
public synchronized VetoableChangeListener[] getVetoableChangeListeners()(Code)(Java Doc)
public synchronized VetoableChangeListener[] getVetoableChangeListeners(String propertyName)(Code)(Java Doc)
static void heavyweightButtonDown(Component heavyweight, long time)(Code)(Java Doc)
static void heavyweightButtonDown(Component heavyweight, long time, boolean acceptDuplicates)(Code)(Java Doc)
static Set initFocusTraversalKeysSet(String value, Set targetSet)(Code)(Java Doc)
static boolean isAutoFocusTransferEnabled()(Code)(Java Doc)
static boolean isProxyActive(KeyEvent e)(Code)(Java Doc)
static Window markClearGlobalFocusOwner()(Code)(Java Doc)
abstract public boolean postProcessKeyEvent(KeyEvent e)(Code)(Java Doc)
static void processCurrentLightweightRequests()(Code)(Java Doc)
abstract public void processKeyEvent(Component focusedComponent, KeyEvent e)(Code)(Java Doc)
static boolean processSynchronousLightweightTransfer(Component heavyweight, Component descendant, boolean temporary, boolean focusedWindowChangeAllowed, long time)(Code)(Java Doc)
final public void redispatchEvent(Component target, AWTEvent e)(Code)(Java Doc)
static boolean removeFirstRequest()(Code)(Java Doc)
public void removeKeyEventDispatcher(KeyEventDispatcher dispatcher)(Code)(Java Doc)
public void removeKeyEventPostProcessor(KeyEventPostProcessor processor)(Code)(Java Doc)
static void removeLastFocusRequest(Component heavyweight)(Code)(Java Doc)
public void removePropertyChangeListener(PropertyChangeListener listener)(Code)(Java Doc)
public void removePropertyChangeListener(String propertyName, PropertyChangeListener listener)(Code)(Java Doc)
public void removeVetoableChangeListener(VetoableChangeListener listener)(Code)(Java Doc)
public void removeVetoableChangeListener(String propertyName, VetoableChangeListener listener)(Code)(Java Doc)
static AWTEvent retargetFocusEvent(AWTEvent event)(Code)(Java Doc)
static FocusEvent retargetFocusGained(FocusEvent fe)(Code)(Java Doc)
static FocusEvent retargetFocusLost(FocusEvent fe)(Code)(Java Doc)
static FocusEvent retargetUnexpectedFocusEvent(FocusEvent fe)(Code)(Java Doc)
public static void setCurrentKeyboardFocusManager(KeyboardFocusManager newManager) throws SecurityException(Code)(Java Doc)
final void setCurrentSequencedEvent(SequencedEvent current)(Code)(Java Doc)
public void setDefaultFocusTraversalKeys(int id, Set<? extends AWTKeyStroke> keystrokes)(Code)(Java Doc)
public void setDefaultFocusTraversalPolicy(FocusTraversalPolicy defaultPolicy)(Code)(Java Doc)
protected void setGlobalActiveWindow(Window activeWindow)(Code)(Java Doc)
public void setGlobalCurrentFocusCycleRoot(Container newFocusCycleRoot)(Code)(Java Doc)
protected void setGlobalFocusOwner(Component focusOwner)(Code)(Java Doc)
protected void setGlobalFocusedWindow(Window focusedWindow)(Code)(Java Doc)
protected void setGlobalPermanentFocusOwner(Component permanentFocusOwner)(Code)(Java Doc)
static void setMostRecentFocusOwner(Component component)(Code)(Java Doc)
static synchronized void setMostRecentFocusOwner(Window window, Component component)(Code)(Java Doc)
void setNativeFocusOwner(Component comp)(Code)(Java Doc)
static int shouldNativelyFocusHeavyweight(Component heavyweight, Component descendant, boolean temporary, boolean focusedWindowChangeAllowed, long time, CausedFocusEvent.Cause cause)(Code)(Java Doc)
abstract public void upFocusCycle(Component aComponent)(Code)(Java Doc)
final public void upFocusCycle()(Code)(Java Doc)

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.