Class Resolution

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

public class Resolution extends 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.
  • Constructor Details

    • Resolution

      public Resolution(int width, int height)
      Creates a new instance.
      Parameters:
      width - the width in pixels
      height - the height in pixels
  • Method Details

    • parse

      @Nullable public static @Nullable Resolution parse(@NotNull @NotNull 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
    • 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 DisplayMode displayMode)
      Returns whether this resolution matches a DisplayMode's resolution.
      Parameters:
      displayMode - the display mode
      Returns:
      if the resolutions match
    • equals

      public boolean equals(@Nullable @Nullable Object obj)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • toString

      @NotNull public @NotNull String toString()
      Overrides:
      toString in class Object
    • asDimension

      @NotNull public @NotNull Dimension asDimension()
      Returns the resolution as a Dimension instance.
      Returns:
      the dimension instance