APIdia Launch Partner
Top Description Fields Constructors Methods
sun.awt

public final Class X11GraphicsEnvironment

extends SunGraphicsEnvironment
Class Inheritance
Imports
java.awt.AWTError, .GraphicsDevice, java.lang.ref.WeakReference, java.net.InetAddress, .NetworkInterface, .SocketException, .UnknownHostException, java.util.ArrayList, .Enumeration, .HashMap, .List, .ListIterator, .Map, sun.awt.X11.XToolkit, sun.java2d.SunGraphicsEnvironment, sun.java2d.xr.XRSurfaceData

This is an implementation of a GraphicsEnvironment object for the default local GraphicsEnvironment used by the Java Runtime Environment for X11 environments.
See Also
GraphicsDevice, java.awt.GraphicsConfiguration

Field Summary

Modifier and TypeField and Description
private final Map<Integer, X11GraphicsDevice>
devices

Available X11 screens.

private static boolean
private static boolean
private Boolean
private int
mainScreen

The key in the devices for the main screen.

private List<WeakReference<X11GraphicsDevice>>
private static boolean
private static boolean
Inherited from sun.java2d.SunGraphicsEnvironment:
displayChangerscreens

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
private static boolean
private static native int
checkShmExt()

Checks if Shared Memory extension can be used.

public String
getDefaultFontFaceName()

Returns face name for default font, or null if no face names are used for CompositeFontDescriptors for this platform.

public synchronized GraphicsDevice
getDefaultScreenDevice()

Overrides sun.java2d.SunGraphicsEnvironment.getDefaultScreenDevice.

Returns the default screen graphics device.

private native int
private static native String
protected native int
getNumScreens()

Implements abstract sun.java2d.SunGraphicsEnvironment.getNumScreens.

Returns the number of screen devices of this graphics environment.

public synchronized GraphicsDevice
getScreenDevice(int screen)

public synchronized GraphicsDevice[]
getScreenDevices()

Overrides sun.java2d.SunGraphicsEnvironment.getScreenDevices.

Returns an array of all of the screen devices.

private synchronized void
initDevices()

(Re)create all X11GraphicsDevices, reuses a devices if it is possible.

private static native void
initDisplay(boolean glxRequested)

This should only be called from the static initializer, so no need for the synchronized keyword.

private static native boolean
private static native void
initNativeData()

Initialize the native list of devices.

private static void
private static native boolean
initXRender(boolean verbose, boolean ignoreLinuxVersion)

public boolean
isDisplayLocal()

Implements abstract sun.java2d.SunGraphicsEnvironment.isDisplayLocal.

Returns true when the display is local, false for remote displays.

public static boolean
public static boolean
public static boolean
public static boolean
protected GraphicsDevice
makeScreenDevice(int screennum)

Implements abstract sun.java2d.SunGraphicsEnvironment.makeScreenDevice.

Create and return the screen device with the specified number.

public void
paletteChanged()

Overrides sun.java2d.SunGraphicsEnvironment.paletteChanged.

Implements sun.awt.DisplayChangedListener.paletteChanged.

From the DisplayChangedListener interface; devices do not need to react to this event.

private static native boolean
public void
rebuildDevices()

Updates the list of devices and notify listeners.

public boolean
Inherited from sun.java2d.SunGraphicsEnvironment:
addDisplayChangedListenercreateGraphicsdisplayChangedgetAllFontsgetAvailableFontFamilyNamesgetAvailableFontFamilyNamesgetDebugScalegetFontManagerForSGEgetGCDeviceBoundsgetGraphicsConfigurationAtPointgetScaleFactorgetUsableBoundsisFlipStrategyPreferredisUIScaleEnabledremoveDisplayChangedListenertoDeviceSpacetoDeviceSpacetoDeviceSpaceAbstoDeviceSpaceAbstoDeviceSpaceAbstoUserSpaceuseAlternateFontforJALocales

Field Detail

devicesback to summary
private final Map<Integer, X11GraphicsDevice> devices

Available X11 screens.

glxAvailableback to summary
private static boolean glxAvailable
glxVerboseback to summary
private static boolean glxVerbose
isDisplayLocalback to summary
private Boolean isDisplayLocal
mainScreenback to summary
private int mainScreen

