java.awt
Class DisplayMode

java.lang.Object
  extended by java.awt.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

Field Summary
static int BIT_DEPTH_MULTI
          Value of the bit depth if multiple depths are supported.
static int REFRESH_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
 boolean equals(DisplayMode dm)
          Test for equality.
 int getBitDepth()
          Returns the bit depth, in bits per pixel.
 int getHeight()
          Returns the height, in pixels.
 int getRefreshRate()
          Returns the refresh rate, in hertz.
 int getWidth()
          Returns the width, in pixels.
 int hashCode()
          Returns a hash code for the display mode.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

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(), Constant Field Values

REFRESH_RATE_UNKNOWN

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

See Also:
getRefreshRate(), Constant Field Values
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

getHeight

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

Returns:
the height

getWidth

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

Returns:
the width

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

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

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

hashCode

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

Overrides:
hashCode in class Object
Returns:
the hash code
See Also:
Object.equals(Object), System.identityHashCode(Object)