java.awt.AWTError Java Examples

The following examples show how to use java.awt.AWTError. 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: CThreading.java    From jdk8u_jdk with GNU General Public License v2.0 5 votes vote down vote up
public static void executeOnAppKit(Runnable command) {
    if (!isAppKit()) {
        Dispatch dispatch = Dispatch.getInstance();

        if (dispatch != null) {
            dispatch.getNonBlockingMainQueueExecutor().execute(command);
        }
        else {
            throw new AWTError("Could not get Dispatch object");
        }
    } else
        command.run();
}
 
Example #2
Source File: SunGraphicsEnvironment.java    From hottub with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Returns the default screen graphics device.
 */
public GraphicsDevice getDefaultScreenDevice() {
    GraphicsDevice[] screens = getScreenDevices();
    if (screens.length == 0) {
        throw new AWTError("no screen devices");
    }
    return screens[0];
}
 
Example #3
Source File: Win32GraphicsEnvironment.java    From hottub with GNU General Public License v2.0 5 votes vote down vote up
public GraphicsDevice getDefaultScreenDevice() {
    GraphicsDevice[] screens = getScreenDevices();
    if (screens.length == 0) {
        throw new AWTError("no screen devices");
    }
    int index = getDefaultScreen();
    return screens[0 < index && index < screens.length ? index : 0];
}
 
Example #4
Source File: X11GraphicsEnvironment.java    From hottub with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Returns the default screen graphics device.
 */
public GraphicsDevice getDefaultScreenDevice() {
    GraphicsDevice[] screens = getScreenDevices();
    if (screens.length == 0) {
        throw new AWTError("no screen devices");
    }
    int index = getDefaultScreenNum();
    return screens[0 < index && index < screens.length ? index : 0];
}
 
Example #5
Source File: SunGraphicsEnvironment.java    From openjdk-8-source with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Returns the default screen graphics device.
 */
public GraphicsDevice getDefaultScreenDevice() {
    GraphicsDevice[] screens = getScreenDevices();
    if (screens.length == 0) {
        throw new AWTError("no screen devices");
    }
    return screens[0];
}
 
Example #6
Source File: Win32GraphicsEnvironment.java    From openjdk-8-source with GNU General Public License v2.0 5 votes vote down vote up
public GraphicsDevice getDefaultScreenDevice() {
    GraphicsDevice[] screens = getScreenDevices();
    if (screens.length == 0) {
        throw new AWTError("no screen devices");
    }
    int index = getDefaultScreen();
    return screens[0 < index && index < screens.length ? index : 0];
}
 
Example #7
Source File: X11GraphicsEnvironment.java    From openjdk-8-source with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Returns the default screen graphics device.
 */
public GraphicsDevice getDefaultScreenDevice() {
    GraphicsDevice[] screens = getScreenDevices();
    if (screens.length == 0) {
        throw new AWTError("no screen devices");
    }
    int index = getDefaultScreenNum();
    return screens[0 < index && index < screens.length ? index : 0];
}
 
Example #8
Source File: SunGraphicsEnvironment.java    From openjdk-8 with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Returns the default screen graphics device.
 */
public GraphicsDevice getDefaultScreenDevice() {
    GraphicsDevice[] screens = getScreenDevices();
    if (screens.length == 0) {
        throw new AWTError("no screen devices");
    }
    return screens[0];
}
 
Example #9
Source File: Win32GraphicsEnvironment.java    From openjdk-8 with GNU General Public License v2.0 5 votes vote down vote up
public GraphicsDevice getDefaultScreenDevice() {
    GraphicsDevice[] screens = getScreenDevices();
    if (screens.length == 0) {
        throw new AWTError("no screen devices");
    }
    int index = getDefaultScreen();
    return screens[0 < index && index < screens.length ? index : 0];
}
 
Example #10
Source File: X11GraphicsEnvironment.java    From openjdk-8 with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Returns the default screen graphics device.
 */
public GraphicsDevice getDefaultScreenDevice() {
    GraphicsDevice[] screens = getScreenDevices();
    if (screens.length == 0) {
        throw new AWTError("no screen devices");
    }
    int index = getDefaultScreenNum();
    return screens[0 < index && index < screens.length ? index : 0];
}
 
