Spec-Zone .ru
спецификации, руководства, описания, API
JavaTM 2 Platform
Standard Edition

java.awt
Class GraphicsConfiguration

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

public abstract class GraphicsConfiguration
extends Object

The GraphicsConfiguration 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 example, on X11 windowing systems, each visual is a different GraphicsConfiguration. On PCs and Macintoshes, the different screen resolution/color resolution combinations would be different GraphicsConfiguration objects.

See Also:
GraphicsEnvironment, GraphicsDevice

Constructor Summary
protected GraphicsConfiguration()
          This is an abstract class that cannot be instantiated directly.
 
Method Summary
abstract  BufferedImage createCompatibleImage(int width, int height)
          Returns a BufferedImage with a data layout and color model compatible with this GraphicsConfiguration.
abstract  BufferedImage createCompatibleImage(int width, int height, int transparency)
          Returns a BufferedImage that supports the specified transparency and has a data layout and color model compatible with this GraphicsConfiguration.
abstract  ColorModel getColorModel()
          Returns the ColorModel associated with this GraphicsConfiguration.
abstract  ColorModel getColorModel(int transparency)
          Returns the ColorModel associated with this GraphicsConfiguration that supports the specified transparency.
abstract  AffineTransform getDefaultTransform()
          Returns the default AffineTransform for this GraphicsConfiguration.
abstract  GraphicsDevice getDevice()
          Returns the GraphicsDevice associated with this GraphicsConfiguration.
abstract  AffineTransform getNormalizingTransform()
          Returns a AffineTransform that can be concatenated with the default AffineTransform of a GraphicsConfiguration so that 72 units in user space equals 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()
Returns the GraphicsDevice associated with this GraphicsConfiguration.
Returns:
a GraphicsDevice object that is associated with this GraphicsConfiguration.

createCompatibleImage

public abstract BufferedImage createCompatibleImage(int width,
                                                    int height)
Returns a BufferedImage with a data layout and color model compatible with this GraphicsConfiguration. This method has nothing to do with memory-mapping a device. The returned BufferedImage has a layout and color model that is closest to this native device configuration and can therefore be optimally blitted to this device.
Parameters:
width - the width of the returned BufferedImage
height - the height of the returned BufferedImage
Returns:
a BufferedImage whose data layout and color model is compatible with this GraphicsConfiguration.

createCompatibleImage

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

getColorModel

public abstract ColorModel getColorModel()
Returns the ColorModel associated with this GraphicsConfiguration.
Returns:
a ColorModel object that is associated with this GraphicsConfiguration.

getColorModel

public abstract ColorModel getColorModel(int transparency)
Returns the ColorModel associated with this GraphicsConfiguration that supports the specified transparency.
Parameters:
transparency - the specified transparency mode
Returns:
a ColorModel object that is associated with this GraphicsConfiguration and supports the specified transparency.

getDefaultTransform

public abstract AffineTransform getDefaultTransform()
Returns the default AffineTransform for this GraphicsConfiguration. This AffineTransform is typically the Identity transform for most normal screens. The default AffineTransform maps coordinates onto the device such that 72 user space coordinate units measure approximately 1 inch in device space. The normalizing transform can be used to make this mapping more exact. Coordinates in the coordinate space defined by the default AffineTransform for screen and printer devices 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, such as those not created by createCompatibleImage, this AffineTransform is the Identity transform.
Returns:
the default AffineTransform for this GraphicsConfiguration.

getNormalizingTransform

public abstract AffineTransform getNormalizingTransform()
Returns a AffineTransform that can be concatenated with the default AffineTransform of a GraphicsConfiguration so that 72 units in user space equals 1 inch in device space.

For a particular 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 AffineTransform is identity, such as for printers or metafile output, and that this AffineTransform is only as accurate as the information supplied by the underlying system. For image buffers not associated with a device, such as those not created by createCompatibleImage, this AffineTransform is the Identity transform since there is no valid distance measurement.
Returns:
an AffineTransform to concatenate to the default AffineTransform so that 72 units in user space is mapped to 1 inch in device space.

JavaTM 2 Platform
Standard Edition

Submit a bug or feature
Java, Java 2D, and JDBC are a trademarks or registered trademarks of Sun Microsystems, Inc. in the US and other countries.
Copyright 1993-1999 Sun Microsystems, Inc. 901 San Antonio Road,
Palo Alto, California, 94303, U.S.A. All Rights Reserved.