Window oppositeDecorWnd = ((opposite != null) ? opposite.getFrameDialogOwner() : null);
boolean focusedWindowChanged = ((wnd != null) && (focus ? focusedWnd != wnd
: opposite != wnd));
boolean activeWindowChanged = ((decorWnd != null) && (focus ? actualActiveWindow != decorWnd
: oppositeDecorWnd != decorWnd));
WindowEvent activationEvent = (activeWindowChanged ? new WindowEvent(decorWnd,
activationEventId, oppositeDecorWnd) : null);
if (activeWindowChanged && focus) {
decorWnd.postEvent(activationEvent);
actualActiveWindow = decorWnd;
}
if (focusedWindowChanged) {
wnd.postEvent(new WindowEvent(wnd, focusEventId, opposite));
actualFocusedWindow = (focus ? wnd : null);
}
if (activeWindowChanged && !focus) {
decorWnd.postEvent(activationEvent);
actualActiveWindow = null;