Java 类sun.awt.CGraphicsEnvironment 实例源码

项目:OpenJSharp    文件:CPlatformLWWindow.java   
@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();
}
项目:jdk8u-jdk    文件:CPlatformLWWindow.java   
@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();
}
项目:openjdk-jdk10    文件:CPlatformLWWindow.java   
@Override
public GraphicsDevice getGraphicsDevice() {
    CGraphicsEnvironment ge = (CGraphicsEnvironment)GraphicsEnvironment.
                              getLocalGraphicsEnvironment();

    LWLightweightFramePeer peer = (LWLightweightFramePeer)getPeer();
    int scale =(int) Math.round(((LightweightFrame)peer.getTarget())
                                                        .getScaleFactorX());

    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();
}
项目:openjdk9    文件:CPlatformLWWindow.java   
@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();
}
项目:jdk8u_jdk    文件:CPlatformLWWindow.java   
@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();
}
项目:lookaside_java-1.8.0-openjdk    文件:CPlatformLWWindow.java   
@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();
}
项目:infobip-open-jdk-8    文件:CPlatformLWWindow.java   
@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();
}
项目:jdk8u-dev-jdk    文件:CPlatformLWWindow.java   
@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();
}
项目:OpenJSharp    文件:CPlatformView.java   
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;
}
项目:jdk8u-jdk    文件:CPlatformView.java   
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;
}
项目:openjdk-jdk10    文件:CPlatformView.java   
public GraphicsDevice getGraphicsDevice() {
    GraphicsEnvironment ge = GraphicsEnvironment.getLocalGraphicsEnvironment();
    CGraphicsEnvironment cge = (CGraphicsEnvironment)ge;
    AtomicInteger ref = new AtomicInteger();
    execute(ptr -> {
        ref.set(nativeGetNSViewDisplayID(ptr));
    });
    GraphicsDevice gd = cge.getScreenDevice(ref.get());
    if (gd == null) {
        // this could possibly happen during device removal
        // use the default screen device in this case
        gd = ge.getDefaultScreenDevice();
    }
    return gd;
}
项目:openjdk9    文件:CPlatformView.java   
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;
}
项目:jdk8u_jdk    文件:CPlatformView.java   
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;
}
项目:lookaside_java-1.8.0-openjdk    文件:CPlatformView.java   
public GraphicsDevice getGraphicsDevice() {
    GraphicsEnvironment ge = GraphicsEnvironment.getLocalGraphicsEnvironment();
    CGraphicsEnvironment cge = (CGraphicsEnvironment)ge;
    AtomicInteger ref = new AtomicInteger();
    execute(ptr -> {
        ref.set(nativeGetNSViewDisplayID(ptr));
    });
    GraphicsDevice gd = cge.getScreenDevice(ref.get());
    if (gd == null) {
        // this could possibly happen during device removal
        // use the default screen device in this case
        gd = ge.getDefaultScreenDevice();
    }
    return gd;
}
项目:infobip-open-jdk-8    文件:CPlatformView.java   
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;
}
项目:jdk8u-dev-jdk    文件:CPlatformView.java   
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;
}
项目:OLD-OpenJDK8    文件:CPlatformView.java   
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;
}
项目:openjdk-jdk7u-jdk    文件:CPlatformView.java   
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;
}
项目:openjdk-icedtea7    文件:CPlatformView.java   
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;
}