Java Platform 1.2
Beta 4

Class java.awt.GraphicsConfiguration

java.lang.Object
  |
  +--java.awt.GraphicsConfiguration

public abstract class GraphicsConfiguration
extends Object
This class describes the characteristics of a graphics destination such as a printer or monitor. There can be many GraphicsConfiguration objects associated with a single graphics device. For instance, on X11 windowing systems, each visual is a different GraphicsConfiguration. On PCs and Macintoshes, the different screen resolution/color resolution combinations would be different GraphicsConfigurations.

See Also:
GraphicsEnvironment, GraphicsDevice

Constructor Summary
GraphicsConfiguration()
          This is an abstract class that cannot be instantiated directly.
 
Method Summary
abstract  BufferedImage createCompatibleImage(int width, int height, int transparency)
          Returns a BufferedImage that supports the specified transparency and has data layout and color model compatible with this graphics configuration.
abstract  BufferedImage createCompatibleImage(int width, int height)
          Returns a BufferedImage with data layout and color model compatible with this graphics configuration.
abstract  ColorModel getColorModel()
          Returns the color model associated with this configuration.
abstract  ColorModel getColorModel(int transparency)
          Returns the color model associated with this configuration that supports the specified transparency.
abstract  AffineTransform getDefaultTransform()
          Returns the default Transform for this configuration.
abstract  GraphicsDevice getDevice()
          Return the graphics device associated with this configuration.
abstract  AffineTransform getNormalizingTransform()
          Returns a Transform that can be concatenated with the default Transform of a GraphicsConfiguration so that 72 units in user space will equal 1 inch in device space.
 
Methods inherited from class java.lang.Object
clone , equals , finalize , getClass , hashCode , notify , notifyAll , toString , wait , wait , wait
 

Constructor Detail

GraphicsConfiguration

protected GraphicsConfiguration()
This is an abstract class that cannot be instantiated directly. Instances must be obtained from a suitable factory or query method.
See Also:
GraphicsDevice.getConfigurations(), GraphicsDevice.getDefaultConfiguration(), GraphicsDevice.getBestConfiguration(java.awt.GraphicsConfigTemplate), Graphics2D.getDeviceConfiguration()
Method Detail

getDevice

public abstract GraphicsDevice getDevice()
Return the graphics device associated with this configuration.

createCompatibleImage

public abstract BufferedImage createCompatibleImage(int width,
                                                    int height)
Returns a BufferedImage with data layout and color model compatible with this graphics configuration. This method has nothing to do with memory-mapping a device. This BufferedImage has a layout and color model that is closest to this native device configuration and thus can be optimally blitted to this device.

createCompatibleImage

public abstract BufferedImage createCompatibleImage(int width,
                                                    int height,
                                                    int transparency)
Returns a BufferedImage that supports the specified transparency and has data layout and color model compatible with this graphics configuration. This method has nothing to do with memory-mapping a device. This BufferedImage has a layout and color model that can be optimally blitted to a device with this configuration.
See Also:
Transparency.OPAQUE, Transparency.BITMASK, Transparency.TRANSLUCENT

getColorModel

public abstract ColorModel getColorModel()
Returns the color model associated with this configuration.

getColorModel

public abstract ColorModel getColorModel(int transparency)
Returns the color model associated with this configuration that supports the specified transparency.

getDefaultTransform

public abstract AffineTransform getDefaultTransform()
Returns the default Transform for this configuration. This Transform is typically the Identity transform for most normal screens. Device coordinates for screen and printer devices will have the origin in the upper left-hand corner of the target region of the device, with X coordinates increasing to the right and Y coordinates increasing downwards. For image buffers not associated with a device (e.g. not created by GraphicsConfiguration.createCompatibleImage()), this Transform will be the Identity transform.

getNormalizingTransform

public abstract AffineTransform getNormalizingTransform()
Returns a Transform that can be concatenated with the default Transform of a GraphicsConfiguration so that 72 units in user space will equal 1 inch in device space. Given a Graphics2D, g, one can reset the transformation to create such a mapping by using the following pseudocode:
      GraphicsConfiguration gc = g.getGraphicsConfiguration();

      g.setTransform(gc.getDefaultTransform());
      g.transform(gc.getNormalizingTransform());
 
Note that sometimes this Transform will be identity (e.g. for printers or metafile output) and that this Transform is only as accurate as the information supplied by the underlying system. For image buffers not associated with a device (e.g. not created by GraphicsConfiguration.createCompatibleImage()), this Transform will be the Identity transform since there is no valid distance measurement.

Java Platform 1.2
Beta 4

Submit a bug or feature
Submit comments/suggestions about new javadoc look
Java is a trademark or registered trademark of Sun Microsystems, Inc. in the US and other countries.
Copyright 1993-1998 Sun Microsystems, Inc. 901 San Antonio Road,
Palo Alto, California, 94303, U.S.A. All Rights Reserved.
This documentation was generated with a post-Beta4 version of Javadoc.