java.lang.Objectjava.awt.KeyboardFocusManager
java.awt.DefaultKeyboardFocusManager
public class DefaultKeyboardFocusManager
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.
FocusTraversalPolicy,
Component.setFocusTraversalKeys(int, java.util.Set extends java.awt.AWTKeyStroke>),
Component.getFocusTraversalKeys(int)| Field Summary |
|---|
| Fields inherited from class java.awt.KeyboardFocusManager |
|---|
BACKWARD_TRAVERSAL_KEYS, DOWN_CYCLE_TRAVERSAL_KEYS, FORWARD_TRAVERSAL_KEYS, UP_CYCLE_TRAVERSAL_KEYS |
| Constructor Summary | |
|---|---|
DefaultKeyboardFocusManager()
|
|
| Method Summary | |
|---|---|
protected void |
dequeueKeyEvents(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 void |
discardKeyEvents(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. |
boolean |
dispatchEvent(AWTEvent e)
This method is called by the AWT event dispatcher requesting that the current KeyboardFocusManager dispatch the specified event on its behalf. |
boolean |
dispatchKeyEvent(KeyEvent e)
Called by dispatchEvent if no other
KeyEventDispatcher in the dispatcher chain dispatched the KeyEvent, or
if no other KeyEventDispatchers are registered. |
void |
downFocusCycle(Container aContainer)
Moves the focus down one focus traversal cycle. |
protected void |
enqueueKeyEvents(long after,
Component untilFocused)
Delays dispatching of KeyEvents until the specified Component becomes the focus owner. |
void |
focusNextComponent(Component aComponent)
Focuses the Component after aComponent, typically based on a FocusTraversalPolicy. |
void |
focusPreviousComponent(Component aComponent)
Focuses the Component before aComponent, typically based on a FocusTraversalPolicy. |
boolean |
postProcessKeyEvent(KeyEvent e)
This method will be called by dispatchKeyEvent. |
void |
processKeyEvent(Component focusedComponent,
KeyEvent e)
This method initiates a focus traversal operation if and only if the KeyEvent represents a focus traversal key for the specified focusedComponent. |
void |
upFocusCycle(Component aComponent)
Moves the focus up one focus traversal cycle. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public DefaultKeyboardFocusManager()
| Method Detail |
|---|
public boolean dispatchEvent(AWTEvent e)
false, then the AWT event
dispatcher will attempt to dispatch the event itself.
dispatchEvent in class KeyboardFocusManagere - the AWTEvent to be dispatched
true if this method dispatched the event;
false otherwiseKeyboardFocusManager.redispatchEvent(java.awt.Component, java.awt.AWTEvent),
KeyboardFocusManager.dispatchKeyEvent(java.awt.event.KeyEvent)public boolean dispatchKeyEvent(KeyEvent e)
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.
dispatchKeyEvent in interface KeyEventDispatcherdispatchKeyEvent in class KeyboardFocusManagere - the KeyEvent to be dispatched
trueComponent.dispatchEvent(java.awt.AWTEvent)public boolean postProcessKeyEvent(KeyEvent e)
dispatchKeyEvent. It will
handle any unconsumed KeyEvents that map to an AWT
MenuShortcut by consuming the event and activating the
shortcut.
postProcessKeyEvent in interface KeyEventPostProcessorpostProcessKeyEvent in class KeyboardFocusManagere - the KeyEvent to post-process
truedispatchKeyEvent(java.awt.event.KeyEvent),
MenuShortcutpublic void processKeyEvent(Component focusedComponent, KeyEvent e)
processKeyEvent in class KeyboardFocusManagerfocusedComponent - the Component that is the basis for a focus
traversal operation if the specified event represents a focus
traversal key for the Componente - the event that may represent a focus traversal key
protected void enqueueKeyEvents(long after,
Component untilFocused)
dequeueKeyEvents or discardKeyEvents.
enqueueKeyEvents in class KeyboardFocusManagerafter - timestamp of current event, or the current, system time if
the current event has no timestamp, or the AWT cannot determine
which event is currently being handleduntilFocused - Component which will receive a FOCUS_GAINED event
before any pending KeyEventsdequeueKeyEvents(long, java.awt.Component),
discardKeyEvents(java.awt.Component)
protected void dequeueKeyEvents(long after,
Component untilFocused)
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.
dequeueKeyEvents in class KeyboardFocusManagerafter - the timestamp specified in the call to
enqueueKeyEvents, or any value < 0untilFocused - the Component specified in the call to
enqueueKeyEventsenqueueKeyEvents(long, java.awt.Component),
discardKeyEvents(java.awt.Component)protected void discardKeyEvents(Component comp)
enqueueKeyEvents with the specified Component, or one of
its descendants.
discardKeyEvents in class KeyboardFocusManagercomp - the Component specified in one or more calls to
enqueueKeyEvents, or a parent of such a ComponentenqueueKeyEvents(long, java.awt.Component),
dequeueKeyEvents(long, java.awt.Component)public void focusPreviousComponent(Component aComponent)
focusPreviousComponent in class KeyboardFocusManageraComponent - the Component that is the basis for the focus
traversal operationFocusTraversalPolicy,
Component.transferFocusBackward()public void focusNextComponent(Component aComponent)
focusNextComponent in class KeyboardFocusManageraComponent - the Component that is the basis for the focus
traversal operationFocusTraversalPolicy,
Component.transferFocus()public void upFocusCycle(Component aComponent)
upFocusCycle in class KeyboardFocusManageraComponent - the Component that is the basis for the focus
traversal operationComponent.transferFocusUpCycle()public void downFocusCycle(Container aContainer)
downFocusCycle in class KeyboardFocusManageraContainer - the Container that is the basis for the focus
traversal operationContainer.transferFocusDownCycle()Ces informations proviennent du site de http://java.sun.com
Le contenu de cette page provient du site de Sun, et est généré depuis un cache sur l'infobrol après certains traitements automatisés. La présentation peut donc différer du document original, mais le contenu aussi. Vous pouvez utiliser ce bouton pour afficher la page originale du site de Sun :
Maintenir les pages en cache sur différents sites peut offrir plus de disponibilité.
Chaque page est indexée dans la base de donnée, ce qui permet de retrouver facilement les informations, au moyen des sommaires, du moteur de recherche interne, etc.
Des facilités sont mises en place pour que les membres de l'infobrol puissent effectuer des traductions en français des différents documents. Ceci devrait permettre aux débutants en programmation Java de consulter les API en français s'ils maîtrisent moins bien la langue de Shakespeare. Dans le cas où une traduction a été soumise, elle est disponible au moyen d'un lien en bas de page. Si la traduction a été validée, la page s'affiche par défaut en français, et un lien en bas de page permet d'atteindre la version en anglais.
Le code sur l'infobrol est automatiquement coloré selon la syntaxe, et les différents mots clés sont transformés en liens pour accéder rapidement aux informations.
Vous avez la possibilité de partager vos expériences en proposant vos propres extraits de code en utilisant le bouton "ajouter un commentaire" en bas de page. Si vous visitez simplement l'infobrol, vous avez déjà accès à cette fonction, mais si vous étes membre du brol, vous pouvez en plus utiliser des boutons supplémentaires de mise en forme, dont la coloration automatique de vos extraits de codes.
Vous pouvez modifier vos préférences dans votre profil pour ne plus afficher les interactions avec les réseaux sociaux sur ces pages.
6 mots clés dont 0 définis manuellement (plus d'information...).
Avertissement
Cette page ne possède pas encore de mots clés manuels, ceci est donc un exemple automatique (les niveaux de pertinence sont fictifs, mais les liens sont valables). Pour tester le nuage avec une page qui contient des mots définis manuellement, vous pouvez cliquer ici.Vous pouvez modifier vos préférences dans votre profil pour ne plus afficher le nuage de mots clés.
Recherche (afficher)
Utilisateur (masquer)
Navigation (masquer)
Apparence (afficher)
Stats (afficher)
Citation (masquer)