java.awt

Class DefaultKeyboardFocusManager

    • Constructor Detail
      • DefaultKeyboardFocusManager
        public DefaultKeyboardFocusManager()
    • Method Detail
      • dispatchEvent
        public 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. 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.
        Specified by:
        dispatchEvent in class KeyboardFocusManager
        Parameters:
        e - the AWTEvent to be dispatched
        Returns:
        true if this method dispatched the event; false otherwise
        See Also:
        KeyboardFocusManager.redispatchEvent(java.awt.Component, java.awt.AWTEvent), KeyboardFocusManager.dispatchKeyEvent(java.awt.event.KeyEvent)
      • dispatchKeyEvent
        public 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. If the event has not been consumed, its target is enabled, and the focus owner is not null, this method dispatches the event to its target. This method will also subsequently dispatch the event to all registered KeyEventPostProcessors. After all this operations are finished, the event is passed to peers for processing.

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

        Specified by:
        dispatchKeyEvent in interface KeyEventDispatcher
        Specified by:
        dispatchKeyEvent in class KeyboardFocusManager
        Parameters:
        e - the KeyEvent to be dispatched
        Returns:
        true
        See Also:
        Component.dispatchEvent(java.awt.AWTEvent)
      • processKeyEvent
        public 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. 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.
        Specified by:
        processKeyEvent in class KeyboardFocusManager
        Parameters:
        focusedComponent - the Component that is the basis for a focus traversal operation if the specified event represents a focus traversal key for the Component
        e - the event that may represent a focus traversal key
      • enqueueKeyEvents
        protected void enqueueKeyEvents(long after,
                            Component untilFocused)
        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.
        Specified by:
        enqueueKeyEvents in class KeyboardFocusManager
        Parameters:
        after - 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 handled
        untilFocused - Component which will receive a FOCUS_GAINED event before any pending KeyEvents
        See Also:
        dequeueKeyEvents(long, java.awt.Component), discardKeyEvents(java.awt.Component)
      • dequeueKeyEvents
        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. 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.
        Specified by:
        dequeueKeyEvents in class KeyboardFocusManager
        Parameters:
        after - the timestamp specified in the call to enqueueKeyEvents, or any value < 0
        untilFocused - the Component specified in the call to enqueueKeyEvents
        See Also:
        enqueueKeyEvents(long, java.awt.Component), discardKeyEvents(java.awt.Component)
      • upFocusCycle
        public void upFocusCycle(Component aComponent)
        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.
        Specified by:
        upFocusCycle in class KeyboardFocusManager
        Parameters:
        aComponent - the Component that is the basis for the focus traversal operation
        See Also:
        Component.transferFocusUpCycle()
      • downFocusCycle
        public void downFocusCycle(Container aContainer)
        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.
        Specified by:
        downFocusCycle in class KeyboardFocusManager
        Parameters:
        aContainer - the Container that is the basis for the focus traversal operation
        See Also:
        Container.transferFocusDownCycle()

Document created the 11/06/2005, last modified the 04/03/2020
Source of the printed document:https://www.gaudry.be/en/java-api-rf-java/awt/defaultkeyboardfocusmanager.html

The infobrol is a personal site whose content is my sole responsibility. The text is available under CreativeCommons license (BY-NC-SA). More info on the terms of use and the author.

References

  1. View the html document Language of the document:fr Manuel PHP : https://docs.oracle.com

These references and links indicate documents consulted during the writing of this page, or which may provide additional information, but the authors of these sources can not be held responsible for the content of this page.
The author This site is solely responsible for the way in which the various concepts, and the freedoms that are taken with the reference works, are presented here. Remember that you must cross multiple source information to reduce the risk of errors.

Contents Haut