home *** CD-ROM | disk | FTP | other *** search
Java Source | 1998-03-20 | 4.4 KB | 121 lines |
- /*
- * @(#)GraphicsConfiguration.java 1.14 98/03/18
- *
- * Copyright 1997 by Sun Microsystems, Inc.,
- * 901 San Antonio Road, Palo Alto, California, 94303, U.S.A.
- * All rights reserved.
- *
- * This software is the confidential and proprietary information
- * of Sun Microsystems, Inc. ("Confidential Information"). You
- * shall not disclose such Confidential Information and shall use
- * it only in accordance with the terms of the license agreement
- * you entered into with Sun.
- */
-
- package java.awt;
-
- import java.awt.geom.AffineTransform;
- import java.awt.image.BufferedImage;
- import java.awt.image.ColorModel;
-
- /**
- * This class describes the characteristics of a physical 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 GraphicsEnvironment
- * @see GraphicsDevice
- */
- /*
- * REMIND: What to do about capabilities?
- * The
- * capabilities of the device can be determined by enumerating the possible
- * capabilities and checking if the GraphicsConfiguration
- * implements the interface for that capability.
- *
- * @version 10 Feb 1997
- */
-
-
- public abstract class GraphicsConfiguration {
- /**
- * Return the graphics device associated with this configuration.
- */
- public abstract GraphicsDevice getDevice();
-
- /**
- * Returns a BufferedImage with channel 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.
- */
- public abstract BufferedImage createCompatibleImage(int width, int height);
-
- /**
- * Returns a BufferedImage that supports the specified transparency
- * and has a channel 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 Transparency#OPAQUE
- * @see Transparency#BITMASK
- * @see Transparency#TRANSLUCENT
- */
- public abstract BufferedImage createCompatibleImage(int width, int height,
- int transparency);
-
- /**
- * Returns the color model associated with this configuration.
- */
- public abstract ColorModel getColorModel();
-
- /**
- * Returns the color model associated with this configuration that
- * supports the specified transparency.
- */
- public abstract ColorModel getColorModel(int transparency);
-
- /**
- * 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, this Transform will be the Identity transform.
- */
- public abstract AffineTransform getDefaultTransform();
-
- /**
- *
- * Returns a Transform that can be composed with the default Transform
- * of a Graphics2D 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:
- * <pre>
- * GraphicsConfiguration gc = g.getGraphicsConfiguration();
- *
- * g.setTransform(gc.getDefaultTransform());
- * g.transform(gc.getNormalizingTransform());
- * </pre>
- * 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, this Transform will be the Identity transform,
- * since there is no valid distance measurement.
- */
- public abstract AffineTransform getNormalizingTransform();
-
- }
-
-
-