--- old/src/java.desktop/share/classes/java/awt/KeyboardFocusManager.java 2015-10-27 12:48:32.595342200 +0300 +++ new/src/java.desktop/share/classes/java/awt/KeyboardFocusManager.java 2015-10-27 12:48:32.185301200 +0300 @@ -57,7 +57,6 @@ import sun.awt.AppContext; import sun.awt.SunToolkit; -import sun.awt.CausedFocusEvent; import sun.awt.KeyboardFocusManagerPeerProvider; import sun.awt.AWTAccessor; @@ -124,7 +123,7 @@ boolean temporary, boolean focusedWindowChangeAllowed, long time, - CausedFocusEvent.Cause cause) + FocusEvent.Cause cause) { return KeyboardFocusManager.shouldNativelyFocusHeavyweight( heavyweight, descendant, temporary, focusedWindowChangeAllowed, time, cause); @@ -2160,9 +2159,9 @@ private static final class LightweightFocusRequest { final Component component; final boolean temporary; - final CausedFocusEvent.Cause cause; + final FocusEvent.Cause cause; - LightweightFocusRequest(Component component, boolean temporary, CausedFocusEvent.Cause cause) { + LightweightFocusRequest(Component component, boolean temporary, FocusEvent.Cause cause) { this.component = component; this.temporary = temporary; this.cause = cause; @@ -2186,7 +2185,7 @@ } HeavyweightFocusRequest(Component heavyweight, Component descendant, - boolean temporary, CausedFocusEvent.Cause cause) { + boolean temporary, FocusEvent.Cause cause) { if (log.isLoggable(PlatformLogger.Level.FINE)) { if (heavyweight == null) { log.fine("Assertion (heavyweight != null) failed"); @@ -2198,7 +2197,7 @@ addLightweightRequest(descendant, temporary, cause); } boolean addLightweightRequest(Component descendant, - boolean temporary, CausedFocusEvent.Cause cause) { + boolean temporary, FocusEvent.Cause cause) { if (log.isLoggable(PlatformLogger.Level.FINE)) { if (this == HeavyweightFocusRequest.CLEAR_GLOBAL_FOCUS_OWNER) { log.fine("Assertion (this != HeavyweightFocusRequest.CLEAR_GLOBAL_FOCUS_OWNER) failed"); @@ -2310,7 +2309,7 @@ hwFocusRequest = new HeavyweightFocusRequest(heavyweight, descendant, - temporary, CausedFocusEvent.Cause.UNKNOWN); + temporary, FocusEvent.Cause.UNKNOWN); heavyweightRequests.add(hwFocusRequest); if (currentFocusOwner != null) { @@ -2375,7 +2374,7 @@ */ static int shouldNativelyFocusHeavyweight (Component heavyweight, Component descendant, boolean temporary, - boolean focusedWindowChangeAllowed, long time, CausedFocusEvent.Cause cause) + boolean focusedWindowChangeAllowed, long time, FocusEvent.Cause cause) { if (log.isLoggable(PlatformLogger.Level.FINE)) { if (heavyweight == null) { @@ -2441,7 +2440,7 @@ if (currentFocusOwner != null) { FocusEvent currentFocusOwnerEvent = - new CausedFocusEvent(currentFocusOwner, + new FocusEvent(currentFocusOwner, FocusEvent.FOCUS_LOST, temporary, descendant, cause); // Fix 5028014. Rolled out. @@ -2450,7 +2449,7 @@ currentFocusOwnerEvent); } FocusEvent newFocusOwnerEvent = - new CausedFocusEvent(descendant, FocusEvent.FOCUS_GAINED, + new FocusEvent(descendant, FocusEvent.FOCUS_GAINED, temporary, currentFocusOwner, cause); // Fix 5028014. Rolled out. // SunToolkit.postPriorityEvent(newFocusOwnerEvent); @@ -2666,13 +2665,13 @@ * lw requests. */ if (currentFocusOwner != null) { - currentFocusOwnerEvent = new CausedFocusEvent(currentFocusOwner, + currentFocusOwnerEvent = new FocusEvent(currentFocusOwner, FocusEvent.FOCUS_LOST, lwFocusRequest.temporary, lwFocusRequest.component, lwFocusRequest.cause); } FocusEvent newFocusOwnerEvent = - new CausedFocusEvent(lwFocusRequest.component, + new FocusEvent(lwFocusRequest.component, FocusEvent.FOCUS_GAINED, lwFocusRequest.temporary, currentFocusOwner == null ? lastFocusOwner : currentFocusOwner, @@ -2722,8 +2721,8 @@ { temporary = true; } - return new CausedFocusEvent(source, fe.getID(), temporary, opposite, - CausedFocusEvent.Cause.NATIVE_SYSTEM); + return new FocusEvent(source, fe.getID(), temporary, opposite, + FocusEvent.Cause.UNEXPECTED); } } @@ -2798,7 +2797,7 @@ // 'opposite' will be fixed by // DefaultKeyboardFocusManager.realOppositeComponent - return new CausedFocusEvent(newSource, + return new FocusEvent(newSource, FocusEvent.FOCUS_GAINED, temporary, opposite, lwFocusRequest.cause); } @@ -2811,8 +2810,8 @@ // If it arrives as the result of activation we should skip it // This event will not have appropriate request record and // on arrival there will be already some focus owner set. - return new CausedFocusEvent(currentFocusOwner, FocusEvent.FOCUS_GAINED, false, - null, CausedFocusEvent.Cause.ACTIVATION); + return new FocusEvent(currentFocusOwner, FocusEvent.FOCUS_GAINED, false, + null, FocusEvent.Cause.ACTIVATION); } return retargetUnexpectedFocusEvent(fe); @@ -2835,9 +2834,9 @@ if (currentFocusOwner != null) { // Call to KeyboardFocusManager.clearGlobalFocusOwner() heavyweightRequests.removeFirst(); - return new CausedFocusEvent(currentFocusOwner, + return new FocusEvent(currentFocusOwner, FocusEvent.FOCUS_LOST, false, null, - CausedFocusEvent.Cause.CLEAR_GLOBAL_FOCUS_OWNER); + FocusEvent.Cause.CLEAR_GLOBAL_FOCUS_OWNER); } // Otherwise, fall through to failure case below @@ -2846,9 +2845,9 @@ { // Focus leaving application if (currentFocusOwner != null) { - return new CausedFocusEvent(currentFocusOwner, + return new FocusEvent(currentFocusOwner, FocusEvent.FOCUS_LOST, - true, null, CausedFocusEvent.Cause.ACTIVATION); + true, null, FocusEvent.Cause.ACTIVATION); } else { return fe; } @@ -2874,15 +2873,15 @@ ? true : lwFocusRequest.temporary; - return new CausedFocusEvent(currentFocusOwner, FocusEvent.FOCUS_LOST, + return new FocusEvent(currentFocusOwner, FocusEvent.FOCUS_LOST, temporary, lwFocusRequest.component, lwFocusRequest.cause); } else if (focusedWindowChanged(opposite, currentFocusOwner)) { // If top-level changed there might be no focus request in a list // But we know the opposite, we now it is temporary - dispatch the event. if (!fe.isTemporary() && currentFocusOwner != null) { // Create copy of the event with only difference in temporary parameter. - fe = new CausedFocusEvent(currentFocusOwner, FocusEvent.FOCUS_LOST, - true, opposite, CausedFocusEvent.Cause.ACTIVATION); + fe = new FocusEvent(currentFocusOwner, FocusEvent.FOCUS_LOST, + true, opposite, FocusEvent.Cause.ACTIVATION); } return fe; }