src/share/classes/java/awt/DefaultKeyboardFocusManager.java

Print this page

        

@@ -308,11 +308,11 @@
      * @param e the AWTEvent to be dispatched
      * @return <code>true</code> if this method dispatched the event;
      *         <code>false</code> otherwise
      */
     public boolean dispatchEvent(AWTEvent e) {
-        if (focusLog.isLoggable(PlatformLogger.FINE) && (e instanceof WindowEvent || e instanceof FocusEvent)) {
+        if (focusLog.isLoggable(PlatformLogger.Level.FINE) && (e instanceof WindowEvent || e instanceof FocusEvent)) {
             focusLog.fine("" + e);
         }
         switch (e.getID()) {
             case WindowEvent.WINDOW_GAINED_FOCUS: {
                 if (repostIfFollowsKeyEvents((WindowEvent)e)) {

@@ -417,11 +417,11 @@
                         tempLost = newFocusedWindow.setTemporaryLostComponent(null);
                     }
 
                     // The component which last has the focus when this window was focused
                     // should receive focus first
-                    if (focusLog.isLoggable(PlatformLogger.FINER)) {
+                    if (focusLog.isLoggable(PlatformLogger.Level.FINER)) {
                         focusLog.finer("tempLost {0}, toFocus {1}",
                                        tempLost, toFocus);
                     }
                     if (tempLost != null) {
                         tempLost.requestFocusInWindow(CausedFocusEvent.Cause.ACTIVATION);

@@ -486,11 +486,11 @@
                 CausedFocusEvent.Cause cause = (fe instanceof CausedFocusEvent) ?
                     ((CausedFocusEvent)fe).getCause() : CausedFocusEvent.Cause.UNKNOWN;
                 Component oldFocusOwner = getGlobalFocusOwner();
                 Component newFocusOwner = fe.getComponent();
                 if (oldFocusOwner == newFocusOwner) {
-                    if (focusLog.isLoggable(PlatformLogger.FINE)) {
+                    if (focusLog.isLoggable(PlatformLogger.Level.FINE)) {
                         focusLog.fine("Skipping {0} because focus owner is the same", e);
                     }
                     // We can't just drop the event - there could be
                     // type-ahead markers associated with it.
                     dequeueKeyEvents(-1, newFocusOwner);

@@ -604,19 +604,19 @@
 
             case FocusEvent.FOCUS_LOST: {
                 FocusEvent fe = (FocusEvent)e;
                 Component currentFocusOwner = getGlobalFocusOwner();
                 if (currentFocusOwner == null) {
-                    if (focusLog.isLoggable(PlatformLogger.FINE))
+                    if (focusLog.isLoggable(PlatformLogger.Level.FINE))
                         focusLog.fine("Skipping {0} because focus owner is null", e);
                     break;
                 }
                 // Ignore cases where a Component loses focus to itself.
                 // If we make a mistake because of retargeting, then the
                 // FOCUS_GAINED handler will correct it.
                 if (currentFocusOwner == fe.getOppositeComponent()) {
-                    if (focusLog.isLoggable(PlatformLogger.FINE))
+                    if (focusLog.isLoggable(PlatformLogger.Level.FINE))
                         focusLog.fine("Skipping {0} because current focus owner is equal to opposite", e);
                     break;
                 }
 
                 setGlobalFocusOwner(null);

@@ -685,11 +685,11 @@
                 WindowEvent we = (WindowEvent)e;
                 Window currentFocusedWindow = getGlobalFocusedWindow();
                 Window losingFocusWindow = we.getWindow();
                 Window activeWindow = getGlobalActiveWindow();
                 Window oppositeWindow = we.getOppositeWindow();
-                if (focusLog.isLoggable(PlatformLogger.FINE))
+                if (focusLog.isLoggable(PlatformLogger.Level.FINE))
                     focusLog.fine("Active {0}, Current focused {1}, losing focus {2} opposite {3}",
                                   activeWindow, currentFocusedWindow,
                                   losingFocusWindow, oppositeWindow);
                 if (currentFocusedWindow == null) {
                     break;

@@ -871,11 +871,11 @@
                         if (ke.getWhen() > marker.after) {
                             ke = null;
                         }
                     }
                     if (ke != null) {
-                        if (focusLog.isLoggable(PlatformLogger.FINER)) {
+                        if (focusLog.isLoggable(PlatformLogger.Level.FINER)) {
                             focusLog.finer("Pumping approved event {0}", ke);
                         }
                         enqueuedKeyEvents.removeFirst();
                     }
                 }

@@ -888,11 +888,11 @@
 
     /**
      * Dumps the list of type-ahead queue markers to stderr
      */
     void dumpMarkers() {
-        if (focusLog.isLoggable(PlatformLogger.FINEST)) {
+        if (focusLog.isLoggable(PlatformLogger.Level.FINEST)) {
             focusLog.finest(">>> Markers dump, time: {0}", System.currentTimeMillis());
             synchronized (this) {
                 if (typeAheadMarkers.size() != 0) {
                     Iterator<TypeAheadMarker> iter = typeAheadMarkers.iterator();
                     while (iter.hasNext()) {

@@ -922,11 +922,11 @@
                         // Fixed 5064013: may appears that the events have the same time
                         // if (ke.getWhen() >= marker.after) {
                         // The fix is rolled out.
 
                         if (ke.getWhen() > marker.after) {
-                            if (focusLog.isLoggable(PlatformLogger.FINER)) {
+                            if (focusLog.isLoggable(PlatformLogger.Level.FINER)) {
                                 focusLog.finer("Storing event {0} because of marker {1}", ke, marker);
                             }
                             enqueuedKeyEvents.addLast(ke);
                             return true;
                         }

@@ -936,11 +936,11 @@
                 // KeyEvent was posted before focus change request
                 return preDispatchKeyEvent(ke);
             }
 
             case FocusEvent.FOCUS_GAINED:
-                if (focusLog.isLoggable(PlatformLogger.FINEST)) {
+                if (focusLog.isLoggable(PlatformLogger.Level.FINEST)) {
                     focusLog.finest("Markers before FOCUS_GAINED on {0}", target);
                 }
                 dumpMarkers();
                 // Search the marker list for the first marker tied to
                 // the Component which just gained focus. Then remove

@@ -965,11 +965,11 @@
                             }
                             iter.remove();
                         }
                     } else {
                         // Exception condition - event without marker
-                        if (focusLog.isLoggable(PlatformLogger.FINER)) {
+                        if (focusLog.isLoggable(PlatformLogger.Level.FINER)) {
                             focusLog.finer("Event without marker {0}", e);
                         }
                     }
                 }
                 focusLog.finest("Markers after FOCUS_GAINED");

@@ -1206,11 +1206,11 @@
                                                  Component untilFocused) {
         if (untilFocused == null) {
             return;
         }
 
-        if (focusLog.isLoggable(PlatformLogger.FINER)) {
+        if (focusLog.isLoggable(PlatformLogger.Level.FINER)) {
             focusLog.finer("Enqueue at {0} for {1}",
                        after, untilFocused);
         }
 
         int insertionIndex = 0,

@@ -1248,11 +1248,11 @@
                                                  Component untilFocused) {
         if (untilFocused == null) {
             return;
         }
 
-        if (focusLog.isLoggable(PlatformLogger.FINER)) {
+        if (focusLog.isLoggable(PlatformLogger.Level.FINER)) {
             focusLog.finer("Dequeue at {0} for {1}",
                        after, untilFocused);
         }
 
         TypeAheadMarker marker;