Example #11
Source File: SunGraphicsEnvironment.java    From jdk8u_jdk with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Returns the default screen graphics device.
 */
public GraphicsDevice getDefaultScreenDevice() {
    GraphicsDevice[] screens = getScreenDevices();
    if (screens.length == 0) {
        throw new AWTError("no screen devices");
    }
    return screens[0];
}
 
Example #12
Source File: X11GraphicsEnvironment.java    From jdk8u-jdk with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Returns the default screen graphics device.
 */
public GraphicsDevice getDefaultScreenDevice() {
    GraphicsDevice[] screens = getScreenDevices();
    if (screens.length == 0) {
        throw new AWTError("no screen devices");
    }
    int index = getDefaultScreenNum();
    return screens[0 < index && index < screens.length ? index : 0];
}
 
Example #13
Source File: Win32GraphicsEnvironment.java    From jdk8u_jdk with GNU General Public License v2.0 5 votes vote down vote up
public GraphicsDevice getDefaultScreenDevice() {
    GraphicsDevice[] screens = getScreenDevices();
    if (screens.length == 0) {
        throw new AWTError("no screen devices");
    }
    int index = getDefaultScreen();
    return screens[0 < index && index < screens.length ? index : 0];
}
 
Example #14
Source File: X11GraphicsEnvironment.java    From jdk8u_jdk with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Returns the default screen graphics device.
 */
public GraphicsDevice getDefaultScreenDevice() {
    GraphicsDevice[] screens = getScreenDevices();
    if (screens.length == 0) {
        throw new AWTError("no screen devices");
    }
    int index = getDefaultScreenNum();
    return screens[0 < index && index < screens.length ? index : 0];
}
 
Example #15
Source File: SunGraphicsEnvironment.java    From jdk8u-jdk with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Returns the default screen graphics device.
 */
public GraphicsDevice getDefaultScreenDevice() {
    GraphicsDevice[] screens = getScreenDevices();
    if (screens.length == 0) {
        throw new AWTError("no screen devices");
    }
    return screens[0];
}
 
Example #16
Source File: Win32GraphicsEnvironment.java    From jdk8u-jdk with GNU General Public License v2.0 5 votes vote down vote up
public GraphicsDevice getDefaultScreenDevice() {
    GraphicsDevice[] screens = getScreenDevices();
    if (screens.length == 0) {
        throw new AWTError("no screen devices");
    }
    int index = getDefaultScreen();
    return screens[0 < index && index < screens.length ? index : 0];
}
 
Example #17
Source File: X11GraphicsEnvironment.java    From jdk8u-jdk with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Returns the default screen graphics device.
 */
public GraphicsDevice getDefaultScreenDevice() {
    GraphicsDevice[] screens = getScreenDevices();
    if (screens.length == 0) {
        throw new AWTError("no screen devices");
    }
    int index = getDefaultScreenNum();
    return screens[0 < index && index < screens.length ? index : 0];
}
 
Example #18
Source File: SunGraphicsEnvironment.java    From jdk8u-dev-jdk with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Returns the default screen graphics device.
 */
public GraphicsDevice getDefaultScreenDevice() {
    GraphicsDevice[] screens = getScreenDevices();
    if (screens.length == 0) {
        throw new AWTError("no screen devices");
    }
    return screens[0];
}
 
Example #19
Source File: Win32GraphicsEnvironment.java    From jdk8u-dev-jdk with GNU General Public License v2.0 5 votes vote down vote up
public GraphicsDevice getDefaultScreenDevice() {
    GraphicsDevice[] screens = getScreenDevices();
    if (screens.length == 0) {
        throw new AWTError("no screen devices");
    }
    int index = getDefaultScreen();
    return screens[0 < index && index < screens.length ? index : 0];
}
 
Example #20
Source File: X11GraphicsEnvironment.java    From jdk8u-dev-jdk with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Returns the default screen graphics device.
 */
public GraphicsDevice getDefaultScreenDevice() {
    GraphicsDevice[] screens = getScreenDevices();
    if (screens.length == 0) {
        throw new AWTError("no screen devices");
    }
    int index = getDefaultScreenNum();
    return screens[0 < index && index < screens.length ? index : 0];
}
 
