|
|||||||||
| Home >> All >> java >> [ awt overview ] | PREV CLASS NEXT CLASS | ||||||||
SUMMARY: JAVADOC | SOURCE | DOWNLOAD | NESTED | FIELD | CONSTR | METHOD |
DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.awt
Class DefaultKeyboardFocusManager

java.lang.Objectjava.awt.KeyboardFocusManager
java.awt.DefaultKeyboardFocusManager
- All Implemented Interfaces:
- KeyEventDispatcher, KeyEventPostProcessor
- public class DefaultKeyboardFocusManager
- extends KeyboardFocusManager
| Nested Class Summary | |
private class |
DefaultKeyboardFocusManager.EventDelayRequest
This class models a request to delay the dispatch of events that arrive after a certain time, until a certain component becomes the focus owner. |
| Field Summary | |
private java.util.SortedSet |
delayRequests
The java.util.SortedSet of current DefaultKeyboardFocusManager.EventDelayRequests. |
private AWTKeyStroke |
waitForKeyStroke
This flag indicates for which focus traversal key release event we possibly wait, before letting any more KEY_TYPED events through. |
| 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)
Removes the key event block specified by the supplied timestamp and component. |
protected void |
discardKeyEvents(Component comp)
Discards all key event blocks relating to focus requirements for the supplied component, regardless of timestamp. |
boolean |
dispatchEvent(AWTEvent e)
The AWT event dispatcher uses this method to request that the manager handle a particular event. |
boolean |
dispatchKeyEvent(java.awt.event.KeyEvent e)
Attempts to dispatch key events for which no key event dispatcher has so far succeeded. |
void |
downFocusCycle(Container cont)
Moves the current focus downwards by one focus cycle. |
private boolean |
enqueueKeyEvent(java.awt.event.KeyEvent e)
|
protected void |
enqueueKeyEvents(long after,
Component untilFocused)
Delays all key events following the specified timestamp until the supplied component has focus. |
void |
focusNextComponent(Component comp)
Moves the current focus to the next component following comp, based on the current focus traversal policy. |
void |
focusPreviousComponent(Component comp)
Moves the current focus to the previous component, prior to comp, based on the current focus traversal policy. |
boolean |
postProcessKeyEvent(java.awt.event.KeyEvent e)
Handles the post processing of key events. |
void |
processKeyEvent(Component comp,
java.awt.event.KeyEvent e)
Handles focus traversal operations for key events which represent focus traversal keys in relation to the supplied component. |
void |
upFocusCycle(Component comp)
Moves the current focus upwards by one focus cycle. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
waitForKeyStroke
private AWTKeyStroke waitForKeyStroke
- This flag indicates for which focus traversal key release event we
possibly wait, before letting any more KEY_TYPED events through.
delayRequests
private java.util.SortedSet delayRequests
- The java.util.SortedSet of current
DefaultKeyboardFocusManager.EventDelayRequests.
| Constructor Detail |
DefaultKeyboardFocusManager
public DefaultKeyboardFocusManager()
| Method Detail |
dispatchEvent
public boolean dispatchEvent(AWTEvent e)
- Description copied from class:
KeyboardFocusManager - The AWT event dispatcher uses this method to request that the manager
handle a particular event. If the manager fails or refuses to
dispatch the supplied event (this method returns false), the
AWT event dispatcher will try to dispatch the event itself.
The manager is expected to handle allFocusEvents andKeyEvents, andWindowEvents relating to the focus. Dispatch is done with regard to the the focus owner and the currently focused and active windows. In handling the event, the source of the event may be overridden.
The actual dispatching is performed by callingredispatchEvent(). This avoids the infinite recursion of dispatch requests which may occur if this method is called on the target component.- Specified by:
dispatchEventin classKeyboardFocusManager
enqueueKeyEvent
private boolean enqueueKeyEvent(java.awt.event.KeyEvent e)
dispatchKeyEvent
public boolean dispatchKeyEvent(java.awt.event.KeyEvent e)
- Description copied from class:
KeyboardFocusManager - Attempts to dispatch key events for which no key event dispatcher
has so far succeeded. This method is usually called by
dispatchEvent()following the sending of the key event to any registered key event dispatchers. If the key event reaches this stage, none of the dispatchers returned true. This is, of course, always the case if there are no registered dispatchers.
If this method also fails to handle the key event, then false is returned to the caller. In the case ofdispatchEvent(), the calling method may try to handle the event itself or simply forward on the false result to its caller. When the event is dispatched by this method, a true result is propogated through the calling methods.- Specified by:
dispatchKeyEventin interfaceKeyEventDispatcher- Specified by:
dispatchKeyEventin classKeyboardFocusManager
postProcessKeyEvent
public boolean postProcessKeyEvent(java.awt.event.KeyEvent e)
- Description copied from class:
KeyboardFocusManager - Handles the post processing of key events. By default,
this method will map unhandled key events to appropriate
MenuShortcuts. The event is consumed in the process and the shortcut is activated. This method is usually called bydispatchKeyEvent.- Specified by:
postProcessKeyEventin interfaceKeyEventPostProcessor- Specified by:
postProcessKeyEventin classKeyboardFocusManager
processKeyEvent
public void processKeyEvent(Component comp, java.awt.event.KeyEvent e)
- Description copied from class:
KeyboardFocusManager - Handles focus traversal operations for key events which
represent focus traversal keys in relation to the supplied
component. The supplied component is assumed to have the
focus, whether it does so or not, and the operation is
carried out as appropriate, with this in mind.
- Specified by:
processKeyEventin classKeyboardFocusManager
enqueueKeyEvents
protected void enqueueKeyEvents(long after,
Component untilFocused)
- Description copied from class:
KeyboardFocusManager - Delays all key events following the specified timestamp until the
supplied component has focus. The AWT calls this method when it is
determined that a focus change may occur within the native windowing
system. Any key events which occur following the time specified by
after are delayed until a
FOCUS_GAINEDevent is received for the untilFocused component. The manager is responsible for ensuring this takes place.- Specified by:
enqueueKeyEventsin classKeyboardFocusManager
dequeueKeyEvents
protected void dequeueKeyEvents(long after,
Component untilFocused)
- Description copied from class:
KeyboardFocusManager - Removes the key event block specified by the supplied timestamp and component.
All delayed key events are released for normal dispatching following its
removal and subsequent key events that would have been blocked are now
immediately dispatched. If the specified timestamp is below 0, then
the request with the oldest timestamp is removed.
- Specified by:
dequeueKeyEventsin classKeyboardFocusManager
discardKeyEvents
protected void discardKeyEvents(Component comp)
- Description copied from class:
KeyboardFocusManager - Discards all key event blocks relating to focus requirements for
the supplied component, regardless of timestamp.
- Specified by:
discardKeyEventsin classKeyboardFocusManager
focusPreviousComponent
public void focusPreviousComponent(Component comp)
- Description copied from class:
KeyboardFocusManager - Moves the current focus to the previous component, prior to
comp, based on the current focus traversal policy. By
default, only visible, displayable, accepted components
can receive focus.
Canvases,Panels,Labels,ScrollPanes,Scrollbars,Windows and lightweight components are judged to be unacceptable by default. See theDefaultFocusTraversalPolicyfor more details.- Specified by:
focusPreviousComponentin classKeyboardFocusManager
focusNextComponent
public void focusNextComponent(Component comp)
- Description copied from class:
KeyboardFocusManager - Moves the current focus to the next component following
comp, based on the current focus traversal policy. By
default, only visible, displayable, accepted components
can receive focus.
Canvases,Panels,Labels,ScrollPanes,Scrollbars,Windows and lightweight components are judged to be unacceptable by default. See theDefaultFocusTraversalPolicyfor more details.- Specified by:
focusNextComponentin classKeyboardFocusManager
upFocusCycle
public void upFocusCycle(Component comp)
- Description copied from class:
KeyboardFocusManager - Moves the current focus upwards by one focus cycle.
Both the current focus owner and current focus cycle root
become the focus cycle root of the supplied component.
However, in the case of a
Window, the default focus component becomes the focus owner and the focus cycle root is not changed.- Specified by:
upFocusCyclein classKeyboardFocusManager
downFocusCycle
public void downFocusCycle(Container cont)
- Description copied from class:
KeyboardFocusManager - Moves the current focus downwards by one focus cycle.
If the supplied container is a focus cycle root, then this
becomes the current focus cycle root and the focus goes
to the default component of the specified container.
Nothing happens for non-focus cycle root containers.
- Specified by:
downFocusCyclein classKeyboardFocusManager
|
|||||||||
| Home >> All >> java >> [ awt overview ] | PREV CLASS NEXT CLASS | ||||||||
SUMMARY: JAVADOC | SOURCE | DOWNLOAD | NESTED | FIELD | CONSTR | METHOD |
DETAIL: FIELD | CONSTR | METHOD | ||||||||
JAVADOC