use of sun.lwawt.LWLightweightFramePeer in project jdk8u_jdk by JetBrains.
the class CPlatformLWWindow method getGraphicsDevice.
@Override
public GraphicsDevice getGraphicsDevice() {
CGraphicsEnvironment ge = (CGraphicsEnvironment) GraphicsEnvironment.getLocalGraphicsEnvironment();
LWLightweightFramePeer peer = (LWLightweightFramePeer) getPeer();
int scale = ((LightweightFrame) peer.getTarget()).getScaleFactor();
Rectangle bounds = ((LightweightFrame) peer.getTarget()).getHostBounds();
for (GraphicsDevice d : ge.getScreenDevices()) {
if (d.getDefaultConfiguration().getBounds().intersects(bounds) && ((CGraphicsDevice) d).getScaleFactor() == scale) {
return d;
}
}
// We shouldn't be here...
return ge.getDefaultScreenDevice();
}
Aggregations