The key in the devices for the main screen.

oldDevicesback to summary
private List<WeakReference<X11GraphicsDevice>> oldDevices
xRenderAvailableback to summary
private static boolean xRenderAvailable
xRenderVerboseback to summary
private static boolean xRenderVerbose

Constructor Detail

X11GraphicsEnvironmentback to summary
public X11GraphicsEnvironment()

Method Detail

_isDisplayLocalback to summary
private static boolean _isDisplayLocal()
checkShmExtback to summary
private static native int checkShmExt()

Checks if Shared Memory extension can be used. Returns: -1 if server doesn't support MITShm 1 if server supports it and it can be used 0 otherwise

getDefaultFontFaceNameback to summary
public String getDefaultFontFaceName()

Returns face name for default font, or null if no face names are used for CompositeFontDescriptors for this platform.

getDefaultScreenDeviceback to summary
public synchronized GraphicsDevice getDefaultScreenDevice()

Overrides sun.java2d.SunGraphicsEnvironment.getDefaultScreenDevice.

Doc from sun.java2d.SunGraphicsEnvironment.getDefaultScreenDevice.

Returns the default screen graphics device.

Annotations
@Override
getDefaultScreenNumback to summary
private native int getDefaultScreenNum()
getDisplayStringback to summary
private static native String getDisplayString()
getNumScreensback to summary
protected native int getNumScreens()

Implements abstract sun.java2d.SunGraphicsEnvironment.getNumScreens.

Doc from sun.java2d.SunGraphicsEnvironment.getNumScreens.

Returns the number of screen devices of this graphics environment.

Annotations
@Override
getScreenDeviceback to summary
public synchronized GraphicsDevice getScreenDevice(int screen)
getScreenDevicesback to summary
public synchronized GraphicsDevice[] getScreenDevices()

Overrides sun.java2d.SunGraphicsEnvironment.getScreenDevices.

Doc from sun.java2d.SunGraphicsEnvironment.getScreenDevices.

Returns an array of all of the screen devices.

Annotations
@Override
initDevicesback to summary
private synchronized void initDevices()

(Re)create all X11GraphicsDevices, reuses a devices if it is possible.

initDisplayback to summary
private static native void initDisplay(boolean glxRequested)

This should only be called from the static initializer, so no need for the synchronized keyword.

initGLXback to summary
private static native boolean initGLX()
initNativeDataback to summary
private static native void initNativeData()

Initialize the native list of devices.

initStaticback to summary
private static void initStatic()
Annotations
@SuppressWarnings:restricted
initXRenderback to summary
private static native boolean initXRender(boolean verbose, boolean ignoreLinuxVersion)
isDisplayLocalback to summary
public boolean isDisplayLocal()

Implements abstract sun.java2d.SunGraphicsEnvironment.isDisplayLocal.

Doc from sun.java2d.SunGraphicsEnvironment.isDisplayLocal.

Returns true when the display is local, false for remote displays.

Annotations
@Override
isGLXAvailableback to summary
public static boolean isGLXAvailable()
isGLXVerboseback to summary
public static boolean isGLXVerbose()
isXRenderAvailableback to summary
public static boolean isXRenderAvailable()
isXRenderVerboseback to summary
public static boolean isXRenderVerbose()
makeScreenDeviceback to summary
protected GraphicsDevice makeScreenDevice(int screennum)

Implements abstract sun.java2d.SunGraphicsEnvironment.makeScreenDevice.

Doc from sun.java2d.SunGraphicsEnvironment.makeScreenDevice.

Create and return the screen device with the specified number. The device with number 0 will be the default device (returned by getDefaultScreenDevice().

Annotations
@Override
paletteChangedback to summary
public void paletteChanged()

Overrides sun.java2d.SunGraphicsEnvironment.paletteChanged.

Implements sun.awt.DisplayChangedListener.paletteChanged.

From the DisplayChangedListener interface; devices do not need to react to this event.

Annotations
@Override
pRunningXineramaback to summary
private static native boolean pRunningXinerama()
rebuildDevicesback to summary
public void rebuildDevices()

Updates the list of devices and notify listeners.

runningXineramaback to summary
public boolean runningXinerama()