Package ch.swingfx.awt
Class GraphicsEnvironmentUtil
- java.lang.Object
-
- ch.swingfx.awt.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.Win32GraphicsEnvironmentstatic boolean
isX11GraphicsEnvironment
java.awt.graphicsenv=sun.awt.X11GraphicsEnvironmentstatic 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.
-
Constructor Summary
Constructors Modifier Constructor Description private
GraphicsEnvironmentUtil()
-
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
-
-
-
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
-
-
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
-
-