Download as pdf or txt
Download as pdf or txt
You are on page 1of 1

GraphicsDevice.

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)

Common ways to obtain GraphicsDevice java.awt  GraphicsDevice  getDisplayMode

1 private void myMethod () {


2 GraphicsDevice g = Popular methods of GraphicsDevice
3 } GraphicsEnvironment.getLocalGraphicsEnvironment().getDefaultScreenDevi…
getDefaultConfiguration
4 GraphicsEnvironment ge; Returns the default GraphicsConfiguration associated with...
5 ge.getDefaultScreenDevice()
GraphicsConfiguration graphicsConfiguration; setFullScreenWindow
graphicsConfiguration.getDevice() Enter full-screen mode, or return to windowed mode. If isF...
Smart code suggestions by Codota
getConfigurations
Returns all of the GraphicsConfiguration objects associate...
Get smart completions for your Java IDE Add Codota to your IDE (free)
isFullScreenSupported
Returns true if this GraphicsDevice supports full-screen ex...
How can I get screen resolution in java? origin: stackoverflow.com
getType
1
Returns the type of this GraphicsDevice.
2 GraphicsDevice gd = GraphicsEnvironment.getLocalGraphicsEnvironment().getDefaultScreenDevice();
getDisplayModes
3 int width = gd. getDisplayMode ().getWidth();
4 int height = gd. getDisplayMode ().getHeight();
getIDstring
Returns the identification string associated with thisGraphi...

LwjglApplicationCon guration.getDisplayModes() origin: libgdx/libgdx getFullScreenWindow


Returns the Window object representing the full-screen wi...
1 public static DisplayMode[] getDisplayModes () {
setDisplayMode
2 GraphicsEnvironment genv = GraphicsEnvironment.getLocalGraphicsEnvironment();
3 GraphicsDevice device = genv.getDefaultScreenDevice();
isWindowTranslucencySupported
4 java.awt.DisplayMode desktopMode = device. getDisplayMode ();
5 java.awt.DisplayMode[] displayModes = device.getDisplayModes(); isDisplayChangeSupported
6 ArrayList<DisplayMode> modes = new ArrayList<DisplayMode>();
7 int idx = 0; getBestConfiguration
8 for (java.awt.DisplayMode mode : displayModes) {
9 boolean duplicate = false;
10 for (int i = 0; i < modes.size(); i++) { isDisplayChangeSupported,
11 if (modes.get(i).width == mode.getWidth() && modes.get(i).height == mode.getHeight() getBestConfiguration, equals,
12 && modes.get(i).bitsPerPixel == mode.getBitDepth()) { getAvailableAcceleratedMemory,
13 duplicate = true;
setFullScreenWindows
14 break;
15 }
16 }
17 if (duplicate) continue;
18 if (mode.getBitDepth() != desktopMode.getBitDepth()) continue; Popular in Java
19 modes.add(new LwjglApplicationConfigurationDisplayMode(mode.getWidth(), mode.getHeight(), mode.g
Reactive rest calls using spring rest
20 .getBitDepth()));
21 } template
22
setRequestProperty (URLConnection)
23 return modes.toArray(new DisplayMode[modes.size()]);
24 }
setContentView (Activity)
25 }
compareTo (BigDecimal)
Compares this BigDecimal with the specified BigDecimal. ...

MainWindow.setLocationAndPosition() origin: skylot/jadx Font (java.awt)


The Font class represents fonts, which are used to render t...
1 public void setLocationAndPosition() {
2 if (this.settings.loadWindowPos(this)) { OutputStream (java.io)
3 return; A writable sink for bytes.Most clients will use output strea...
4 }
5 GraphicsDevice gd = GraphicsEnvironment.getLocalGraphicsEnvironment().getDefaultScreenDevice(); Path (java.nio.file)
6 DisplayMode mode = gd. getDisplayMode ();
Modifier (javassist)
7 int w = mode.getWidth();
8 int h = mode.getHeight();
The Modifier class provides static methods and constants t...
9 setLocation((int) (w * BORDER_RATIO), (int) (h * BORDER_RATIO));
Options (org.apache.commons.cli)
10 setSize((int) (w * WINDOW_RATIO), (int) (h * WINDOW_RATIO));
Main entry-point into the library. Options represents a colle...
11 }
12
BasicDataSource (org.apache.commons.dbcp)
Basic implementation of javax.sql.DataSource that is confi...

LwjglApplicationCon guration.getDisplayModes() origin: libgdx/libgdx


1 public static DisplayMode[] getDisplayModes () { Get Codota AI autocomplete in your
GraphicsEnvironment genv = GraphicsEnvironment.getLocalGraphicsEnvironment();
IDE
2

3 GraphicsDevice device = genv.getDefaultScreenDevice();


4 java.awt.DisplayMode desktopMode = device. getDisplayMode ();
5 java.awt.DisplayMode[] displayModes = device.getDisplayModes();
6 ArrayList<DisplayMode> modes = new ArrayList<DisplayMode>();
7 int idx = 0;
8 for (java.awt.DisplayMode mode : displayModes) {
9 boolean duplicate = false;
10 for (int i = 0; i < modes.size(); i++) {
11 if (modes.get(i).width == mode.getWidth() && modes.get(i).height == mode.getHeight()
12 && modes.get(i).bitsPerPixel == mode.getBitDepth()) {
13 duplicate = true;
14 break;
15 } Add Codota to your IDE (free)
16 }
17 if (duplicate) continue;
18 if (mode.getBitDepth() != desktopMode.getBitDepth()) continue;
19 modes.add(new LwjglApplicationConfigurationDisplayMode(mode.getWidth(), mode.getHeight(), mode.g
20 .getBitDepth()));
21 }
22

23 return modes.toArray(new DisplayMode[modes.size()]);


24 }
25 }

