8235620: Broken merge between JDK-8006406 and JDK-8003559

Reviewed-by: prr
This commit is contained in:
Sergey Bylokhov 2019-12-09 20:26:19 -08:00
parent 03dfd4f94b
commit da5fa894ac
3 changed files with 15 additions and 10 deletions

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2013, 2016, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2013, 2019, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -34,9 +34,10 @@ import java.awt.MenuBar;
import java.awt.Point;
import java.awt.Rectangle;
import java.awt.Window;
import java.awt.event.FocusEvent;
import sun.awt.CGraphicsDevice;
import sun.awt.CGraphicsEnvironment;
import java.awt.event.FocusEvent;
import sun.awt.LightweightFrame;
import sun.java2d.SurfaceData;
import sun.lwawt.LWLightweightFramePeer;
@ -47,7 +48,12 @@ public class CPlatformLWWindow extends CPlatformWindow {
@Override
public void initialize(Window target, LWWindowPeer peer, PlatformWindow owner) {
initializeBase(target, peer, owner, new CPlatformLWView());
initializeBase(target, peer, owner);
}
@Override
CPlatformView createContentView() {
return new CPlatformLWView();
}
@Override

View File

@ -309,12 +309,11 @@ public class CPlatformWindow extends CFRetainedResource implements PlatformWindo
*/
@Override // PlatformWindow
public void initialize(Window _target, LWWindowPeer _peer, PlatformWindow _owner) {
initializeBase(_target, _peer, _owner, new CPlatformView());
initializeBase(_target, _peer, _owner);
final int styleBits = getInitialStyleBits();
responder = createPlatformResponder();
contentView = createContentView();
contentView.initialize(peer, responder);
Rectangle bounds;
@ -359,20 +358,20 @@ public class CPlatformWindow extends CFRetainedResource implements PlatformWindo
validateSurface();
}
protected void initializeBase(Window target, LWWindowPeer peer, PlatformWindow owner, CPlatformView view) {
void initializeBase(Window target, LWWindowPeer peer, PlatformWindow owner) {
this.peer = peer;
this.target = target;
if (owner instanceof CPlatformWindow) {
this.owner = (CPlatformWindow)owner;
}
this.contentView = view;
contentView = createContentView();
}
protected CPlatformResponder createPlatformResponder() {
return new CPlatformResponder(peer, false);
}
protected CPlatformView createContentView() {
CPlatformView createContentView() {
return new CPlatformView();
}

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2013, 2016, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2013, 2019, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -273,7 +273,7 @@ public final class CWarningWindow extends CPlatformWindow
return new CPlatformResponder(this, false);
}
protected CPlatformView createContentView() {
CPlatformView createContentView() {
return new CPlatformView() {
public GraphicsConfiguration getGraphicsConfiguration() {
LWWindowPeer peer = ownerPeer.get();