src/share/classes/java/awt/KeyboardFocusManager.java
Print this page
*** 346,355 ****
--- 346,356 ----
* in effect on all Windows that have no such array of their own explicitly
* set. Each array will also be inherited, recursively, by any child
* Component of those Windows that has no such array of its own explicitly
* set.
*/
+ @SuppressWarnings({"unchecked", "rawtypes"})
private Set<AWTKeyStroke>[] defaultFocusTraversalKeys = new Set[4];
/**
* The current focus cycle root. If the focus owner is itself a focus cycle
* root, then it may be ambiguous as to which Components represent the next
*** 420,430 ****
StringTokenizer tokens = new StringTokenizer(value, ",");
while (tokens.hasMoreTokens()) {
targetSet.add(AWTKeyStroke.getAWTKeyStroke(tokens.nextToken()));
}
return (targetSet.isEmpty())
! ? Collections.EMPTY_SET
: Collections.unmodifiableSet(targetSet);
}
/**
* Initializes a KeyboardFocusManager.
--- 421,431 ----
StringTokenizer tokens = new StringTokenizer(value, ",");
while (tokens.hasMoreTokens()) {
targetSet.add(AWTKeyStroke.getAWTKeyStroke(tokens.nextToken()));
}
return (targetSet.isEmpty())
! ? Collections.emptySet()
: Collections.unmodifiableSet(targetSet);
}
/**
* Initializes a KeyboardFocusManager.
*** 434,444 ****
Set<AWTKeyStroke> work_set = new HashSet<>();
for (int j = 0; j < defaultFocusTraversalKeyStrokes[i].length; j++) {
work_set.add(defaultFocusTraversalKeyStrokes[i][j]);
}
defaultFocusTraversalKeys[i] = (work_set.isEmpty())
! ? Collections.EMPTY_SET
: Collections.unmodifiableSet(work_set);
}
initPeer();
}
--- 435,445 ----
Set<AWTKeyStroke> work_set = new HashSet<>();
for (int j = 0; j < defaultFocusTraversalKeyStrokes[i].length; j++) {
work_set.add(defaultFocusTraversalKeyStrokes[i][j]);
}
defaultFocusTraversalKeys[i] = (work_set.isEmpty())
! ? Collections.emptySet()
: Collections.unmodifiableSet(work_set);
}
initPeer();
}
*** 1748,1762 ****
*
* @return a possibly null or empty List of KeyEventDispatchers
* @see #addKeyEventDispatcher
* @see #removeKeyEventDispatcher
*/
protected synchronized java.util.List<KeyEventDispatcher>
getKeyEventDispatchers()
{
return (keyEventDispatchers != null)
! ? (java.util.List)keyEventDispatchers.clone()
: null;
}
/**
* Adds a KeyEventPostProcessor to this KeyboardFocusManager's post-
--- 1749,1764 ----
*
* @return a possibly null or empty List of KeyEventDispatchers
* @see #addKeyEventDispatcher
* @see #removeKeyEventDispatcher
*/
+ @SuppressWarnings("unchecked") // Cast of result of clone
protected synchronized java.util.List<KeyEventDispatcher>
getKeyEventDispatchers()
{
return (keyEventDispatchers != null)
! ? (java.util.List<KeyEventDispatcher>)keyEventDispatchers.clone()
: null;
}
/**
* Adds a KeyEventPostProcessor to this KeyboardFocusManager's post-
*** 1839,1853 ****
*
* @return a possibly null or empty List of KeyEventPostProcessors
* @see #addKeyEventPostProcessor
* @see #removeKeyEventPostProcessor
*/
protected java.util.List<KeyEventPostProcessor>
getKeyEventPostProcessors()
{
return (keyEventPostProcessors != null)
! ? (java.util.List)keyEventPostProcessors.clone()
: null;
}
--- 1841,1856 ----
*
* @return a possibly null or empty List of KeyEventPostProcessors
* @see #addKeyEventPostProcessor
* @see #removeKeyEventPostProcessor
*/
+ @SuppressWarnings("unchecked") // Cast of result of clone
protected java.util.List<KeyEventPostProcessor>
getKeyEventPostProcessors()
{
return (keyEventPostProcessors != null)
! ? (java.util.List<KeyEventPostProcessor>)keyEventPostProcessors.clone()
: null;
}
*** 1905,1916 ****
/*
* Please be careful changing this method! It is called from
* javax.swing.JComponent.runInputVerifier() using reflection.
*/
static synchronized Component getMostRecentFocusOwner(Window window) {
! WeakReference<Component> weakValue =
! (WeakReference)mostRecentFocusOwners.get(window);
return weakValue == null ? null : weakValue.get();
}
/**
* This method is called by the AWT event dispatcher requesting that the
--- 1908,1918 ----
/*
* Please be careful changing this method! It is called from
* javax.swing.JComponent.runInputVerifier() using reflection.
*/
static synchronized Component getMostRecentFocusOwner(Window window) {
! WeakReference<Component> weakValue = mostRecentFocusOwners.get(window);
return weakValue == null ? null : weakValue.get();
}
/**
* This method is called by the AWT event dispatcher requesting that the