Class Resolution
java.lang.Object
com.realtime.crossfire.jxclient.util.Resolution
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.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription@NotNull DimensionReturns the resolution as aDimensioninstance.booleanbooleanequalsDisplayMode(@NotNull DisplayMode displayMode) Returns whether this resolution matches aDisplayMode's resolution.intReturns the height in pixels.intgetWidth()Returns the width in pixels.inthashCode()static @Nullable ResolutionCreates a new instance from string representation.@NotNull StringtoString()
-
Constructor Details
-
Resolution
public Resolution(int width, int height) Creates a new instance.- Parameters:
width- the width in pixelsheight- the height in pixels
-
-
Method Details
-
parse
Creates a new instance from string representation. The string representation is of the format "1024x768"; it is the format returned fromtoString().- Parameters:
str- the string representation- Returns:
- the
Resolution instance, ornullif the string representation is invalid
-
getWidth
public int getWidth()Returns the width in pixels.- Returns:
- the width
-
getHeight
public int getHeight()Returns the height in pixels.- Returns:
- the height
-
equalsDisplayMode
Returns whether this resolution matches aDisplayMode's resolution.- Parameters:
displayMode- the display mode- Returns:
- if the resolutions match
-
equals
-
hashCode
public int hashCode() -
toString
-
asDimension
Returns the resolution as aDimensioninstance.- Returns:
- the dimension instance
-