Package com.levigo.jadice.document.util
Class GraphicsEnvironment
- java.lang.Object
-
- com.levigo.jadice.document.util.GraphicsEnvironment
-
public final class GraphicsEnvironment extends Object
GraphicsEnvironment is a utility class to provide different informations about the graphics environment.
-
-
Constructor Summary
Constructors Constructor Description GraphicsEnvironment()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static GraphicsConfiguration
getGraphicsConfiguration(Point point)
Returns theGraphicsConfiguration
object which belongs to the given point.static int
getScreenResolution()
Returns the screen resolution in dots-per-inch.static Clipboard
getSystemClipboard()
Gets the system clipboard which interfaces with clipboard facilities provided by the native platform.static boolean
isSystemClipboardAccessible()
Returns an indicator whether system clipboard is accessible.static void
setUserDefinedScreenResolution(int resolution)
Set a user-defined resolution in dots-per-inch to be used for all sizing-calculations instead of the resolution returned fromToolkit.getScreenResolution()
.
-
-
-
Method Detail
-
getScreenResolution
public static final int getScreenResolution()
Returns the screen resolution in dots-per-inch. ThereforeToolkit.getScreenResolution()
is used. If the graphics environment is headless, a default value of 72 will be returned. If a user-defined resolution has been set to a positive value viasetUserDefinedScreenResolution(int)
, this value will be used instead.- Returns:
- this toolkit's screen resolution in dots-per-inch, a user-defined resolution or in headless mode 72 as default value.
-
setUserDefinedScreenResolution
public static final void setUserDefinedScreenResolution(int resolution)
Set a user-defined resolution in dots-per-inch to be used for all sizing-calculations instead of the resolution returned fromToolkit.getScreenResolution()
. If set to zero or a negative value, the default resolution as provided byToolkit.getScreenResolution()
will be used.
-
getSystemClipboard
public static final Clipboard getSystemClipboard()
Gets the system clipboard which interfaces with clipboard facilities provided by the native platform. In contrast to callingToolkit.getSystemClipboard()
this method will not throw an exception if GraphicsEnvironment.isHeadless().- Returns:
- the system clipboard
-
isSystemClipboardAccessible
public static final boolean isSystemClipboardAccessible()
Returns an indicator whether system clipboard is accessible.- Returns:
- boolean accessibility
-
getGraphicsConfiguration
public static final GraphicsConfiguration getGraphicsConfiguration(Point point)
Returns theGraphicsConfiguration
object which belongs to the given point. If the given point isnull
the GraphicsConfiguration of the default screen will be returned.- Parameters:
point
- look up point- Returns:
- the
GraphicsConfiguration
object which belongs to the given ornull
if the point isnull
-
-