DetectGraphicsDevices { public GraphicsConfiguration getSingleGraphicDeviceConfig(String graphicsDeviceName) { GraphicsConfiguration graphicsDeviceConfig = null; GraphicsDevice[] graphicsDevices = getGraphicsDevice(); for (int i=0; i < graphicsDevices.length; i++) { GraphicsConfiguration[] graphicsConfigs = graphicsDevices[i].getConfigurations(); logger.debug("[i={0}]: Total Graphics Configs: {1}", i, graphicsConfigs.length); String graphicsDeviceNameID = graphicsDevices[i].getIDstring(); graphicsDeviceNameID = graphicsDeviceNameID.replace("\\", ""); graphicsDeviceNameID = graphicsDeviceNameID.trim(); graphicsDeviceName = graphicsDeviceName.trim(); logger.debug("graphicsDeviceNameID: {0}", graphicsDeviceNameID + " ==? graphicsDeviceName: {1}", graphicsDeviceName + " check=" + (graphicsDeviceNameID.equals(graphicsDeviceName))); if (graphicsDeviceNameID.equals(graphicsDeviceName)) { graphicsDeviceConfig = graphicsDevices[i].getDefaultConfiguration(); singleGraphicsDevice = graphicsDevices[i]; if (graphicsDevices[i] == null) { logger.error("Multiple monitor graphics devices are NULL will open on default current monitor."); } logger.debug("singleGraphicsDevice: {0}", singleGraphicsDevice); return graphicsDeviceConfig; } } return graphicsDeviceConfig; } private  DetectGraphicsDevices(); static DetectGraphicsDevices getInstance(); boolean isGraphicsEnvHeadless(); boolean isGraphicsEnvHeadlessInstance(); int getNumberGraphicsDevices(); GraphicsDevice[] getGraphicsDevice(); void setGraphicsDevice(GraphicsDevice[] graphicsDevices); GraphicsDevice getSingleGraphicDevice(); GraphicsConfiguration getSingleGraphicDeviceConfig(String graphicsDeviceName); static boolean isWindows(); static boolean isMac(); static boolean isUnixLinux(); ArrayList<String> getGraphicDeviceNames(); static final int MINIMUM_MONITOR_CHECK; static final String OPEN_MULTIPLE_MONITORS_OBJECTS_ACTION; static final String OPEN_MULTIPLE_MONITORS_THIS_ACTION; static final String OBJECTS_ADDITIONS_MENU_PATH; static final String THIS_ADDITIONS_MENU_PATH; static final String OBJECTS_SUBMENU_PATH; static final String SHOW_OBJECTS_ACTION_MULTIPLE_MONITORS_TEXT; static final String OBJECTS_OPEN_MULTIPLE_MONITORS_MENU; static final String THIS_OPEN_MULTIPLE_MONITORS_MENU; static final String SHOW_THIS_ACTION_MULTIPLE_MONITORS_TEXT; static final String DEFAULT_MULTIPLE_MONITOR_TEXT; static final String PROPER_DEVICE_NAME_PREFIX; }
@Test(enabled=false) public void testGetSingleGraphicDeviceConfig() { if (!detectGraphicsDevice.isGraphicsEnvHeadless() && DetectGraphicsDevices.isMac()) { Assert.assertNotNull(detectGraphicsDevice.getSingleGraphicDeviceConfig(DISPLAY_0)); } }