当前位置: 首页>>代码示例>>Java>>正文


Java DisplayMode.REFRESH_RATE_UNKNOWN属性代码示例

本文整理汇总了Java中java.awt.DisplayMode.REFRESH_RATE_UNKNOWN属性的典型用法代码示例。如果您正苦于以下问题:Java DisplayMode.REFRESH_RATE_UNKNOWN属性的具体用法?Java DisplayMode.REFRESH_RATE_UNKNOWN怎么用?Java DisplayMode.REFRESH_RATE_UNKNOWN使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在java.awt.DisplayMode的用法示例。


在下文中一共展示了DisplayMode.REFRESH_RATE_UNKNOWN属性的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: getScreenRefreshRate

int getScreenRefreshRate() {
        int rate = 60;
        GraphicsEnvironment ge = GraphicsEnvironment.getLocalGraphicsEnvironment();
        GraphicsDevice[] gs = ge.getScreenDevices();
        for (int i = 0; i < gs.length; i++) {
            DisplayMode dm = gs[i].getDisplayMode();
            // Get refresh rate in Hz
            int refreshRate = dm.getRefreshRate();
            if (refreshRate == DisplayMode.REFRESH_RATE_UNKNOWN) {
//                log.warning("MotionViewer.getScreenRefreshRate: got unknown refresh rate for screen "+i+", assuming 60");
                refreshRate = 60;
            } else {
//                log.info("MotionViewer.getScreenRefreshRate: screen "+i+" has refresh rate "+refreshRate);
            }
            if (i == 0) {
                rate = refreshRate;
            }
        }
        return rate;
    }
 
开发者ID:SensorsINI,项目名称:jaer,代码行数:20,代码来源:MotionViewer.java

示例2: getScreenRefreshRate

int getScreenRefreshRate() {
    int rate = 60;
    GraphicsEnvironment ge = GraphicsEnvironment.getLocalGraphicsEnvironment();
    if (ge == null) {
        return rate;
    }
    GraphicsDevice[] gs = ge.getScreenDevices();
    for (int i = 0; i < gs.length; i++) {
        DisplayMode dm = gs[i].getDisplayMode();
        // Get refresh rate in Hz
        if (dm == null) {
            return rate;
        }
        int refreshRate = dm.getRefreshRate();
        if (refreshRate == DisplayMode.REFRESH_RATE_UNKNOWN) {
            log.warning("AEViewer.getScreenRefreshRate: got unknown refresh rate for screen " + i + ", assuming 60");
            refreshRate = 60;
        } else {
            //                log.info("AEViewer.getScreenRefreshRate: screen "+i+" has refresh rate "+refreshRate);
        }
        if (i == 0) {
            rate = refreshRate;
        }
    }
    return rate;
}
 
开发者ID:SensorsINI,项目名称:jaer,代码行数:26,代码来源:AEViewer.java

示例3: getMatchingDisplayMode

protected synchronized DisplayMode getMatchingDisplayMode(DisplayMode dm) {
    if (!isDisplayChangeSupported()) {
        return null;
    }
    DisplayMode[] modes = getDisplayModes();
    for (DisplayMode mode : modes) {
        if (dm.equals(mode) ||
            (dm.getRefreshRate() == DisplayMode.REFRESH_RATE_UNKNOWN &&
             dm.getWidth() == mode.getWidth() &&
             dm.getHeight() == mode.getHeight() &&
             dm.getBitDepth() == mode.getBitDepth()))
        {
            return mode;
        }
    }
    return null;
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:17,代码来源:Win32GraphicsDevice.java

示例4: getMatchingDisplayMode

private synchronized DisplayMode getMatchingDisplayMode(DisplayMode dm) {
    if (!isDisplayChangeSupported()) {
        return null;
    }
    DisplayMode[] modes = getDisplayModes();
    for (DisplayMode mode : modes) {
        if (dm.equals(mode) ||
            (dm.getRefreshRate() == DisplayMode.REFRESH_RATE_UNKNOWN &&
             dm.getWidth() == mode.getWidth() &&
             dm.getHeight() == mode.getHeight() &&
             dm.getBitDepth() == mode.getBitDepth()))
        {
            return mode;
        }
    }
    return null;
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:17,代码来源:X11GraphicsDevice.java

示例5: getDefaultDisplayMode

private DisplayMode getDefaultDisplayMode() {
    GraphicsConfiguration gc = getDefaultConfiguration();
    Rectangle r = gc.getBounds();
    return new DisplayMode(r.width, r.height,
                           DisplayMode.BIT_DEPTH_MULTI,
                           DisplayMode.REFRESH_RATE_UNKNOWN);
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:7,代码来源:X11GraphicsDevice.java


注:本文中的java.awt.DisplayMode.REFRESH_RATE_UNKNOWN属性示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。