use of sun.awt.CGraphicsEnvironment 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();
}
use of sun.awt.CGraphicsEnvironment in project jdk8u_jdk by JetBrains.
the class CPlatformView method getGraphicsDevice.
public GraphicsDevice getGraphicsDevice() {
GraphicsEnvironment ge = GraphicsEnvironment.getLocalGraphicsEnvironment();
CGraphicsEnvironment cge = (CGraphicsEnvironment) ge;
int displayID = nativeGetNSViewDisplayID(getAWTView());
GraphicsDevice gd = cge.getScreenDevice(displayID);
if (gd == null) {
// this could possibly happen during device removal
// use the default screen device in this case
gd = ge.getDefaultScreenDevice();
}
return gd;
}
Aggregations