FileDocCategorySizeDatePackage
GraphicsDevice.javaAPI DocAndroid 1.5 API6143Wed May 06 22:41:54 BST 2009java.awt

GraphicsDevice

public abstract class GraphicsDevice extends Object
The GraphicsDevice class describes the graphics devices (such as screens or printers) which are available in a particular graphics environment. Many GraphicsDevice instances can be associated with a single GraphicsEnvironment. Each GraphicsDevice has one or more GraphicsConfiguration objects which specify the different configurations and modes of GraphicsDevice.
since
Android 1.0

Fields Summary
private DisplayMode
displayMode
The display mode.
public static final int
TYPE_IMAGE_BUFFER
The Constant TYPE_IMAGE_BUFFER indicates a image buffer device.
public static final int
TYPE_PRINTER
The Constant TYPE_PRINTER indicates a printer device.
public static final int
TYPE_RASTER_SCREEN
The Constant TYPE_RASTER_SCREEN indicates a raster screen device.
Constructors Summary
protected GraphicsDevice()
Constructor is not to be used directly as this class is abstract.


                     
      
        displayMode = new DisplayMode(0, 0, DisplayMode.BIT_DEPTH_MULTI,
                DisplayMode.REFRESH_RATE_UNKNOWN);
    
Methods Summary
public intgetAvailableAcceleratedMemory()
Returns the number of bytes available in accelerated memory on this device.

return
the number of bytes available accelerated memory.

        return 0;
    
public abstract java.awt.GraphicsConfiguration[]getConfigurations()
Returns an array of GraphicsConfiguration objects associated with the GraphicsDevice.

return
an array of GraphicsConfiguration objects associated with the GraphicsDevice.

public abstract java.awt.GraphicsConfigurationgetDefaultConfiguration()
Gets the default configuration for the GraphicsDevice.

return
the default GraphicsConfiguration object for the GraphicsDevice.

public java.awt.DisplayModegetDisplayMode()
Gets the current display mode of the GraphicsDevice.

return
the current display mode of the GraphicsDevice.

        return displayMode;
    
public java.awt.DisplayMode[]getDisplayModes()
Gets an array of display modes available in this GraphicsDevice.

return
an array of display modes available in this GraphicsDevice.

        DisplayMode[] dms = {
            displayMode
        };
        return dms;
    
public abstract java.lang.StringgetIDstring()
Gets the String identifier which associated with the GraphicsDevice in the GraphicsEnvironment.

return
the String identifier of the GraphicsDevice in the GraphicsEnvironment.

public abstract intgetType()
Gets the type of this GraphicsDevice: TYPE_IMAGE_BUFFER, TYPE_PRINTER or TYPE_RASTER_SCREEN.

return
the type of this GraphicsDevice: TYPE_IMAGE_BUFFER, TYPE_PRINTER or TYPE_RASTER_SCREEN.

public booleanisDisplayChangeSupported()
Returns true if this GraphicsDevice supports low-level display changes.

return
true, if this GraphicsDevice supports low-level display changes; false otherwise.

        return false;
    
public booleanisFullScreenSupported()
Returns true if this GraphicsDevice supports full screen mode.

return
true, if this GraphicsDevice supports full screen mode, false otherwise.

        return false;
    
public voidsetDisplayMode(java.awt.DisplayMode dm)
Sets the display mode of this GraphicsDevice.

param
dm the new display mode of this GraphicsDevice.

        if (!isDisplayChangeSupported()) {
            // awt.122=Does not support display mode changes
            throw new UnsupportedOperationException(Messages.getString("awt.122")); //$NON-NLS-1$
        }

        DisplayMode[] dms = getDisplayModes();
        for (DisplayMode element : dms) {
            if (element.equals(dm)) {
                displayMode = dm;
                return;
            }
        }
        // awt.123=Unsupported display mode: {0}
        throw new IllegalArgumentException(Messages.getString("awt.123", dm)); //$NON-NLS-1$