src/java.desktop/share/classes/sun/swing/JLightweightFrame.java
Print this page
*** 1,7 ****
/*
! * Copyright (c) 2013, 2014, 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
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
--- 1,7 ----
/*
! * Copyright (c) 2013, 2015, 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
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
*** 59,68 ****
--- 59,69 ----
import javax.swing.LayoutFocusTraversalPolicy;
import javax.swing.RepaintManager;
import javax.swing.RootPaneContainer;
import javax.swing.SwingUtilities;
+ import sun.awt.AWTAccessor;
import sun.awt.DisplayChangedListener;
import sun.awt.LightweightFrame;
import sun.security.action.GetPropertyAction;
import sun.swing.SwingUtilities2.RepaintListener;
*** 239,249 ****
public int getScaleFactor() {
return scaleFactor;
}
@Override
- @SuppressWarnings("deprecation")
public void notifyDisplayChanged(final int scaleFactor) {
if (scaleFactor != this.scaleFactor) {
if (!copyBufferEnabled) content.paintLock();
try {
if (bbImage != null) {
--- 240,249 ----
*** 252,273 ****
} finally {
if (!copyBufferEnabled) content.paintUnlock();
}
this.scaleFactor = scaleFactor;
}
! if (getPeer() instanceof DisplayChangedListener) {
! ((DisplayChangedListener)getPeer()).displayChanged();
}
repaint();
}
@Override
- @SuppressWarnings("deprecation")
public void addNotify() {
super.addNotify();
! if (getPeer() instanceof DisplayChangedListener) {
! ((DisplayChangedListener)getPeer()).displayChanged();
}
}
private void syncCopyBuffer(boolean reset, int x, int y, int w, int h, int scale) {
content.paintLock();
--- 252,274 ----
} finally {
if (!copyBufferEnabled) content.paintUnlock();
}
this.scaleFactor = scaleFactor;
}
! final Object peer = AWTAccessor.getComponentAccessor().getPeer(this);
! if (peer instanceof DisplayChangedListener) {
! ((DisplayChangedListener) peer).displayChanged();
}
repaint();
}
@Override
public void addNotify() {
super.addNotify();
! final Object peer = AWTAccessor.getComponentAccessor().getPeer(this);
! if (peer instanceof DisplayChangedListener) {
! ((DisplayChangedListener) peer).displayChanged();
}
}
private void syncCopyBuffer(boolean reset, int x, int y, int w, int h, int scale) {
content.paintLock();