LwjglApplicationCon guration.getDesktopDisplayMode() origin: libgdx/libgdx

1 public static DisplayMode getDesktopDisplayMode () {


2 GraphicsEnvironment genv = GraphicsEnvironment.getLocalGraphicsEnvironment();
3 GraphicsDevice device = genv.getDefaultScreenDevice();
4 java.awt.DisplayMode mode = device. getDisplayMode ();
5 return new LwjglApplicationConfigurationDisplayMode(mode.getWidth(), mode.getHeight(), mode.getRefre
6 mode.getBitDepth());
7 }
8

JoglDisplay.applySettings(...) origin: jMonkeyEngine/jmonkey…


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()});

LwjglApplicationCon guration.getDesktopDisplayMode() origin: libgdx/libgdx

1 public static DisplayMode getDesktopDisplayMode () {


2 GraphicsEnvironment genv = GraphicsEnvironment.getLocalGraphicsEnvironment();
3 GraphicsDevice device = genv.getDefaultScreenDevice();
4 java.awt.DisplayMode mode = device. getDisplayMode ();
5 return new LwjglApplicationConfigurationDisplayMode(mode.getWidth(), mode.getHeight(), mode.getRefre
6 mode.getBitDepth());
7 }
8

VRApplication.start() origin: jMonkeyEngine/jmonkey…


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);

AwtRequestParameterDiscoverer.discoverParameters(...) origin: h2oai/h2o-2

1 @Override
2 public DefaultRequest discoverParameters(GoogleAnalyticsConfig config, DefaultRequest request) {
3 super.discoverParameters(config, request);
4

5 Toolkit toolkit = Toolkit.getDefaultToolkit();


6

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

16 StringBuilder sb = new StringBuilder();


17 for (GraphicsDevice graphicsDevice : graphicsDevices) {
18 if (sb.length() != 0) {
19 sb.append(", ");
20 }
21 sb.append(graphicsDevice. getDisplayMode ().getBitDepth());
22 }
23 request.screenColors(sb.toString());
24 }
25

26 return request;
27 }
28 }

VRAppState.stateAttached(...) origin: jMonkeyEngine/jmonkey…


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);

ScreenCaptureDevice.<init>(...) origin: sarxos/webcam-capture

1 public ScreenCaptureDevice(final GraphicsDevice device) {


2

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

14 LOG.trace("Screen device {} with resolution {} has been created", getName(), getResolution());


15 }
16

FullscreenDisplayHandler.<init>() origin: 4thline/cling

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

VRGuiManager.getCanvasToWindowRatio() origin: jMonkeyEngine/jmonkey…

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);

ception("VR GUI manager underlying environment is not attached to any application.");

ption("VR GUI manager is not attached to any environment.");

OSVRViewManager.initialize() origin: jMonkeyEngine/jmonkey…


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();

How can I get the screen resolution in java? origin: stackoverflow.com

2 GraphicsDevice gd = GraphicsEnvironment.getLocalGraphicsEnvironment().getDefaultScreenDevice();
3 int width = gd. getDisplayMode ().getWidth();
4 int height = gd. getDisplayMode ().getHeight();

PDFRenderer.isBitonal(...) origin: apache/pdfbox

1 private boolean isBitonal(Graphics2D graphics)


2 {
3 GraphicsConfiguration deviceConfiguration = graphics.getDeviceConfiguration();
4 if (deviceConfiguration == null)
5 {
6 return false;
7 }
8 GraphicsDevice device = deviceConfiguration.getDevice();
9 if (device == null)
10 {
11 return false;
12 }
13 DisplayMode displayMode = device. getDisplayMode ();
14 if (displayMode == null)
15 {
16 return false;
17 }
18 return displayMode.getBitDepth() == 1;
19 }
20

OSCFeedback.<init>(...) origin: fossasia/neurolab-des…


44 int width = gd. getDisplayMode ().getWidth();
45 int height = gd. getDisplayMode ().getHeight();

FocusOMeter.<init>(...) origin: fossasia/neurolab-des…


44 int width = gd. getDisplayMode ().getWidth();
45 int height = gd. getDisplayMode ().getHeight();

SpoonObjectFieldsTable.initialize() origin: INRIA/spoon

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

SpoonModelTree.initialize() origin: INRIA/spoon

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

For IntelliJ IDEA,


Android Studio or Eclipse

Search for JavaScript code BETA


Enterprise Plugin user guide
Add Codota to your IDE (free)

Codota IntelliJ IDEA plugin FAQ Terms of use

Codota Android Studio plugin About Privacy policy

Code Index Blog Codebox

Sign in Contact Us Find Usages


   

You might also like