Class GraphicsEnvironmentUtil


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

      Fields 
      Modifier and Type Field Description
      static boolean isCGraphicsEnvironment
      java.awt.graphicsenv=apple.awt.CGraphicsEnvironment (OS X)
      static boolean isWin32GraphicsEnvironment
      java.awt.graphicsenv=sun.awt.Win32GraphicsEnvironment
      static boolean isX11GraphicsEnvironment
      java.awt.graphicsenv=sun.awt.X11GraphicsEnvironment
      static java.awt.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.
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static java.awt.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
      • Methods inherited from class java.lang.Object

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

      • OSX_MENU_BAR_SCREEN_INSETS

        public static final java.awt.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 Detail

      • GraphicsEnvironmentUtil

        private GraphicsEnvironmentUtil()
    • Method Detail

      • getX11RootNetWorkarea

        public static java.awt.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