< prev index next >
src/java.desktop/share/classes/java/awt/KeyboardFocusManager.java
Print this page
*** 371,390 ****
private PropertyChangeSupport changeSupport;
/**
* This KeyboardFocusManager's KeyEventDispatcher chain. The List does not
* include this KeyboardFocusManager unless it was explicitly re-registered
! * via a call to <code>addKeyEventDispatcher</code>. If no other
* KeyEventDispatchers are registered, this field may be null or refer to
* a List of length 0.
*/
private java.util.LinkedList<KeyEventDispatcher> keyEventDispatchers;
/**
* This KeyboardFocusManager's KeyEventPostProcessor chain. The List does
* not include this KeyboardFocusManager unless it was explicitly
! * re-registered via a call to <code>addKeyEventPostProcessor</code>.
* If no other KeyEventPostProcessors are registered, this field may be
* null or refer to a List of length 0.
*/
private java.util.LinkedList<KeyEventPostProcessor> keyEventPostProcessors;
--- 371,390 ----
private PropertyChangeSupport changeSupport;
/**
* This KeyboardFocusManager's KeyEventDispatcher chain. The List does not
* include this KeyboardFocusManager unless it was explicitly re-registered
! * via a call to {@code addKeyEventDispatcher}. If no other
* KeyEventDispatchers are registered, this field may be null or refer to
* a List of length 0.
*/
private java.util.LinkedList<KeyEventDispatcher> keyEventDispatchers;
/**
* This KeyboardFocusManager's KeyEventPostProcessor chain. The List does
* not include this KeyboardFocusManager unless it was explicitly
! * re-registered via a call to {@code addKeyEventPostProcessor}.
* If no other KeyEventPostProcessors are registered, this field may be
* null or refer to a List of length 0.
*/
private java.util.LinkedList<KeyEventPostProcessor> keyEventPostProcessors;
*** 512,523 ****
* owner. In addition, KeyEventDispatchers may retarget or consume
* KeyEvents before they reach the focus owner.
* <p>
* This method does not actually set the focus to the specified Component.
* It merely stores the value to be subsequently returned by
! * <code>getFocusOwner()</code>. Use <code>Component.requestFocus()</code>
! * or <code>Component.requestFocusInWindow()</code> to change the focus
* owner, subject to platform limitations.
*
* @param focusOwner the focus owner
* @see #getFocusOwner
* @see #getGlobalFocusOwner
--- 512,523 ----
* owner. In addition, KeyEventDispatchers may retarget or consume
* KeyEvents before they reach the focus owner.
* <p>
* This method does not actually set the focus to the specified Component.
* It merely stores the value to be subsequently returned by
! * {@code getFocusOwner()}. Use {@code Component.requestFocus()}
! * or {@code Component.requestFocusInWindow()} to change the focus
* owner, subject to platform limitations.
*
* @param focusOwner the focus owner
* @see #getFocusOwner
* @see #getGlobalFocusOwner
*** 603,613 ****
* Clears the global focus owner at both the Java and native levels. If
* there exists a focus owner, that Component will receive a permanent
* FOCUS_LOST event. After this operation completes, the native windowing
* system will discard all user-generated KeyEvents until the user selects
* a new Component to receive focus, or a Component is given focus
! * explicitly via a call to <code>requestFocus()</code>. This operation
* does not change the focused or active Windows.
* <p>
* If a SecurityManager is installed, the calling thread must be granted
* the "replaceKeyboardFocusManager" AWTPermission. If this permission is
* not granted, this method will throw a SecurityException, and the current
--- 603,613 ----
* Clears the global focus owner at both the Java and native levels. If
* there exists a focus owner, that Component will receive a permanent
* FOCUS_LOST event. After this operation completes, the native windowing
* system will discard all user-generated KeyEvents until the user selects
* a new Component to receive focus, or a Component is given focus
! * explicitly via a call to {@code requestFocus()}. This operation
* does not change the focused or active Windows.
* <p>
* If a SecurityManager is installed, the calling thread must be granted
* the "replaceKeyboardFocusManager" AWTPermission. If this permission is
* not granted, this method will throw a SecurityException, and the current
*** 727,739 ****
* the permanent focus owner will again be the focus owner when the
* temporary focus change ends.
* <p>
* This method does not actually set the focus to the specified Component.
* It merely stores the value to be subsequently returned by
! * <code>getPermanentFocusOwner()</code>. Use
! * <code>Component.requestFocus()</code> or
! * <code>Component.requestFocusInWindow()</code> to change the focus owner,
* subject to platform limitations.
*
* @param permanentFocusOwner the permanent focus owner
* @see #getPermanentFocusOwner
* @see #getGlobalPermanentFocusOwner
--- 727,739 ----
* the permanent focus owner will again be the focus owner when the
* temporary focus change ends.
* <p>
* This method does not actually set the focus to the specified Component.
* It merely stores the value to be subsequently returned by
! * {@code getPermanentFocusOwner()}. Use
! * {@code Component.requestFocus()} or
! * {@code Component.requestFocusInWindow()} to change the focus owner,
* subject to platform limitations.
*
* @param permanentFocusOwner the permanent focus owner
* @see #getPermanentFocusOwner
* @see #getGlobalPermanentFocusOwner
*** 830,842 ****
* contains the focus owner. The operation will be cancelled if the
* specified Window to focus is not a focusable Window.
* <p>
* This method does not actually change the focused Window as far as the
* native windowing system is concerned. It merely stores the value to be
! * subsequently returned by <code>getFocusedWindow()</code>. Use
! * <code>Component.requestFocus()</code> or
! * <code>Component.requestFocusInWindow()</code> to change the focused
* Window, subject to platform limitations.
*
* @param focusedWindow the focused Window
* @see #getFocusedWindow
* @see #getGlobalFocusedWindow
--- 830,842 ----
* contains the focus owner. The operation will be cancelled if the
* specified Window to focus is not a focusable Window.
* <p>
* This method does not actually change the focused Window as far as the
* native windowing system is concerned. It merely stores the value to be
! * subsequently returned by {@code getFocusedWindow()}. Use
! * {@code Component.requestFocus()} or
! * {@code Component.requestFocusInWindow()} to change the focused
* Window, subject to platform limitations.
*
* @param focusedWindow the focused Window
* @see #getFocusedWindow
* @see #getGlobalFocusedWindow
*** 936,948 ****
* active Window is always either the focused Window, or the first Frame or
* Dialog that is an owner of the focused Window.
* <p>
* This method does not actually change the active Window as far as the
* native windowing system is concerned. It merely stores the value to be
! * subsequently returned by <code>getActiveWindow()</code>. Use
! * <code>Component.requestFocus()</code> or
! * <code>Component.requestFocusInWindow()</code>to change the active
* Window, subject to platform limitations.
*
* @param activeWindow the active Window
* @see #getActiveWindow
* @see #getGlobalActiveWindow
--- 936,948 ----
* active Window is always either the focused Window, or the first Frame or
* Dialog that is an owner of the focused Window.
* <p>
* This method does not actually change the active Window as far as the
* native windowing system is concerned. It merely stores the value to be
! * subsequently returned by {@code getActiveWindow()}. Use
! * {@code Component.requestFocus()} or
! * {@code Component.requestFocusInWindow()} to change the active
* Window, subject to platform limitations.
*
* @param activeWindow the active Window
* @see #getActiveWindow
* @see #getGlobalActiveWindow
*** 1166,1185 ****
* Returns a Set of default focus traversal keys for a given traversal
* operation. This traversal key Set will be in effect on all Windows that
* have no such Set of their own explicitly defined. This Set will also be
* inherited, recursively, by any child Component of those Windows that has
* no such Set of its own explicitly defined. (See
! * <code>setDefaultFocusTraversalKeys</code> for a full description of each
* operation.)
*
* @param id one of KeyboardFocusManager.FORWARD_TRAVERSAL_KEYS,
* KeyboardFocusManager.BACKWARD_TRAVERSAL_KEYS,
* KeyboardFocusManager.UP_CYCLE_TRAVERSAL_KEYS, or
* KeyboardFocusManager.DOWN_CYCLE_TRAVERSAL_KEYS
! * @return the <code>Set</code> of <code>AWTKeyStroke</code>s
! * for the specified operation; the <code>Set</code>
! * will be unmodifiable, and may be empty; <code>null</code>
* will never be returned
* @see #setDefaultFocusTraversalKeys
* @see Component#setFocusTraversalKeys
* @see Component#getFocusTraversalKeys
* @throws IllegalArgumentException if id is not one of
--- 1166,1185 ----
* Returns a Set of default focus traversal keys for a given traversal
* operation. This traversal key Set will be in effect on all Windows that
* have no such Set of their own explicitly defined. This Set will also be
* inherited, recursively, by any child Component of those Windows that has
* no such Set of its own explicitly defined. (See
! * {@code setDefaultFocusTraversalKeys} for a full description of each
* operation.)
*
* @param id one of KeyboardFocusManager.FORWARD_TRAVERSAL_KEYS,
* KeyboardFocusManager.BACKWARD_TRAVERSAL_KEYS,
* KeyboardFocusManager.UP_CYCLE_TRAVERSAL_KEYS, or
* KeyboardFocusManager.DOWN_CYCLE_TRAVERSAL_KEYS
! * @return the {@code Set} of {@code AWTKeyStroke}s
! * for the specified operation; the {@code Set}
! * will be unmodifiable, and may be empty; {@code null}
* will never be returned
* @see #setDefaultFocusTraversalKeys
* @see Component#setFocusTraversalKeys
* @see Component#getFocusTraversalKeys
* @throws IllegalArgumentException if id is not one of
*** 1367,1377 ****
/**
* Returns an array of all the property change listeners
* registered on this keyboard focus manager.
*
* @return all of this keyboard focus manager's
! * <code>PropertyChangeListener</code>s
* or an empty array if no property change
* listeners are currently registered
*
* @see #addPropertyChangeListener
* @see #removePropertyChangeListener
--- 1367,1377 ----
/**
* Returns an array of all the property change listeners
* registered on this keyboard focus manager.
*
* @return all of this keyboard focus manager's
! * {@code PropertyChangeListener}s
* or an empty array if no property change
* listeners are currently registered
*
* @see #addPropertyChangeListener
* @see #removePropertyChangeListener
*** 1454,1468 ****
}
}
}
/**
! * Returns an array of all the <code>PropertyChangeListener</code>s
* associated with the named property.
*
* @param propertyName the property name
! * @return all of the <code>PropertyChangeListener</code>s associated with
* the named property or an empty array if no such listeners have
* been added.
*
* @see #addPropertyChangeListener(java.lang.String,java.beans.PropertyChangeListener)
* @see #removePropertyChangeListener(java.lang.String,java.beans.PropertyChangeListener)
--- 1454,1468 ----
}
}
}
/**
! * Returns an array of all the {@code PropertyChangeListener}s
* associated with the named property.
*
* @param propertyName the property name
! * @return all of the {@code PropertyChangeListener}s associated with
* the named property or an empty array if no such listeners have
* been added.
*
* @see #addPropertyChangeListener(java.lang.String,java.beans.PropertyChangeListener)
* @see #removePropertyChangeListener(java.lang.String,java.beans.PropertyChangeListener)
*** 1550,1560 ****
/**
* Returns an array of all the vetoable change listeners
* registered on this keyboard focus manager.
*
* @return all of this keyboard focus manager's
! * <code>VetoableChangeListener</code>s
* or an empty array if no vetoable change
* listeners are currently registered
*
* @see #addVetoableChangeListener
* @see #removeVetoableChangeListener
--- 1550,1560 ----
/**
* Returns an array of all the vetoable change listeners
* registered on this keyboard focus manager.
*
* @return all of this keyboard focus manager's
! * {@code VetoableChangeListener}s
* or an empty array if no vetoable change
* listeners are currently registered
*
* @see #addVetoableChangeListener
* @see #removeVetoableChangeListener
*** 1624,1638 ****
}
}
}
/**
! * Returns an array of all the <code>VetoableChangeListener</code>s
* associated with the named property.
*
* @param propertyName the property name
! * @return all of the <code>VetoableChangeListener</code>s associated with
* the named property or an empty array if no such listeners have
* been added.
*
* @see #addVetoableChangeListener(java.lang.String,java.beans.VetoableChangeListener)
* @see #removeVetoableChangeListener(java.lang.String,java.beans.VetoableChangeListener)
--- 1624,1638 ----
}
}
}
/**
! * Returns an array of all the {@code VetoableChangeListener}s
* associated with the named property.
*
* @param propertyName the property name
! * @return all of the {@code VetoableChangeListener}s associated with
* the named property or an empty array if no such listeners have
* been added.
*
* @see #addVetoableChangeListener(java.lang.String,java.beans.VetoableChangeListener)
* @see #removeVetoableChangeListener(java.lang.String,java.beans.VetoableChangeListener)
*** 1657,1668 ****
*
* @param propertyName the name of the property that has changed
* @param oldValue the property's previous value
* @param newValue the property's new value
* @throws java.beans.PropertyVetoException if a
! * <code>VetoableChangeListener</code> threw
! * <code>PropertyVetoException</code>
*/
protected void fireVetoableChange(String propertyName, Object oldValue,
Object newValue)
throws PropertyVetoException
{
--- 1657,1668 ----
*
* @param propertyName the name of the property that has changed
* @param oldValue the property's previous value
* @param newValue the property's new value
* @throws java.beans.PropertyVetoException if a
! * {@code VetoableChangeListener} threw
! * {@code PropertyVetoException}
*/
protected void fireVetoableChange(String propertyName, Object oldValue,
Object newValue)
throws PropertyVetoException
{
*** 1681,1692 ****
* Adds a KeyEventDispatcher to this KeyboardFocusManager's dispatcher
* chain. This KeyboardFocusManager will request that each
* KeyEventDispatcher dispatch KeyEvents generated by the user before
* finally dispatching the KeyEvent itself. KeyEventDispatchers will be
* notified in the order in which they were added. Notifications will halt
! * as soon as one KeyEventDispatcher returns <code>true</code> from its
! * <code>dispatchKeyEvent</code> method. There is no limit to the total
* number of KeyEventDispatchers which can be added, nor to the number of
* times which a particular KeyEventDispatcher instance can be added.
* <p>
* If a null dispatcher is specified, no action is taken and no exception
* is thrown.
--- 1681,1692 ----
* Adds a KeyEventDispatcher to this KeyboardFocusManager's dispatcher
* chain. This KeyboardFocusManager will request that each
* KeyEventDispatcher dispatch KeyEvents generated by the user before
* finally dispatching the KeyEvent itself. KeyEventDispatchers will be
* notified in the order in which they were added. Notifications will halt
! * as soon as one KeyEventDispatcher returns {@code true} from its
! * {@code dispatchKeyEvent} method. There is no limit to the total
* number of KeyEventDispatchers which can be added, nor to the number of
* times which a particular KeyEventDispatcher instance can be added.
* <p>
* If a null dispatcher is specified, no action is taken and no exception
* is thrown.
*** 1712,1722 ****
/**
* Removes a KeyEventDispatcher which was previously added to this
* KeyboardFocusManager's dispatcher chain. This KeyboardFocusManager
* cannot itself be removed, unless it was explicitly re-registered via a
! * call to <code>addKeyEventDispatcher</code>.
* <p>
* If a null dispatcher is specified, if the specified dispatcher is not
* in the dispatcher chain, or if this KeyboardFocusManager is specified
* without having been explicitly re-registered, no action is taken and no
* exception is thrown.
--- 1712,1722 ----
/**
* Removes a KeyEventDispatcher which was previously added to this
* KeyboardFocusManager's dispatcher chain. This KeyboardFocusManager
* cannot itself be removed, unless it was explicitly re-registered via a
! * call to {@code addKeyEventDispatcher}.
* <p>
* If a null dispatcher is specified, if the specified dispatcher is not
* in the dispatcher chain, or if this KeyboardFocusManager is specified
* without having been explicitly re-registered, no action is taken and no
* exception is thrown.
*** 1742,1752 ****
/**
* Returns this KeyboardFocusManager's KeyEventDispatcher chain as a List.
* The List will not include this KeyboardFocusManager unless it was
* explicitly re-registered via a call to
! * <code>addKeyEventDispatcher</code>. If no other KeyEventDispatchers are
* registered, implementations are free to return null or a List of length
* 0. Client code should not assume one behavior over another, nor should
* it assume that the behavior, once established, will not change.
*
* @return a possibly null or empty List of KeyEventDispatchers
--- 1742,1752 ----
/**
* Returns this KeyboardFocusManager's KeyEventDispatcher chain as a List.
* The List will not include this KeyboardFocusManager unless it was
* explicitly re-registered via a call to
! * {@code addKeyEventDispatcher}. If no other KeyEventDispatchers are
* registered, implementations are free to return null or a List of length
* 0. Client code should not assume one behavior over another, nor should
* it assume that the behavior, once established, will not change.
*
* @return a possibly null or empty List of KeyEventDispatchers
*** 1768,1779 ****
* its target, KeyboardFocusManager will request that each
* KeyEventPostProcessor perform any necessary post-processing as part
* of the KeyEvent's final resolution. KeyEventPostProcessors
* will be notified in the order in which they were added; the current
* KeyboardFocusManager will be notified last. Notifications will halt
! * as soon as one KeyEventPostProcessor returns <code>true</code> from its
! * <code>postProcessKeyEvent</code> method. There is no limit to the
* total number of KeyEventPostProcessors that can be added, nor to the
* number of times that a particular KeyEventPostProcessor instance can be
* added.
* <p>
* If a null post-processor is specified, no action is taken and no
--- 1768,1779 ----
* its target, KeyboardFocusManager will request that each
* KeyEventPostProcessor perform any necessary post-processing as part
* of the KeyEvent's final resolution. KeyEventPostProcessors
* will be notified in the order in which they were added; the current
* KeyboardFocusManager will be notified last. Notifications will halt
! * as soon as one KeyEventPostProcessor returns {@code true} from its
! * {@code postProcessKeyEvent} method. There is no limit to the
* total number of KeyEventPostProcessors that can be added, nor to the
* number of times that a particular KeyEventPostProcessor instance can be
* added.
* <p>
* If a null post-processor is specified, no action is taken and no
*** 1802,1812 ****
/**
* Removes a previously added KeyEventPostProcessor from this
* KeyboardFocusManager's post-processor chain. This KeyboardFocusManager
* cannot itself be entirely removed from the chain. Only additional
! * references added via <code>addKeyEventPostProcessor</code> can be
* removed.
* <p>
* If a null post-processor is specified, if the specified post-processor
* is not in the post-processor chain, or if this KeyboardFocusManager is
* specified without having been explicitly added, no action is taken and
--- 1802,1812 ----
/**
* Removes a previously added KeyEventPostProcessor from this
* KeyboardFocusManager's post-processor chain. This KeyboardFocusManager
* cannot itself be entirely removed from the chain. Only additional
! * references added via {@code addKeyEventPostProcessor} can be
* removed.
* <p>
* If a null post-processor is specified, if the specified post-processor
* is not in the post-processor chain, or if this KeyboardFocusManager is
* specified without having been explicitly added, no action is taken and
*** 1833,1843 ****
/**
* Returns this KeyboardFocusManager's KeyEventPostProcessor chain as a
* List. The List will not include this KeyboardFocusManager unless it was
! * explicitly added via a call to <code>addKeyEventPostProcessor</code>. If
* no KeyEventPostProcessors are registered, implementations are free to
* return null or a List of length 0. Client code should not assume one
* behavior over another, nor should it assume that the behavior, once
* established, will not change.
*
--- 1833,1843 ----
/**
* Returns this KeyboardFocusManager's KeyEventPostProcessor chain as a
* List. The List will not include this KeyboardFocusManager unless it was
! * explicitly added via a call to {@code addKeyEventPostProcessor}. If
* no KeyEventPostProcessors are registered, implementations are free to
* return null or a List of length 0. Client code should not assume one
* behavior over another, nor should it assume that the behavior, once
* established, will not change.
*
*** 1922,1951 ****
* It is expected that all KeyboardFocusManagers will dispatch all
* FocusEvents, all WindowEvents related to focus, and all KeyEvents.
* These events should be 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. Dispatching must be
! * done using <code>redispatchEvent</code> to prevent the AWT event
* dispatcher from recursively requesting that the KeyboardFocusManager
! * dispatch the event again. If this method returns <code>false</code>,
* then the AWT event dispatcher will attempt to dispatch the event itself.
*
* @param e the AWTEvent to be dispatched
! * @return <code>true</code> if this method dispatched the event;
! * <code>false</code> otherwise
* @see #redispatchEvent
* @see #dispatchKeyEvent
*/
public abstract boolean dispatchEvent(AWTEvent e);
/**
* Redispatches an AWTEvent in such a way that the AWT event dispatcher
* will not recursively request that the KeyboardFocusManager, or any
* installed KeyEventDispatchers, dispatch the event again. Client
! * implementations of <code>dispatchEvent</code> and client-defined
! * KeyEventDispatchers must call <code>redispatchEvent(target, e)</code>
! * instead of <code>target.dispatchEvent(e)</code> to dispatch an event.
* <p>
* This method is intended to be used only by KeyboardFocusManagers and
* KeyEventDispatchers. It is not for general client use.
*
* @param target the Component to which the event should be dispatched
--- 1922,1951 ----
* It is expected that all KeyboardFocusManagers will dispatch all
* FocusEvents, all WindowEvents related to focus, and all KeyEvents.
* These events should be 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. Dispatching must be
! * done using {@code redispatchEvent} to prevent the AWT event
* dispatcher from recursively requesting that the KeyboardFocusManager
! * dispatch the event again. If this method returns {@code false},
* then the AWT event dispatcher will attempt to dispatch the event itself.
*
* @param e the AWTEvent to be dispatched
! * @return {@code true} if this method dispatched the event;
! * {@code false} otherwise
* @see #redispatchEvent
* @see #dispatchKeyEvent
*/
public abstract boolean dispatchEvent(AWTEvent e);
/**
* Redispatches an AWTEvent in such a way that the AWT event dispatcher
* will not recursively request that the KeyboardFocusManager, or any
* installed KeyEventDispatchers, dispatch the event again. Client
! * implementations of {@code dispatchEvent} and client-defined
! * KeyEventDispatchers must call {@code redispatchEvent(target, e)}
! * instead of {@code target.dispatchEvent(e)} to dispatch an event.
* <p>
* This method is intended to be used only by KeyboardFocusManagers and
* KeyEventDispatchers. It is not for general client use.
*
* @param target the Component to which the event should be dispatched
*** 1958,1991 ****
target.dispatchEvent(e);
e.focusManagerIsDispatching = false;
}
/**
! * Typically this method will be called by <code>dispatchEvent</code> if no
* other KeyEventDispatcher in the dispatcher chain dispatched the
* KeyEvent, or if no other KeyEventDispatchers are registered. If an
! * implementation of this method returns <code>false</code>,
! * <code>dispatchEvent</code> may try to dispatch the KeyEvent itself, or
! * may simply return <code>false</code>. If <code>true</code> is returned,
! * <code>dispatchEvent</code> should return <code>true</code> as well.
*
* @param e the KeyEvent which the current KeyboardFocusManager has
* requested that this KeyEventDispatcher dispatch
! * @return <code>true</code> if the KeyEvent was dispatched;
! * <code>false</code> otherwise
* @see #dispatchEvent
*/
public abstract boolean dispatchKeyEvent(KeyEvent e);
/**
! * This method will be called by <code>dispatchKeyEvent</code>.
* By default, this method will handle any unconsumed KeyEvents that
! * map to an AWT <code>MenuShortcut</code> by consuming the event
* and activating the shortcut.
*
* @param e the KeyEvent to post-process
! * @return <code>true</code> to indicate that no other
* KeyEventPostProcessor will be notified of the KeyEvent.
* @see #dispatchKeyEvent
* @see MenuShortcut
*/
public abstract boolean postProcessKeyEvent(KeyEvent e);
--- 1958,1991 ----
target.dispatchEvent(e);
e.focusManagerIsDispatching = false;
}
/**
! * Typically this method will be called by {@code dispatchEvent} if no
* other KeyEventDispatcher in the dispatcher chain dispatched the
* KeyEvent, or if no other KeyEventDispatchers are registered. If an
! * implementation of this method returns {@code false},
! * {@code dispatchEvent} may try to dispatch the KeyEvent itself, or
! * may simply return {@code false}. If {@code true} is returned,
! * {@code dispatchEvent} should return {@code true} as well.
*
* @param e the KeyEvent which the current KeyboardFocusManager has
* requested that this KeyEventDispatcher dispatch
! * @return {@code true} if the KeyEvent was dispatched;
! * {@code false} otherwise
* @see #dispatchEvent
*/
public abstract boolean dispatchKeyEvent(KeyEvent e);
/**
! * This method will be called by {@code dispatchKeyEvent}.
* By default, this method will handle any unconsumed KeyEvents that
! * map to an AWT {@code MenuShortcut} by consuming the event
* and activating the shortcut.
*
* @param e the KeyEvent to post-process
! * @return {@code true} to indicate that no other
* KeyEventPostProcessor will be notified of the KeyEvent.
* @see #dispatchKeyEvent
* @see MenuShortcut
*/
public abstract boolean postProcessKeyEvent(KeyEvent e);
*** 2013,2024 ****
* determines that this request might be granted by the native windowing
* system, then the AWT will call this method. It is the responsibility of
* the KeyboardFocusManager to delay dispatching of KeyEvents with
* timestamps later than the specified time stamp until the specified
* Component receives a FOCUS_GAINED event, or the AWT cancels the delay
! * request by invoking <code>dequeueKeyEvents</code> or
! * <code>discardKeyEvents</code>.
*
* @param 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
* @param untilFocused Component which should receive a FOCUS_GAINED event
--- 2013,2024 ----
* determines that this request might be granted by the native windowing
* system, then the AWT will call this method. It is the responsibility of
* the KeyboardFocusManager to delay dispatching of KeyEvents with
* timestamps later than the specified time stamp until the specified
* Component receives a FOCUS_GAINED event, or the AWT cancels the delay
! * request by invoking {@code dequeueKeyEvents} or
! * {@code discardKeyEvents}.
*
* @param 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
* @param untilFocused Component which should receive a FOCUS_GAINED event
*** 2030,2063 ****
Component untilFocused);
/**
* Called by the AWT to notify the KeyboardFocusManager that it should
* cancel delayed dispatching of KeyEvents. All KeyEvents which were
! * enqueued because of a call to <code>enqueueKeyEvents</code> with the
* same timestamp and Component should be released for normal dispatching
* to the current focus owner. If the given timestamp is less than zero,
* the outstanding enqueue request for the given Component with the <b>
* oldest</b> timestamp (if any) should be cancelled.
*
* @param after the timestamp specified in the call to
! * <code>enqueueKeyEvents</code>, or any value < 0
* @param untilFocused the Component specified in the call to
! * <code>enqueueKeyEvents</code>
* @see #enqueueKeyEvents
* @see #discardKeyEvents
*/
protected abstract void dequeueKeyEvents(long after,
Component untilFocused);
/**
* Called by the AWT to notify the KeyboardFocusManager that it should
* cancel delayed dispatching of KeyEvents. All KeyEvents which were
! * enqueued because of one or more calls to <code>enqueueKeyEvents</code>
* with the same Component should be discarded.
*
* @param comp the Component specified in one or more calls to
! * <code>enqueueKeyEvents</code>
* @see #enqueueKeyEvents
* @see #dequeueKeyEvents
*/
protected abstract void discardKeyEvents(Component comp);
--- 2030,2063 ----
Component untilFocused);
/**
* Called by the AWT to notify the KeyboardFocusManager that it should
* cancel delayed dispatching of KeyEvents. All KeyEvents which were
! * enqueued because of a call to {@code enqueueKeyEvents} with the
* same timestamp and Component should be released for normal dispatching
* to the current focus owner. If the given timestamp is less than zero,
* the outstanding enqueue request for the given Component with the <b>
* oldest</b> timestamp (if any) should be cancelled.
*
* @param after the timestamp specified in the call to
! * {@code enqueueKeyEvents}, or any value < 0
* @param untilFocused the Component specified in the call to
! * {@code enqueueKeyEvents}
* @see #enqueueKeyEvents
* @see #discardKeyEvents
*/
protected abstract void dequeueKeyEvents(long after,
Component untilFocused);
/**
* Called by the AWT to notify the KeyboardFocusManager that it should
* cancel delayed dispatching of KeyEvents. All KeyEvents which were
! * enqueued because of one or more calls to {@code enqueueKeyEvents}
* with the same Component should be discarded.
*
* @param comp the Component specified in one or more calls to
! * {@code enqueueKeyEvents}
* @see #enqueueKeyEvents
* @see #dequeueKeyEvents
*/
protected abstract void discardKeyEvents(Component comp);
< prev index next >