src/share/classes/java/awt/KeyboardFocusManager.java
Print this page
@@ -650,11 +650,11 @@
Component getNativeFocusOwner() {
return peer.getCurrentFocusOwner();
}
void setNativeFocusOwner(Component comp) {
- if (focusLog.isLoggable(PlatformLogger.FINEST)) {
+ if (focusLog.isLoggable(PlatformLogger.Level.FINEST)) {
focusLog.finest("Calling peer {0} setCurrentFocusOwner for {1}",
String.valueOf(peer), String.valueOf(comp));
}
peer.setCurrentFocusOwner(comp);
}
@@ -959,11 +959,11 @@
Window oldActiveWindow;
synchronized (KeyboardFocusManager.class) {
checkKFMSecurity();
oldActiveWindow = getActiveWindow();
- if (focusLog.isLoggable(PlatformLogger.FINER)) {
+ if (focusLog.isLoggable(PlatformLogger.Level.FINER)) {
focusLog.finer("Setting global active window to " + activeWindow + ", old active " + oldActiveWindow);
}
try {
fireVetoableChange("activeWindow", oldActiveWindow,
@@ -2194,11 +2194,11 @@
lightweightRequests = null;
}
HeavyweightFocusRequest(Component heavyweight, Component descendant,
boolean temporary, CausedFocusEvent.Cause cause) {
- if (log.isLoggable(PlatformLogger.FINE)) {
+ if (log.isLoggable(PlatformLogger.Level.FINE)) {
if (heavyweight == null) {
log.fine("Assertion (heavyweight != null) failed");
}
}
@@ -2206,11 +2206,11 @@
this.lightweightRequests = new LinkedList<LightweightFocusRequest>();
addLightweightRequest(descendant, temporary, cause);
}
boolean addLightweightRequest(Component descendant,
boolean temporary, CausedFocusEvent.Cause cause) {
- if (log.isLoggable(PlatformLogger.FINE)) {
+ if (log.isLoggable(PlatformLogger.Level.FINE)) {
if (this == HeavyweightFocusRequest.CLEAR_GLOBAL_FOCUS_OWNER) {
log.fine("Assertion (this != HeavyweightFocusRequest.CLEAR_GLOBAL_FOCUS_OWNER) failed");
}
if (descendant == null) {
log.fine("Assertion (descendant != null) failed");
@@ -2384,11 +2384,11 @@
*/
static int shouldNativelyFocusHeavyweight
(Component heavyweight, Component descendant, boolean temporary,
boolean focusedWindowChangeAllowed, long time, CausedFocusEvent.Cause cause)
{
- if (log.isLoggable(PlatformLogger.FINE)) {
+ if (log.isLoggable(PlatformLogger.Level.FINE)) {
if (heavyweight == null) {
log.fine("Assertion (heavyweight != null) failed");
}
if (time == 0) {
log.fine("Assertion (time != 0) failed");
@@ -2406,33 +2406,33 @@
getCurrentKeyboardFocusManager(SunToolkit.targetToAppContext(descendant));
KeyboardFocusManager thisManager = getCurrentKeyboardFocusManager();
Component currentFocusOwner = thisManager.getGlobalFocusOwner();
Component nativeFocusOwner = thisManager.getNativeFocusOwner();
Window nativeFocusedWindow = thisManager.getNativeFocusedWindow();
- if (focusLog.isLoggable(PlatformLogger.FINER)) {
+ if (focusLog.isLoggable(PlatformLogger.Level.FINER)) {
focusLog.finer("SNFH for {0} in {1}",
String.valueOf(descendant), String.valueOf(heavyweight));
}
- if (focusLog.isLoggable(PlatformLogger.FINEST)) {
+ if (focusLog.isLoggable(PlatformLogger.Level.FINEST)) {
focusLog.finest("0. Current focus owner {0}",
String.valueOf(currentFocusOwner));
focusLog.finest("0. Native focus owner {0}",
String.valueOf(nativeFocusOwner));
focusLog.finest("0. Native focused window {0}",
String.valueOf(nativeFocusedWindow));
}
synchronized (heavyweightRequests) {
HeavyweightFocusRequest hwFocusRequest = getLastHWRequest();
- if (focusLog.isLoggable(PlatformLogger.FINEST)) {
+ if (focusLog.isLoggable(PlatformLogger.Level.FINEST)) {
focusLog.finest("Request {0}", String.valueOf(hwFocusRequest));
}
if (hwFocusRequest == null &&
heavyweight == nativeFocusOwner)
{
if (descendant == currentFocusOwner) {
// Redundant request.
- if (focusLog.isLoggable(PlatformLogger.FINEST))
+ if (focusLog.isLoggable(PlatformLogger.Level.FINEST))
focusLog.finest("1. SNFH_FAILURE for {0}",
String.valueOf(descendant));
return SNFH_FAILURE;
}
@@ -2462,11 +2462,11 @@
temporary, currentFocusOwner, cause);
// Fix 5028014. Rolled out.
// SunToolkit.postPriorityEvent(newFocusOwnerEvent);
SunToolkit.postEvent(descendant.appContext, newFocusOwnerEvent);
- if (focusLog.isLoggable(PlatformLogger.FINEST))
+ if (focusLog.isLoggable(PlatformLogger.Level.FINEST))
focusLog.finest("2. SNFH_HANDLED for {0}", String.valueOf(descendant));
return SNFH_SUCCESS_HANDLED;
} else if (hwFocusRequest != null &&
hwFocusRequest.heavyweight == heavyweight) {
// 'heavyweight' doesn't have the native focus right now, but
@@ -2476,11 +2476,11 @@
if (hwFocusRequest.addLightweightRequest(descendant,
temporary, cause)) {
manager.enqueueKeyEvents(time, descendant);
}
- if (focusLog.isLoggable(PlatformLogger.FINEST)) {
+ if (focusLog.isLoggable(PlatformLogger.Level.FINEST)) {
focusLog.finest("3. SNFH_HANDLED for lightweight" +
descendant + " in " + heavyweight);
}
return SNFH_SUCCESS_HANDLED;
} else {
@@ -2500,11 +2500,11 @@
}
if (focusedWindowChanged(heavyweight,
(hwFocusRequest != null)
? hwFocusRequest.heavyweight
: nativeFocusedWindow)) {
- if (focusLog.isLoggable(PlatformLogger.FINEST)) {
+ if (focusLog.isLoggable(PlatformLogger.Level.FINEST)) {
focusLog.finest("4. SNFH_FAILURE for " + descendant);
}
return SNFH_FAILURE;
}
}
@@ -2511,11 +2511,11 @@
manager.enqueueKeyEvents(time, descendant);
heavyweightRequests.add
(new HeavyweightFocusRequest(heavyweight, descendant,
temporary, cause));
- if (focusLog.isLoggable(PlatformLogger.FINEST)) {
+ if (focusLog.isLoggable(PlatformLogger.Level.FINEST)) {
focusLog.finest("5. SNFH_PROCEED for " + descendant);
}
return SNFH_SUCCESS_PROCEED;
}
}
@@ -2903,15 +2903,15 @@
if (clearingCurrentLightweightRequests) {
return event;
}
KeyboardFocusManager manager = getCurrentKeyboardFocusManager();
- if (focusLog.isLoggable(PlatformLogger.FINER)) {
+ if (focusLog.isLoggable(PlatformLogger.Level.FINER)) {
if (event instanceof FocusEvent || event instanceof WindowEvent) {
focusLog.finer(">>> {0}", String.valueOf(event));
}
- if (focusLog.isLoggable(PlatformLogger.FINER) && event instanceof KeyEvent) {
+ if (focusLog.isLoggable(PlatformLogger.Level.FINER) && event instanceof KeyEvent) {
focusLog.finer(" focus owner is {0}",
String.valueOf(manager.getGlobalFocusOwner()));
focusLog.finer(">>> {0}", String.valueOf(event));
}
}
@@ -2994,11 +2994,11 @@
}
return (heavyweightRequests.size() > 0);
}
}
static void removeLastFocusRequest(Component heavyweight) {
- if (log.isLoggable(PlatformLogger.FINE)) {
+ if (log.isLoggable(PlatformLogger.Level.FINE)) {
if (heavyweight == null) {
log.fine("Assertion (heavyweight != null) failed");
}
}