Class Resolution
- java.lang.Object
-
- com.realtime.crossfire.jxclient.util.Resolution
-
public class Resolution extends java.lang.ObjectInformation 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 Constructor Description Resolution(int width, int height)Creates a new instance.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description @NotNull java.awt.DimensionasDimension()Returns the resolution as aDimensioninstance.booleanequals(@Nullable java.lang.Object obj)booleanequalsDisplayMode(@NotNull java.awt.DisplayMode displayMode)Returns whether this resolution matches aDisplayMode's resolution.intgetHeight()Returns the height in pixels.intgetWidth()Returns the width in pixels.inthashCode()static @Nullable Resolutionparse(@NotNull java.lang.String str)Creates a new instance from string representation.@NotNull java.lang.StringtoString()
-
-
-
Method Detail
-
parse
@Nullable public static @Nullable Resolution parse(@NotNull @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 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
public boolean equalsDisplayMode(@NotNull @NotNull java.awt.DisplayMode displayMode)Returns whether this resolution matches aDisplayMode's resolution.- Parameters:
displayMode- the display mode- Returns:
- if the resolutions match
-
equals
public boolean equals(@Nullable @Nullable java.lang.Object obj)- Overrides:
equalsin classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
toString
@NotNull public @NotNull java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
asDimension
@NotNull public @NotNull java.awt.Dimension asDimension()
Returns the resolution as aDimensioninstance.- Returns:
- the dimension instance
-
-