com.realtime.crossfire.jxclient.util
Class Resolution

java.lang.Object
  extended by com.realtime.crossfire.jxclient.util.Resolution

public class Resolution
extends java.lang.Object

Information about JXClient's screen/window resolution. It consists of a size (width and height) and whether the exact resolution should be used, or if a similar resolution is allowed.


Field Summary
private  int height
          The height in pixel.
private  int width
          The width in pixel.
 
Constructor Summary
Resolution(int width, int height)
          Creates a new instance.
 
Method Summary
 java.awt.Dimension asDimension()
          Returns the resolution as a Dimension instance.
 boolean equals(java.lang.Object obj)
          
 boolean equalsDisplayMode(java.awt.DisplayMode displayMode)
          Returns whether this resolution matches a DisplayMode's resolution.
 int getHeight()
          Returns the height in pixels.
 int getWidth()
          Returns the width in pixels.
 int hashCode()
          
static Resolution parse(java.lang.String str)
          Creates a new instance from string representation.
 java.lang.String toString()
          
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

height

private final int height
The height in pixel.


width

private final int width
The width in pixel.

Constructor Detail

Resolution

public Resolution(int width,
                  int height)
Creates a new instance.

Parameters:
width - the width in pixels
height - the height in pixels
Method Detail

asDimension

@NotNull
public java.awt.Dimension asDimension()
Returns the resolution as a Dimension instance.

Returns:
the dimension instance

equals

public boolean equals(@Nullable
                      java.lang.Object obj)

Overrides:
equals in class java.lang.Object

equalsDisplayMode

public boolean equalsDisplayMode(@NotNull
                                 java.awt.DisplayMode displayMode)
Returns whether this resolution matches a DisplayMode's resolution.

Parameters:
displayMode - the display mode
Returns:
if the resolutions match

getHeight

public int getHeight()
Returns the height in pixels.

Returns:
the height

getWidth

public int getWidth()
Returns the width in pixels.

Returns:
the width

hashCode

public int hashCode()

Overrides:
hashCode in class java.lang.Object

parse

@Nullable
public static Resolution parse(@NotNull
                                        java.lang.String str)
Creates a new instance from string representation. The string representation is of the format "1024x768"; it is the format returned from toString().

Parameters:
str - the string representation
Returns:
the Resolution instance, or null if the string representation is invalid

toString

@NotNull
public java.lang.String toString()

Overrides:
toString in class java.lang.Object