equal
deleted
inserted
replaced
1 /* |
1 /* |
2 * Copyright (c) 2000, 2006, Oracle and/or its affiliates. All rights reserved. |
2 * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved. |
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
4 * |
4 * |
5 * This code is free software; you can redistribute it and/or modify it |
5 * This code is free software; you can redistribute it and/or modify it |
6 * under the terms of the GNU General Public License version 2 only, as |
6 * under the terms of the GNU General Public License version 2 only, as |
7 * published by the Free Software Foundation. Oracle designates this |
7 * published by the Free Software Foundation. Oracle designates this |
23 * questions. |
23 * questions. |
24 */ |
24 */ |
25 |
25 |
26 package java.awt; |
26 package java.awt; |
27 |
27 |
28 import javax.tools.annotation.GenerateNativeHeader; |
28 import java.lang.annotation.Native; |
29 |
29 |
30 /** |
30 /** |
31 * The <code>DisplayMode</code> class encapsulates the bit depth, height, |
31 * The <code>DisplayMode</code> class encapsulates the bit depth, height, |
32 * width, and refresh rate of a <code>GraphicsDevice</code>. The ability to |
32 * width, and refresh rate of a <code>GraphicsDevice</code>. The ability to |
33 * change graphics device's display mode is platform- and |
33 * change graphics device's display mode is platform- and |
44 * @see GraphicsDevice#setDisplayMode |
44 * @see GraphicsDevice#setDisplayMode |
45 * @author Michael Martak |
45 * @author Michael Martak |
46 * @since 1.4 |
46 * @since 1.4 |
47 */ |
47 */ |
48 |
48 |
49 /* No native methods here, but the constants are needed in the supporting JNI code */ |
|
50 @GenerateNativeHeader |
|
51 public final class DisplayMode { |
49 public final class DisplayMode { |
52 |
50 |
53 private Dimension size; |
51 private Dimension size; |
54 private int bitDepth; |
52 private int bitDepth; |
55 private int refreshRate; |
53 private int refreshRate; |
92 /** |
90 /** |
93 * Value of the bit depth if multiple bit depths are supported in this |
91 * Value of the bit depth if multiple bit depths are supported in this |
94 * display mode. |
92 * display mode. |
95 * @see #getBitDepth |
93 * @see #getBitDepth |
96 */ |
94 */ |
97 public final static int BIT_DEPTH_MULTI = -1; |
95 @Native public final static int BIT_DEPTH_MULTI = -1; |
98 |
96 |
99 /** |
97 /** |
100 * Returns the bit depth of the display, in bits per pixel. This may be |
98 * Returns the bit depth of the display, in bits per pixel. This may be |
101 * <code>BIT_DEPTH_MULTI</code> if multiple bit depths are supported in |
99 * <code>BIT_DEPTH_MULTI</code> if multiple bit depths are supported in |
102 * this display mode. |
100 * this display mode. |
110 |
108 |
111 /** |
109 /** |
112 * Value of the refresh rate if not known. |
110 * Value of the refresh rate if not known. |
113 * @see #getRefreshRate |
111 * @see #getRefreshRate |
114 */ |
112 */ |
115 public final static int REFRESH_RATE_UNKNOWN = 0; |
113 @Native public final static int REFRESH_RATE_UNKNOWN = 0; |
116 |
114 |
117 /** |
115 /** |
118 * Returns the refresh rate of the display, in hertz. This may be |
116 * Returns the refresh rate of the display, in hertz. This may be |
119 * <code>REFRESH_RATE_UNKNOWN</code> if the information is not available. |
117 * <code>REFRESH_RATE_UNKNOWN</code> if the information is not available. |
120 * |
118 * |