DisplayModepublic final class DisplayMode extends Object The DisplayMode class encapsulates the bit depth, height,
width, and refresh rate of a GraphicsDevice . Display modes
are hardware-dependent and may not always be available. |
Fields Summary |
---|
private Dimension | size | private int | bitDepth | private int | refreshRate | public static final int | BIT_DEPTH_MULTIValue of the bit depth if multiple bit depths are supported in this
dislay mode. | public static final int | REFRESH_RATE_UNKNOWNValue of the refresh rate if not known |
Constructors Summary |
---|
public DisplayMode(int width, int height, int bitDepth, int refreshRate)Create a new display mode object with the supplied parameters.
this.size = new Dimension(width, height);
this.bitDepth = bitDepth;
this.refreshRate = refreshRate;
|
Methods Summary |
---|
public boolean | equals(java.awt.DisplayMode dm)
if (dm == null) {
return false;
}
return (getHeight() == dm.getHeight()
&& getWidth() == dm.getWidth()
&& getBitDepth() == dm.getBitDepth()
&& getRefreshRate() == dm.getRefreshRate());
| public boolean | equals(java.lang.Object dm)
if (dm instanceof DisplayMode) {
return equals((DisplayMode)dm);
} else {
return false;
}
| public int | getBitDepth()
return bitDepth;
| public int | getHeight()
return size.height;
| public int | getRefreshRate()
return refreshRate;
| public int | getWidth()
return size.width;
| public int | hashCode()
return getWidth() + getHeight() + getBitDepth() * 7
+ getRefreshRate() * 13;
|
|