本文整理匯總了Java中java.awt.GraphicsDevice.getConfigurations方法的典型用法代碼示例。如果您正苦於以下問題:Java GraphicsDevice.getConfigurations方法的具體用法?Java GraphicsDevice.getConfigurations怎麽用?Java GraphicsDevice.getConfigurations使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類java.awt.GraphicsDevice
的用法示例。
在下文中一共展示了GraphicsDevice.getConfigurations方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: ScreenModel
import java.awt.GraphicsDevice; //導入方法依賴的package包/類
public ScreenModel(GraphicsDevice device, String name, int number) {
this.name = number + " " + name;
this.idString = device.getIDstring();
this.width = device.getDisplayMode().getWidth();
this.height = device.getDisplayMode().getHeight();
GraphicsConfiguration[] gc = device.getConfigurations();
for (GraphicsConfiguration curGc : gc) {
Rectangle bounds = curGc.getBounds();
this.topLeftCorner = new Point((int) bounds.getX(), (int) bounds.getY());
}
}
示例2: main
import java.awt.GraphicsDevice; //導入方法依賴的package包/類
public static void main(String[] args) {
GraphicsEnvironment ge = GraphicsEnvironment.
getLocalGraphicsEnvironment();
if (ge.isHeadlessInstance()) {
return;
}
for (GraphicsDevice gd : ge.getScreenDevices()) {
for (GraphicsConfiguration gc : gd.getConfigurations()) {
testScaleFactor(gc);
}
}
}
示例3: GameWorld
import java.awt.GraphicsDevice; //導入方法依賴的package包/類
public GameWorld()
{
classesWithStaticStuff.add(this.getClass());
Thread.currentThread().setPriority(Thread.MAX_PRIORITY);
GraphicsEnvironment ge = GraphicsEnvironment.getLocalGraphicsEnvironment();
GraphicsDevice[] gs = ge.getScreenDevices();
GraphicsDevice gd = gs[0];
graphicsConfiguration = gd.getConfigurations()[0];
initArts();
//System.out.println("graphicsConfiguration " + graphicsConfiguration);
overlays = new OverlayManager();
adjustFPS();
GlobalOptions.registerGameWorld(this);
}