Class Context

java.lang.Object
com.spinyowl.legui.system.context.Context

public class Context extends Object
  • Constructor Details

    • Context

      public Context(long glfwWindow)
      Instantiates a new Context.
      Parameters:
      glfwWindow - the glfw window
  • Method Details

    • setFocusedGui

      public static void setFocusedGui(Component toGainFocus, Context context, Frame frame)
    • isDebugEnabled

      public boolean isDebugEnabled()
      Is debug enabled boolean.
      Returns:
      the boolean
    • setDebugEnabled

      public void setDebugEnabled(boolean debugEnabled)
      Sets debug enabled.
      Parameters:
      debugEnabled - the debug enabled
    • getContextData

      public Map<String,Object> getContextData()
      Gets context data.
      Returns:
      the context data
    • updateGlfwWindow

      public void updateGlfwWindow()
      Update glfw window.
    • update

      public void update(int targetWidth, int targetHeight, int framebufferWidth, int framebufferHeight, int targetPosX, int targetPosY, boolean iconified)
      Update.
      Parameters:
      targetWidth - the target width
      targetHeight - the target height
      framebufferWidth - the framebuffer width
      framebufferHeight - the framebuffer height
      targetPosX - the target pos x
      targetPosY - the target pos y
      iconified - the iconified
    • getPixelRatio

      public float getPixelRatio()
      Gets pixel ratio.
      Returns:
      the pixel ratio
    • setPixelRatio

      public void setPixelRatio(float pixelRatio)
      Sets pixel ratio.
      Parameters:
      pixelRatio - the pixel ratio
    • getGlfwWindow

      public long getGlfwWindow()
      Gets glfw window.
      Returns:
      the glfw window
    • getWindowPosition

      public org.joml.Vector2f getWindowPosition()
      Gets window position.
      Returns:
      the window position
    • setWindowPosition

      public void setWindowPosition(org.joml.Vector2f windowPosition)
      Sets window position.
      Parameters:
      windowPosition - the window position
    • getWindowSize

      public org.joml.Vector2i getWindowSize()
      Gets window size.
      Returns:
      the window size
    • setWindowSize

      public void setWindowSize(org.joml.Vector2i windowSize)
      Sets window size.
      Parameters:
      windowSize - the window size
    • getFramebufferSize

      public org.joml.Vector2i getFramebufferSize()
      Gets framebuffer size.
      Returns:
      the framebuffer size
    • setFramebufferSize

      public void setFramebufferSize(org.joml.Vector2i framebufferSize)
      Sets framebuffer size.
      Parameters:
      framebufferSize - the framebuffer size
    • getFocusedGui

      public Component getFocusedGui()
      Gets focused gui.
      Returns:
      the focused gui
    • setFocusedGui

      public void setFocusedGui(Component focusedGui)
      Sets focused gui.
      Parameters:
      focusedGui - the focused gui
    • getMouseTargetGui

      public Component getMouseTargetGui()
      Returns current mouse target component.
      Returns:
      current mouse target component.
    • setMouseTargetGui

      public void setMouseTargetGui(Component mouseTargetGui)
      Used to update current mouse target component.
      Parameters:
      mouseTargetGui - new mouse target component.
    • isIconified

      public boolean isIconified()
      Returns window iconified state.
      Returns:
      window iconified state.
    • setIconified

      public void setIconified(boolean iconified)
      Used to update state of window (in case of window iconified).
      Parameters:
      iconified - window state.