Professional Documents
Culture Documents
tDisplayMode Java Code Examples - Codota
tDisplayMode Java Code Examples - Codota
getDisplayMode
Code Index Add Codota to your IDE (free)
Best Java code snippets using java.awt.GraphicsDevice.getDisplayMode (Showing top 20 results out of 603)
1 public static DisplayMode[] getDisplayModes () { Get Codota AI autocomplete in your
GraphicsEnvironment genv = GraphicsEnvironment.getLocalGraphicsEnvironment();
IDE
2
2 final GraphicsDevice gd = GraphicsEnvironment.getLocalGraphicsEnvironment().getDefaultScreenDevice();
3 final DisplayMode previousDisplayMode = gd. getDisplayMode ();
125 new Object[]{gd. getDisplayMode ().getWidth(),
126 gd. getDisplayMode ().getHeight(),
127 gd. getDisplayMode ().getBitDepth(),
128 gd. getDisplayMode ().getRefreshRate()});
58 if( VRdev. getDisplayMode ().equals(useDM) == false ) {
59 VRdev.setDisplayMode(useDM);
88 settings.setFrequency(defDev. getDisplayMode ().getRefreshRate());
89 settings.setDepthBits(24);
90 settings.setVSync(true);
1 @Override
2 public DefaultRequest discoverParameters(GoogleAnalyticsConfig config, DefaultRequest request) {
3 super.discoverParameters(config, request);
4
7 if (isEmpty(request.screenResolution())) {
8 Dimension screenSize = toolkit.getScreenSize();
9 request.screenResolution(((int) screenSize.getWidth()) + "x" + ((int) screenSize.getHeight()) + ",
10 }
11
12 if (isEmpty(request.screenColors())) {
13 GraphicsEnvironment graphicsEnvironment = GraphicsEnvironment.getLocalGraphicsEnvironment();
14 GraphicsDevice[] graphicsDevices = graphicsEnvironment.getScreenDevices();
15
26 return request;
27 }
28 }
64 if( VRdev. getDisplayMode ().equals(useDM) == false ) {
65 VRdev.setDisplayMode(useDM);
86 if (macOs) {
87 settings.setFrequency(defDev. getDisplayMode ().getRefreshRate());
88 settings.setDepthBits(24);
89 settings.setVSync(true);
3 this.device = device;
4 this.mode = device. getDisplayMode ();
5 this.resolution = new Dimension(mode.getWidth(), mode.getHeight());
6 this.resolutions = new Dimension[] { this.resolution };
7
8 try {
9 this.robot = new Robot(device);
10 } catch (AWTException e) {
11 throw new WebcamException("Unable to create robot", e);
12 }
13
1 public FullscreenDisplayHandler() {
2 gfxDevice = GraphicsEnvironment.getLocalGraphicsEnvironment().getDefaultScreenDevice();
3 displayMode = gfxDevice. getDisplayMode ();
4 frame = new GridPanelFrame(displayMode.getWidth(), displayMode.getHeight());
5 MediaRenderer.APP.log(
6 Level.INFO,
7 "Enabling fullscreen handler (press ESC to exit) with resolution: "
8 + displayMode.getWidth() + "x" + displayMode.getHeight()
9 );
10
11 frame.addKeyListener(new KeyListener() {
12 public void keyPressed(KeyEvent keyEvent) {
13 if (keyEvent.getKeyCode() == KeyEvent.VK_ESCAPE)
14 MediaRenderer.APP.getMediaRenderer().stopAllMediaPlayers();
15 }
16 public void keyReleased(KeyEvent keyEvent) {
17 }
18 public void keyTyped(KeyEvent keyEvent) {
19 }
20 });
21 }
22
anvasSize() GUI canvas size} and the application main windows (if available) or the screen size.
getCanvasSize() GUI canvas size} and the application main windows (if available).
dowRatio() {
tion() != null){
anvasSize();
n(GraphicsEnvironment.getLocalGraphicsEnvironment().getDefaultScreenDevice(). getDisplayMode ().getWidth(),
lication().getContext().getSettings().getWidth());
in(GraphicsEnvironment.getLocalGraphicsEnvironment().getDefaultScreenDevice(). getDisplayMode ().getHeight(),
lication().getContext().getSettings().getHeight());
canvas.x / width);
canvas.y / height);
24 int origWidth = GraphicsEnvironment.getLocalGraphicsEnvironment().getDefaultScreenDevice(). getDisplay
25 int origHeight = GraphicsEnvironment.getLocalGraphicsEnvironment().getDefaultScreenDevice(). getDispla
26 long window = ((LwjglWindow)environment.getApplication().getContext()).getWindowHandle();
27 Vector2f windowSize = new Vector2f();
2 GraphicsDevice gd = GraphicsEnvironment.getLocalGraphicsEnvironment().getDefaultScreenDevice();
3 int width = gd. getDisplayMode ().getWidth();
4 int height = gd. getDisplayMode ().getHeight();
44 int width = gd. getDisplayMode ().getWidth();
45 int height = gd. getDisplayMode ().getHeight();
44 int width = gd. getDisplayMode ().getWidth();
45 int height = gd. getDisplayMode ().getHeight();
1 /**
2 * This method initializes this
3 *
4 * @return void
5 */
6 private void initialize() {
7 this.setSize(320, 240);
8 this.setLocation((getGraphicsConfiguration().getDevice(). getDisplayMode ().getWidth() - getWidth())
9 (getGraphicsConfiguration().getDevice(). getDisplayMode ().getHeight() - getHeight()) / 2);
10 this.setContentPane(getJContentPane());
11 this.setTitle(o.getClass().getSimpleName());
12 this.setVisible(true);
13 this.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
14 }
15
1 /**
2 * This method initializes this
3 *
4 * @return void
5 */
6 private void initialize() {
7 this.setSize(640, 480);
8 this.setLocation((getGraphicsConfiguration().getDevice()
9 . getDisplayMode ().getWidth() - getWidth()) / 2,
10 (getGraphicsConfiguration().getDevice(). getDisplayMode ()
11 .getHeight() - getHeight()) / 2);
12
13 setContentPane(getJContentPane());
14 setTitle("Spoon");
15 setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
16 this.setVisible(true);
17 }
18