--- old/src/java.desktop/share/classes/java/awt/KeyboardFocusManager.java 2015-09-11 00:11:01.784093000 +0300 +++ new/src/java.desktop/share/classes/java/awt/KeyboardFocusManager.java 2015-09-11 00:11:01.276991600 +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); @@ -2174,9 +2173,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; @@ -2200,7 +2199,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"); @@ -2212,7 +2211,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"); @@ -2324,7 +2323,7 @@ hwFocusRequest = new HeavyweightFocusRequest(heavyweight, descendant, - temporary, CausedFocusEvent.Cause.UNKNOWN); + temporary, FocusEvent.Cause.UNKNOWN); heavyweightRequests.add(hwFocusRequest); if (currentFocusOwner != null) { @@ -2389,7 +2388,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) { @@ -2455,7 +2454,7 @@ if (currentFocusOwner != null) { FocusEvent currentFocusOwnerEvent = - new CausedFocusEvent(currentFocusOwner, + new FocusEvent(currentFocusOwner, FocusEvent.FOCUS_LOST, temporary, descendant, cause); // Fix 5028014. Rolled out. @@ -2464,7 +2463,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); @@ -2680,13 +2679,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, @@ -2736,8 +2735,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); } } @@ -2812,7 +2811,7 @@ // 'opposite' will be fixed by // DefaultKeyboardFocusManager.realOppositeComponent - return new CausedFocusEvent(newSource, + return new FocusEvent(newSource, FocusEvent.FOCUS_GAINED, temporary, opposite, lwFocusRequest.cause); } @@ -2825,8 +2824,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); @@ -2849,9 +2848,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 @@ -2860,9 +2859,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; } @@ -2888,15 +2887,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; }