Class Window

java.lang.Object
xyz.gmitch215.socketmc.retriever.Window
All Implemented Interfaces:
Serializable

public final class Window extends Object implements Serializable
Utility class to represent the client's window information.
See Also:
  • Constructor Summary

    Constructors
    Constructor
    Description
    Creates a new, empty window.
    Window(long id, boolean fullscreen, int x, int y, int width, int height, int screenWidth, int screenHeight, int guiScaledWidth, int guiScaledHeight, double guiScale, int framerateLimit, String platform, int refreshRate)
    Creates a new window with the specified parameters.
  • Method Summary

    Modifier and Type
    Method
    Description
    int
    Gets the framerate limit of the window.
    double
    Gets the GUI scale of the window.
    int
    Gets the height of the window, scaled by the GUI.
    int
    Gets the width of the window, scaled by the GUI.
    int
    Gets the height of the window.
    long
    Gets the window ID.
    Gets the platform this window is currently using.
    int
    Gets the refresh rate (in Hz) for the window.
    int
    Gets the height of the screen.
    int
    Gets the width of the screen.
    int
    Gets the width of the window.
    int
    Gets the x position of the window.
    int
    Gets the y position of the window.
    boolean
    Gets whether the window is in fullscreen mode.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • Window

      public Window()
      Creates a new, empty window.
    • Window

      public Window(long id, boolean fullscreen, int x, int y, int width, int height, int screenWidth, int screenHeight, int guiScaledWidth, int guiScaledHeight, double guiScale, int framerateLimit, String platform, int refreshRate)
      Creates a new window with the specified parameters.
      Parameters:
      id - Window ID
      fullscreen - Fullscreen Mode
      x - X Position
      y - Y Position
      width - Width
      height - Height
      screenWidth - Screen Width
      screenHeight - Screen Height
      guiScaledWidth - GUI Scaled Width
      guiScaledHeight - GUI Scaled Height
      guiScale - GUI Scale
      framerateLimit - Framerate Limit
      platform - Window Platform
      refreshRate - Refresh Rate
  • Method Details

    • getId

      public long getId()
      Gets the window ID.
      Returns:
      Window ID
    • isFullscreen

      public boolean isFullscreen()
      Gets whether the window is in fullscreen mode.
      Returns:
      True if the window is in fullscreen mode, false otherwise.
    • getX

      public int getX()
      Gets the x position of the window.
      Returns:
      Window X Position
    • getY

      public int getY()
      Gets the y position of the window.
      Returns:
      Window Y Position
    • getWidth

      public int getWidth()
      Gets the width of the window.
      Returns:
      Window Width
    • getHeight

      public int getHeight()
      Gets the height of the window.
      Returns:
      Window Height
    • getScreenWidth

      public int getScreenWidth()
      Gets the width of the screen.
      Returns:
      Screen Width
    • getScreenHeight

      public int getScreenHeight()
      Gets the height of the screen.
      Returns:
      Screen Height
    • getGuiScaledWidth

      public int getGuiScaledWidth()
      Gets the width of the window, scaled by the GUI.
      Returns:
      GUI Scaled Width
    • getGuiScaledHeight

      public int getGuiScaledHeight()
      Gets the height of the window, scaled by the GUI.
      Returns:
      GUI Scaled Height
    • getGuiScale

      public double getGuiScale()
      Gets the GUI scale of the window.
      Returns:
      GUI Scale
    • getFramerateLimit

      public int getFramerateLimit()
      Gets the framerate limit of the window.
      Returns:
      Framerate Limit
    • getPlatform

      public String getPlatform()

      Gets the platform this window is currently using.

      Some potential values are:

      • win32 if on Windows
      • cocoa if on macOS
      • x11 or wayland if on Unix
      • null if inaccessible
      • <error> if can't fetch the value
      • unknown if not using a generally known windows API
      Returns:
      Window Platform
    • getRefreshRate

      public int getRefreshRate()
      Gets the refresh rate (in Hz) for the window.
      Returns:
      Refresh Rate