Java Code Examples for sun.awt.CGraphicsEnvironment#getScreenDevice()

The following examples show how to use sun.awt.CGraphicsEnvironment#getScreenDevice() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: CPlatformView.java    From dragonwell8_jdk with GNU General Public License v2.0 5 votes vote down vote up
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;
}
 
Example 2
Source File: CPlatformView.java    From TencentKona-8 with GNU General Public License v2.0 5 votes vote down vote up
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;
}
 
Example 3
Source File: CPlatformView.java    From jdk8u60 with GNU General Public License v2.0 5 votes vote down vote up
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;
}
 
Example 4
Source File: CPlatformView.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
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;
}
 
Example 5
Source File: CPlatformView.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 5 votes vote down vote up
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;
}
 
Example 6
Source File: CPlatformView.java    From openjdk-jdk9 with GNU General Public License v2.0 5 votes vote down vote up
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;
}
 
Example 7
Source File: CPlatformView.java    From jdk8u-jdk with GNU General Public License v2.0 5 votes vote down vote up
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;
}
 
Example 8
Source File: CPlatformView.java    From hottub with GNU General Public License v2.0 5 votes vote down vote up
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;
}
 
Example 9
Source File: CPlatformView.java    From openjdk-8-source with GNU General Public License v2.0 5 votes vote down vote up
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;
}
 
Example 10
Source File: CPlatformView.java    From openjdk-8 with GNU General Public License v2.0 5 votes vote down vote up
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;
}
 
Example 11
Source File: CPlatformView.java    From jdk8u_jdk with GNU General Public License v2.0 5 votes vote down vote up
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;
}
 
Example 12
Source File: CPlatformView.java    From jdk8u-jdk with GNU General Public License v2.0 5 votes vote down vote up
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;
}
 
Example 13
Source File: CPlatformView.java    From jdk8u-dev-jdk with GNU General Public License v2.0 5 votes vote down vote up
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;
}