com.levigo.jadice.document.util
Class GraphicsEnvironment

java.lang.Object
  extended by 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
GraphicsEnvironment()
           
 
Method Summary
static GraphicsConfiguration getGraphicsConfiguration(Point point)
          Returns the GraphicsConfiguration 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 from Toolkit.getScreenResolution().
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GraphicsEnvironment

public GraphicsEnvironment()
Method Detail

getScreenResolution

public static final int getScreenResolution()
Returns the screen resolution in dots-per-inch. Therefore Toolkit.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 via setUserDefinedScreenResolution(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 from Toolkit.getScreenResolution(). If set to zero or a negative value, the default resolution as provided by Toolkit.getScreenResolution() will be used.

Parameters:
resolution -

getSystemClipboard

public static final Clipboard getSystemClipboard()
Gets the system clipboard which interfaces with clipboard facilities provided by the native platform. In contrast to calling Toolkit.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 the GraphicsConfiguration object which belongs to the given point. If the given point is null the GraphicsConfiguration of the default screen will be returned.

Parameters:
point - look up point
Returns:
the GraphicsConfiguration object which belongs to the given or null if the point is null


Copyright © 1995-2020 levigo holding gmbh. All Rights Reserved.