Java Code Examples for java.awt.DisplayMode#getRefreshRate()
The following examples show how to use
java.awt.DisplayMode#getRefreshRate() .
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: Win32GraphicsDevice.java From hottub with GNU General Public License v2.0 | 6 votes |
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; }
Example 2
Source File: DisplayModeChanger.java From openjdk-jdk9 with GNU General Public License v2.0 | 6 votes |
/** * Finds a display mode that is different from the current display * mode and is likely to cause a display change event. */ private static DisplayMode findDisplayMode(GraphicsDevice gd) { DisplayMode dms[] = gd.getDisplayModes(); DisplayMode currentDM = gd.getDisplayMode(); for (DisplayMode dm : dms) { if (!dm.equals(currentDM) && dm.getRefreshRate() == currentDM.getRefreshRate()) { // different from the current dm and refresh rate is the same // means that something else is different => more likely to // cause a DM change event return dm; } } return null; }
Example 3
Source File: Win32GraphicsDevice.java From openjdk-jdk9 with GNU General Public License v2.0 | 6 votes |
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; }
Example 4
Source File: X11GraphicsDevice.java From openjdk-jdk9 with GNU General Public License v2.0 | 6 votes |
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; }
Example 5
Source File: DisplayModeChanger.java From openjdk-8 with GNU General Public License v2.0 | 6 votes |
/** * Finds a display mode that is different from the current display * mode and is likely to cause a display change event. */ private static DisplayMode findDisplayMode(GraphicsDevice gd) { DisplayMode dms[] = gd.getDisplayModes(); DisplayMode currentDM = gd.getDisplayMode(); for (DisplayMode dm : dms) { if (!dm.equals(currentDM) && dm.getRefreshRate() == currentDM.getRefreshRate()) { // different from the current dm and refresh rate is the same // means that something else is different => more likely to // cause a DM change event return dm; } } return null; }
Example 6
Source File: X11GraphicsDevice.java From openjdk-8-source with GNU General Public License v2.0 | 6 votes |
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; }
Example 7
Source File: Win32GraphicsDevice.java From openjdk-jdk8u-backup with GNU General Public License v2.0 | 6 votes |
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; }
Example 8
Source File: Win32GraphicsDevice.java From jdk8u-jdk with GNU General Public License v2.0 | 6 votes |
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; }
Example 9
Source File: Win32GraphicsDevice.java From dragonwell8_jdk with GNU General Public License v2.0 | 6 votes |
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; }
Example 10
Source File: X11GraphicsDevice.java From openjdk-8 with GNU General Public License v2.0 | 6 votes |
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; }
Example 11
Source File: DisplayModeChanger.java From openjdk-8-source with GNU General Public License v2.0 | 6 votes |
/** * Finds a display mode that is different from the current display * mode and is likely to cause a display change event. */ private static DisplayMode findDisplayMode(GraphicsDevice gd) { DisplayMode dms[] = gd.getDisplayModes(); DisplayMode currentDM = gd.getDisplayMode(); for (DisplayMode dm : dms) { if (!dm.equals(currentDM) && dm.getRefreshRate() == currentDM.getRefreshRate()) { // different from the current dm and refresh rate is the same // means that something else is different => more likely to // cause a DM change event return dm; } } return null; }
Example 12
Source File: X11GraphicsDevice.java From jdk8u60 with GNU General Public License v2.0 | 6 votes |
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; }
Example 13
Source File: Win32GraphicsDevice.java From jdk8u60 with GNU General Public License v2.0 | 6 votes |
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; }
Example 14
Source File: X11GraphicsDevice.java From hottub with GNU General Public License v2.0 | 6 votes |
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; }
Example 15
Source File: X11GraphicsDevice.java From TencentKona-8 with GNU General Public License v2.0 | 6 votes |
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; }
Example 16
Source File: X11GraphicsDevice.java From jdk8u_jdk with GNU General Public License v2.0 | 6 votes |
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; }
Example 17
Source File: DisplayModeChanger.java From dragonwell8_jdk with GNU General Public License v2.0 | 6 votes |
/** * Finds a display mode that is different from the current display * mode and is likely to cause a display change event. */ private static DisplayMode findDisplayMode(GraphicsDevice gd) { DisplayMode dms[] = gd.getDisplayModes(); DisplayMode currentDM = gd.getDisplayMode(); for (DisplayMode dm : dms) { if (!dm.equals(currentDM) && dm.getRefreshRate() == currentDM.getRefreshRate()) { // different from the current dm and refresh rate is the same // means that something else is different => more likely to // cause a DM change event return dm; } } return null; }
Example 18
Source File: X11GraphicsDevice.java From dragonwell8_jdk with GNU General Public License v2.0 | 6 votes |
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; }
Example 19
Source File: NonExistentDisplayModeTest.java From openjdk-jdk9 with GNU General Public License v2.0 | 5 votes |
private static DisplayMode deriveDepth(DisplayMode dm) { int depth; if (dm.getBitDepth() == DisplayMode.BIT_DEPTH_MULTI) { depth = 77; } else { depth = DisplayMode.BIT_DEPTH_MULTI; } return new DisplayMode(dm.getWidth(), dm.getHeight(), depth, dm.getRefreshRate()); }
Example 20
Source File: NonExistentDisplayModeTest.java From openjdk-jdk9 with GNU General Public License v2.0 | 4 votes |
private static DisplayMode deriveSize(DisplayMode dm) { int w = dm.getWidth() / 7; int h = dm.getHeight() / 3; return new DisplayMode(w, h, dm.getBitDepth(), dm.getRefreshRate()); }