DisplayMode class encapsulates the bit depth, height,
width, and refresh rate of a GraphicsDevice. The ability to
change graphics device's display mode is platform- and
configuration-dependent and may not always be available
(see GraphicsDevice#isDisplayChangeSupported).
For more information on full-screen exclusive mode API, see the Full-Screen Exclusive Mode API Tutorial.
GraphicsDevice, GraphicsDevice#isDisplayChangeSupported, GraphicsDevice#getDisplayModes, GraphicsDevice#setDisplayMode
| Modifier and Type | Field and Description |
|---|---|
| public static final int | BIT_DEPTH_MULTI
Value of the bit depth if multiple bit depths are supported in this display mode. |
| private int | |
| public static final int | REFRESH_RATE_UNKNOWN
Value of the refresh rate if not known. |
| private int | |
| private Dimension |
| Access | Constructor and Description |
|---|---|
| public | DisplayMode(int
the width of the display, in pixels width, int the height of the display, in pixels height, int the bit depth of the display, in bits per
pixel. This can be bitDepth, int BIT_DEPTH_MULTI if multiple
bit depths are available.the refresh rate of the display, in hertz.
This can be refreshRate)REFRESH_RATE_UNKNOWN if the
information is not available.Create a new display mode object with the supplied parameters. |
| Modifier and Type | Method and Description |
|---|---|
| public boolean | Returns: whether the two display modes are equalthe display mode to compare to dm)Returns whether the two display modes are equal. |
| public boolean | equals(Object dm)
Overrides java. Indicates whether some other object is "equal to" this one. |
| public int | Returns: the bit depth of the display, in bits per pixel.Returns the bit depth of the display, in bits per pixel. |
| public int | Returns: the height of the display, in pixelsReturns the height of the display, in pixels. |
| public int | Returns: the refresh rate of the display, in hertz.Returns the refresh rate of the display, in hertz. |
| public int | |
| public int | |
| public String |
| BIT_DEPTH_MULTI | back to summary |
|---|---|
| public static final int BIT_DEPTH_MULTI Value of the bit depth if multiple bit depths are supported in this display mode.
| |
| bitDepth | back to summary |
|---|---|
| private int bitDepth | |
| REFRESH_RATE_UNKNOWN | back to summary |
|---|---|
| public static final int REFRESH_RATE_UNKNOWN Value of the refresh rate if not known.
| |
| refreshRate | back to summary |
|---|---|
| private int refreshRate | |
| size | back to summary |
|---|---|
| private Dimension size | |
| DisplayMode | back to summary |
|---|---|
| public DisplayMode(int width, int height, int bitDepth, int refreshRate) Create a new display mode object with the supplied parameters.
| |
| equals | back to summary |
|---|---|
| public boolean equals(DisplayMode dm) Returns whether the two display modes are equal.
| |
| equals | back to summary |
|---|---|
| public boolean equals(Object dm) Overrides java. Doc from java. Indicates whether some other object is "equal to" this one.
The
An equivalence relation partitions the elements it operates on into equivalence classes; all the members of an equivalence class are equal to each other. Members of an equivalence class are substitutable for each other, at least for some purposes.
| |
| getBitDepth | back to summary |
|---|---|
| public int getBitDepth() Returns the bit depth of the display, in bits per pixel. This may be
| |
| getHeight | back to summary |
|---|---|
| public int getHeight() Returns the height of the display, in pixels.
| |
| getRefreshRate | back to summary |
|---|---|
| public int getRefreshRate() Returns the refresh rate of the display, in hertz. This may be
| |
| getWidth | back to summary |
|---|---|
| public int getWidth() Returns the width of the display, in pixels.
| |
| hashCode | back to summary |
|---|---|
| public int hashCode() Overrides java. Doc from java. Returns a hash code value for this object. This method is
supported for the benefit of hash tables such as those provided by
The general contract of
| |
| toString | back to summary |
|---|---|
| public String toString() Overrides java. Doc from java. Returns a string representation of the object.
Satisfying this method's contract implies a non-
| |