Example #21
Source File: TestPanelJ2D.java    From jbox2d with BSD 2-Clause "Simplified" License 5 votes vote down vote up
public void paintScreen() {
  try {
    Graphics g = this.getGraphics();
    if ((g != null) && dbImage != null) {
      g.drawImage(dbImage, 0, 0, null);
      Toolkit.getDefaultToolkit().sync();
      g.dispose();
    }
  } catch (AWTError e) {
    log.error("Graphics context error", e);
  }
}
 
Example #22
Source File: Win32GraphicsEnvironment.java    From jdk8u-jdk with GNU General Public License v2.0 5 votes vote down vote up
public GraphicsDevice getDefaultScreenDevice() {
    GraphicsDevice[] screens = getScreenDevices();
    if (screens.length == 0) {
        throw new AWTError("no screen devices");
    }
    int index = getDefaultScreen();
    return screens[0 < index && index < screens.length ? index : 0];
}
 
Example #23
Source File: Win32GraphicsEnvironment.java    From dragonwell8_jdk with GNU General Public License v2.0 5 votes vote down vote up
public GraphicsDevice getDefaultScreenDevice() {
    GraphicsDevice[] screens = getScreenDevices();
    if (screens.length == 0) {
        throw new AWTError("no screen devices");
    }
    int index = getDefaultScreen();
    return screens[0 < index && index < screens.length ? index : 0];
}
 
Example #24
Source File: X11GraphicsEnvironment.java    From dragonwell8_jdk with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Returns the default screen graphics device.
 */
public GraphicsDevice getDefaultScreenDevice() {
    GraphicsDevice[] screens = getScreenDevices();
    if (screens.length == 0) {
        throw new AWTError("no screen devices");
    }
    int index = getDefaultScreenNum();
    return screens[0 < index && index < screens.length ? index : 0];
}
 
Example #25
Source File: SunGraphicsEnvironment.java    From TencentKona-8 with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Returns the default screen graphics device.
 */
public GraphicsDevice getDefaultScreenDevice() {
    GraphicsDevice[] screens = getScreenDevices();
    if (screens.length == 0) {
        throw new AWTError("no screen devices");
    }
    return screens[0];
}
 
Example #26
Source File: Win32GraphicsEnvironment.java    From TencentKona-8 with GNU General Public License v2.0 5 votes vote down vote up
public GraphicsDevice getDefaultScreenDevice() {
    GraphicsDevice[] screens = getScreenDevices();
    if (screens.length == 0) {
        throw new AWTError("no screen devices");
    }
    int index = getDefaultScreen();
    return screens[0 < index && index < screens.length ? index : 0];
}
 
Example #27
Source File: X11GraphicsEnvironment.java    From TencentKona-8 with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Returns the default screen graphics device.
 */
public GraphicsDevice getDefaultScreenDevice() {
    GraphicsDevice[] screens = getScreenDevices();
    if (screens.length == 0) {
        throw new AWTError("no screen devices");
    }
    int index = getDefaultScreenNum();
    return screens[0 < index && index < screens.length ? index : 0];
}
 
Example #28
Source File: SunGraphicsEnvironment.java    From jdk8u60 with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Returns the default screen graphics device.
 */
public GraphicsDevice getDefaultScreenDevice() {
    GraphicsDevice[] screens = getScreenDevices();
    if (screens.length == 0) {
        throw new AWTError("no screen devices");
    }
    return screens[0];
}
 
Example #29
Source File: Win32GraphicsEnvironment.java    From jdk8u60 with GNU General Public License v2.0 5 votes vote down vote up
public GraphicsDevice getDefaultScreenDevice() {
    GraphicsDevice[] screens = getScreenDevices();
    if (screens.length == 0) {
        throw new AWTError("no screen devices");
    }
    int index = getDefaultScreen();
    return screens[0 < index && index < screens.length ? index : 0];
}
 
Example #30
Source File: X11GraphicsEnvironment.java    From jdk8u60 with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Returns the default screen graphics device.
 */
public GraphicsDevice getDefaultScreenDevice() {
    GraphicsDevice[] screens = getScreenDevices();
    if (screens.length == 0) {
        throw new AWTError("no screen devices");
    }
    int index = getDefaultScreenNum();
    return screens[0 < index && index < screens.length ? index : 0];
}