Class GraphicsEnvironmentUtil

java.lang.Object
ch.swingfx.awt.GraphicsEnvironmentUtil

public final class GraphicsEnvironmentUtil extends Object
Utility to help in OS specific graphics environment tasks.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final boolean
    java.awt.graphicsenv=apple.awt.CGraphicsEnvironment (OS X)
    static final boolean
    java.awt.graphicsenv=sun.awt.Win32GraphicsEnvironment
    static final boolean
    java.awt.graphicsenv=sun.awt.X11GraphicsEnvironment
    static final Insets
    Depending on the JRE Toolkit.getScreenInsets() doesn't always work on OS X.
    Because the menu bar is always 22 we can provide the screen insets for the screen with the menu bar in this constant.
  • Constructor Summary

    Constructors
    Modifier
    Constructor
    Description
    private
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static Rectangle
    Get the x11 net workarea from a call to
    xprop -root -notype _NET_WORKAREA
    On some systems (jvms) we can not get the real screen insets so we read _NET_WORKAREA from the command line.
    The output is translated to an Rectangle Output: _NET_WORKAREA = 0, 0, 1680, 1025 Rectangle: x, y, width, height

    Methods inherited from class java.lang.Object

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

    • OSX_MENU_BAR_SCREEN_INSETS

      public static final Insets OSX_MENU_BAR_SCREEN_INSETS
      Depending on the JRE Toolkit.getScreenInsets() doesn't always work on OS X.
      Because the menu bar is always 22 we can provide the screen insets for the screen with the menu bar in this constant.
    • isX11GraphicsEnvironment

      public static final boolean isX11GraphicsEnvironment
      java.awt.graphicsenv=sun.awt.X11GraphicsEnvironment
    • isCGraphicsEnvironment

      public static final boolean isCGraphicsEnvironment
      java.awt.graphicsenv=apple.awt.CGraphicsEnvironment (OS X)
    • isWin32GraphicsEnvironment

      public static final boolean isWin32GraphicsEnvironment
      java.awt.graphicsenv=sun.awt.Win32GraphicsEnvironment
  • Constructor Details

    • GraphicsEnvironmentUtil

      private GraphicsEnvironmentUtil()
  • Method Details

    • getX11RootNetWorkarea

      public static Rectangle getX11RootNetWorkarea()
      Get the x11 net workarea from a call to
      xprop -root -notype _NET_WORKAREA
      On some systems (jvms) we can not get the real screen insets so we read _NET_WORKAREA from the command line.
      The output is translated to an Rectangle Output: _NET_WORKAREA = 0, 0, 1680, 1025 Rectangle: x, y, width, height
      Returns:
      the x11 net workarea or null if we can't read it