java.awt

Class DisplayMode

public final class DisplayMode extends Object

This encapsulates information about the display mode for a graphics device configuration. They are device dependent, and may not always be available.

Since: 1.4

See Also: GraphicsDevice

UNKNOWN: updated to 1.4

Field Summary
static intBIT_DEPTH_MULTI
Value of the bit depth if multiple depths are supported.
static intREFRESH_RATE_UNKNOWN
Value of an unknown refresh rate.
Constructor Summary
DisplayMode(int width, int height, int bitDepth, int refreshRate)
Create a mode with the given parameters.
Method Summary
booleanequals(DisplayMode dm)
Test for equality.
intgetBitDepth()
Returns the bit depth, in bits per pixel.
intgetHeight()
Returns the height, in pixels.
intgetRefreshRate()
Returns the refresh rate, in hertz.
intgetWidth()
Returns the width, in pixels.
inthashCode()
Returns a hash code for the display mode.

Field Detail

BIT_DEPTH_MULTI

public static final int BIT_DEPTH_MULTI
Value of the bit depth if multiple depths are supported.

See Also: getBitDepth

REFRESH_RATE_UNKNOWN

public static final int REFRESH_RATE_UNKNOWN
Value of an unknown refresh rate.

See Also: getRefreshRate

Constructor Detail

DisplayMode

public DisplayMode(int width, int height, int bitDepth, int refreshRate)
Create a mode with the given parameters.

Parameters: width the width height the height bitDepth the bitDepth refreshRate the refreshRate

See Also: BIT_DEPTH_MULTI REFRESH_RATE_UNKNOWN

Method Detail

equals

public boolean equals(DisplayMode dm)
Test for equality. This returns true for two modes with identical parameters.

Parameters: dm The display mode to compare to

Returns: true if it is equal

getBitDepth

public int getBitDepth()
Returns the bit depth, in bits per pixel. This may be BIT_DEPTH_MULTI.

Returns: the bit depth

See Also: BIT_DEPTH_MULTI

getHeight

public int getHeight()
Returns the height, in pixels.

Returns: the height

getRefreshRate

public int getRefreshRate()
Returns the refresh rate, in hertz. This may be REFRESH_RATE_UNKNOWN.

Returns: the refresh rate

See Also: REFRESH_RATE_UNKNOWN

getWidth

public int getWidth()
Returns the width, in pixels.

Returns: the width

hashCode

public int hashCode()
Returns a hash code for the display mode.

Returns: the hash code