Class 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.
    • 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.Dimension asDimension()
      Returns the resolution as a Dimension instance.
      boolean equals​(@Nullable java.lang.Object obj)  
      boolean equalsDisplayMode​(@NotNull 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 @Nullable Resolution parse​(@NotNull java.lang.String str)
      Creates a new instance from string representation.
      @NotNull java.lang.String toString()  
      • Methods inherited from class java.lang.Object

        clone, finalize, getClass, notify, notifyAll, wait, wait, wait
    • 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

      • 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 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 java.awt.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 java.lang.Object obj)
        Overrides:
        equals in class java.lang.Object
      • hashCode

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

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

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