Please see How to Use the Focus Subsystem, a section in The Java Tutorial, and the Focus Specification for more information.
FocusTraversalPolicy, Component#setFocusTraversalKeys, Component#getFocusTraversalKeys
| Modifier and Type | Class and Description |
|---|---|
| private static class | DefaultKeyboardFocusManager.
A special type of SentEvent which updates a counter in the target KeyboardFocusManager if it is an instance of DefaultKeyboardFocusManager. |
| private static class |
| Modifier and Type | Field and Description |
|---|---|
| private boolean | |
| private LinkedList | |
| private static final PlatformLogger | |
| private static boolean | |
| private int | |
| private static final WeakReference | |
| private static final WeakReference | |
| private WeakReference | |
| private WeakReference | |
| private Component | |
| private LinkedList |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| pack-priv void | |
| private void | |
| private boolean | |
| private void | |
| protected synchronized void | dequeueKeyEvents(long
the timestamp specified in the call to
after, Component enqueueKeyEvents, or any value < 0the Component specified in the call to
untilFocused)enqueueKeyEventsImplements abstract java. Releases for normal dispatching to the current focus owner all
KeyEvents which were enqueued because of a call to
|
| protected synchronized void | discardKeyEvents(Component
the Component specified in one or more calls to
comp)enqueueKeyEvents, or a parent of such a ComponentImplements abstract java. Discards all KeyEvents which were enqueued because of one or more calls
to |
| public boolean | Returns: true if this method dispatched the event;
false otherwisethe AWTEvent to be dispatched e)Implements abstract java. This method is called by the AWT event dispatcher requesting that the current KeyboardFocusManager dispatch the specified event on its behalf. |
| public boolean | Returns: truethe KeyEvent to be dispatched e)Implements abstract java. Implements java. Called by |
| private boolean | |
| public void | downFocusCycle(Container
the Container that is the basis for the focus
traversal operation aContainer)Implements abstract java. Moves the focus down one focus traversal cycle. |
| pack-priv void | |
| protected synchronized void | enqueueKeyEvents(long
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 after, Component Component which will receive a FOCUS_GAINED event
before any pending KeyEvents untilFocused)Implements abstract java. Delays dispatching of KeyEvents until the specified Component becomes the focus owner. |
| public void | focusNextComponent(Component
the Component that is the basis for the focus
traversal operation aComponent)Implements abstract java. Focuses the Component after aComponent, typically based on a FocusTraversalPolicy. |
| public void | focusPreviousComponent(Component
the Component that is the basis for the focus
traversal operation aComponent)Implements abstract java. Focuses the Component before aComponent, typically based on a FocusTraversalPolicy. |
| private Window | |
| private boolean | |
| private static void | |
| public boolean | Returns: truethe KeyEvent to post-process e)Implements abstract java. Implements java. This method will be called by |
| private boolean | |
| public void | processKeyEvent(Component
the Component that is the basis for a focus
traversal operation if the specified event represents a focus
traversal key for the Component focusedComponent, KeyEvent the event that may represent a focus traversal key e)Implements abstract java. This method initiates a focus traversal operation if and only if the KeyEvent represents a focus traversal key for the specified focusedComponent. |
| private void | |
| private void | |
| private boolean | |
| private void | |
| private void | |
| private boolean | |
| private boolean | |
| pack-priv static boolean | |
| private boolean | |
| public void | upFocusCycle(Component
the Component that is the basis for the focus
traversal operation aComponent)Implements abstract java. Moves the focus up one focus traversal cycle. |
| consumeNextKeyTyped | back to summary |
|---|---|
| private boolean consumeNextKeyTyped | |
| enqueuedKeyEvents | back to summary |
|---|---|
| private LinkedList<KeyEvent> enqueuedKeyEvents | |
| focusLog | back to summary |
|---|---|
| private static final PlatformLogger focusLog | |
| fxAppThreadIsDispatchThread | back to summary |
|---|---|
| private static boolean fxAppThreadIsDispatchThread | |
| inSendMessage | back to summary |
|---|---|
| private int inSendMessage | |
| NULL_COMPONENT_WR | back to summary |
|---|---|
| private static final WeakReference<Component> NULL_COMPONENT_WR | |
| NULL_WINDOW_WR | back to summary |
|---|---|
| private static final WeakReference<Window> NULL_WINDOW_WR | |
| realOppositeComponentWR | back to summary |
|---|---|
| private WeakReference<Component> realOppositeComponentWR | |
| realOppositeWindowWR | back to summary |
|---|---|
| private WeakReference<Window> realOppositeWindowWR | |
| restoreFocusTo | back to summary |
|---|---|
| private Component restoreFocusTo | |
| typeAheadMarkers | back to summary |
|---|---|
| private LinkedList<DefaultKeyboardFocusManager. | |
| DefaultKeyboardFocusManager | back to summary |
|---|---|
| public DefaultKeyboardFocusManager() Constructs a | |
| clearMarkers | back to summary |
|---|---|
| pack-priv void clearMarkers() Overrides java. Clears markers queue
| |
| consumeNextKeyTyped | back to summary |
|---|---|
| private void consumeNextKeyTyped(KeyEvent e) | |
| consumeProcessedKeyEvent | back to summary |
|---|---|
| private boolean consumeProcessedKeyEvent(KeyEvent e) | |
| consumeTraversalKey | back to summary |
|---|---|
| private void consumeTraversalKey(KeyEvent e) | |
| dequeueKeyEvents | back to summary |
|---|---|
| protected synchronized void dequeueKeyEvents(long after, Component untilFocused) Implements abstract java. Releases for normal dispatching to the current focus owner all
KeyEvents which were enqueued because of a call to
| |
| discardKeyEvents | back to summary |
|---|---|
| protected synchronized void discardKeyEvents(Component comp) Implements abstract java. Discards all KeyEvents which were enqueued because of one or more calls
to
| |
| dispatchEvent | back to summary |
|---|---|
| public boolean dispatchEvent(AWTEvent e) Implements abstract java. 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
| |
| dispatchKeyEvent | back to summary |
|---|---|
| public boolean dispatchKeyEvent(KeyEvent e) Implements abstract java. Implements java. Called by
In all cases, this method returns
| |
| doRestoreFocus | back to summary |
|---|---|
| private boolean doRestoreFocus(Component toFocus, Component vetoedComponent, boolean clearOnFailure) | |
| downFocusCycle | back to summary |
|---|---|
| public void downFocusCycle(Container aContainer) Implements abstract java. 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.
| |
| dumpMarkers | back to summary |
|---|---|
| pack-priv void dumpMarkers() Dumps the list of type-ahead queue markers to stderr | |
| enqueueKeyEvents | back to summary |
|---|---|
| protected synchronized void enqueueKeyEvents(long after, Component untilFocused) Implements abstract java. 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
| |
| focusNextComponent | back to summary |
|---|---|
| public void focusNextComponent(Component aComponent) Implements abstract java. Focuses the Component after aComponent, typically based on a FocusTraversalPolicy.
| |
| focusPreviousComponent | back to summary |
|---|---|
| public void focusPreviousComponent(Component aComponent) Implements abstract java. Focuses the Component before aComponent, typically based on a FocusTraversalPolicy.
| |
| getOwningFrameDialog | back to summary |
|---|---|
| private Window getOwningFrameDialog(Window window) | |
| hasMarker | back to summary |
|---|---|
| private boolean hasMarker(Component comp) Returns true if there are some marker associated with component
| |
| initStatic | back to summary |
|---|---|
| private static void initStatic() | |
| postProcessKeyEvent | back to summary |
|---|---|
| public boolean postProcessKeyEvent(KeyEvent e) Implements abstract java. Implements java. This method will be called by
| |
| preDispatchKeyEvent | back to summary |
|---|---|
| private boolean preDispatchKeyEvent(KeyEvent ke) | |
| processKeyEvent | back to summary |
|---|---|
| public void processKeyEvent(Component focusedComponent, KeyEvent e) Implements abstract java. 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. | |
| pumpApprovedKeyEvents | back to summary |
|---|---|
| private void pumpApprovedKeyEvents() | |
| purgeStampedEvents | back to summary |
|---|---|
| private void purgeStampedEvents(long start, long end) | |
| repostIfFollowsKeyEvents | back to summary |
|---|---|
| private boolean repostIfFollowsKeyEvents(WindowEvent e) | |
| restoreFocus | back to summary |
|---|---|
| private void restoreFocus(FocusEvent fe, Window newFocusedWindow) | |
| restoreFocus | back to summary |
|---|---|
| private void restoreFocus(WindowEvent we) | |
| restoreFocus | back to summary |
|---|---|
| private boolean restoreFocus(Window aWindow, Component vetoedComponent, boolean clearOnFailure) | |
| restoreFocus | back to summary |
|---|---|
| private boolean restoreFocus(Component toFocus, boolean clearOnFailure) | |
| sendMessage | back to summary |
|---|---|
| pack-priv static boolean sendMessage(Component target, AWTEvent e) Sends a synthetic AWTEvent to a Component. | |
| typeAheadAssertions | back to summary |
|---|---|
| private boolean typeAheadAssertions(Component target, AWTEvent e) | |
| upFocusCycle | back to summary |
|---|---|
| public void upFocusCycle(Component aComponent) Implements abstract java. 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.
| |
| Modifier and Type | Field and Description |
|---|---|
| private static final long | serialVersionUID
Use serialVersionUID from JDK 1.6 for interoperability.
|
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public final void | dispatch()
Overrides java. Implements java. Dispatch the event to its target, listeners of the events source, or do whatever it is this event is supposed to do. |
| serialVersionUID | back to summary |
|---|---|
| private static final long serialVersionUID Hides java. Use serialVersionUID from JDK 1.6 for interoperability. | |
| DefaultKeyboardFocusManagerSentEvent | back to summary |
|---|---|
| public DefaultKeyboardFocusManagerSentEvent(AWTEvent nested) | |
| dispatch | back to summary |
|---|---|
| public final void dispatch() Overrides java. Implements java. Doc from java. Dispatch the event to its target, listeners of the events source, or do whatever it is this event is supposed to do. | |
| Modifier and Type | Field and Description |
|---|---|
| pack-priv long | |
| pack-priv Component |
| Access | Constructor and Description |
|---|---|
| pack-priv |
| Modifier and Type | Method and Description |
|---|---|
| public String |
| after | back to summary |
|---|---|
| pack-priv long after | |
| untilFocused | back to summary |
|---|---|
| pack-priv Component untilFocused | |
| TypeAheadMarker | back to summary |
|---|---|
| pack-priv TypeAheadMarker(long after, Component untilFocused) | |
| toString | back to summary |
|---|---|
| public String toString() Overrides java. Returns string representation of the marker | |