本文整理汇总了Java中java.awt.GraphicsDevice.TYPE_RASTER_SCREEN属性的典型用法代码示例。如果您正苦于以下问题:Java GraphicsDevice.TYPE_RASTER_SCREEN属性的具体用法?Java GraphicsDevice.TYPE_RASTER_SCREEN怎么用?Java GraphicsDevice.TYPE_RASTER_SCREEN使用的例子?那么恭喜您, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类java.awt.GraphicsDevice
的用法示例。
在下文中一共展示了GraphicsDevice.TYPE_RASTER_SCREEN属性的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: checkConfigs
private static GraphicsDevice checkConfigs(GraphicsDevice[] devices) {
GraphicsDevice correctDevice = null;
if (devices.length < 2) {
return correctDevice;
}
Toolkit toolkit = Toolkit.getDefaultToolkit();
Rectangle screenBounds = new Rectangle(toolkit.getScreenSize());
int halfScreen = screenBounds.height/2;
for(int i = 0; i < devices.length; i++) {
if(devices[i].getType() == GraphicsDevice.TYPE_RASTER_SCREEN) {
GraphicsConfiguration conf =
devices[i].getDefaultConfiguration();
Rectangle bounds = conf.getBounds();
if (bounds.y >= halfScreen) {
// found
correctDevice = devices[i];
break;
}
}
}
return correctDevice;
}
示例2: isOutOfScreen
/**
* @return False if the given point is not inside any screen device that are currently available.
*/
private static boolean isOutOfScreen( int x, int y ) {
GraphicsEnvironment ge = GraphicsEnvironment.getLocalGraphicsEnvironment();
GraphicsDevice[] gs = ge.getScreenDevices();
for( int j=0; j<gs.length; j++ ) {
GraphicsDevice gd = gs[j];
if( gd.getType() != GraphicsDevice.TYPE_RASTER_SCREEN )
continue;
Rectangle bounds = gd.getDefaultConfiguration().getBounds();
if( bounds.contains( x, y ) )
return false;
}
return true;
}