home *** CD-ROM | disk | FTP | other *** search
Java Source | 1998-03-20 | 3.0 KB | 90 lines |
- /*
- * @(#)GraphicsConfigTemplate.java 1.2 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.Component;
- import java.io.*;
-
- /**
- * This class is used to obtain a valid GraphicsConfiguration.
- * A user instantiates one of these objects and then sets all
- * non-default attributes as desired. The getGraphicsConfiguration
- * method found in the GraphicsDevice class is then called with this
- * GraphicsConfigTemplate. A valid GraphicsConfiguration is returned
- * that meets or exceeds what was requested in the GraphicsConfigTemplate.
- * @see GraphicsDevice
- * @see GraphicsConfiguration
- *
- * @version 1.2 03/18/98
- * @since JDK1.2
- */
- public abstract class GraphicsConfigTemplate implements Serializable {
-
- /**
- * Value used for "Enum" (Integer) type. States that this
- * feature is required for the CraphicsConfiguration object.
- * If this feature is not available do not select the
- * CraphicsConfiguration object.
- */
- public static final int REQUIRED = 1;
-
- /**
- * Value used for "Enum" (Integer) type. States that this
- * feature is desired for the CraphicsConfiguration object.
- * Try to select the CraphicsConfiguration object with this
- * feature, if unable to do so then this feature can be disabled
- * and the selection of the CraphicsConfiguration object can be
- * attempted again.
- */
- public static final int PREFERRED = 2;
-
- /**
- * Value used for "Enum" (Integer) type. States that this
- * feature is not necessary for the selection of the
- * CraphicsConfiguration object. Try to select a valid
- * CraphicsConfiguration without this feature as it will not
- * be used.
- */
- public static final int UNNECESSARY = 3;
-
- /**
- * Returns the "best" configuration possible that passes the
- * criteria defined in the GraphicsConfigTemplate.
- *
- * @param gc the array of GraphicsConfigurations to choose from.
- *
- * @see GraphicsConfiguration
- */
- public abstract GraphicsConfiguration
- getBestConfiguration(GraphicsConfiguration[] gc);
-
- /**
- * Returns a boolean indicating whether or not the given
- * GraphicsConfiguration can be used to create a drawing
- * surface that can be rendered to.
- *
- * @param gc the GraphicsConfiguration object to test.
- *
- * @return <code>true</code> if this GraphicsConfiguration object
- * can be used to create surfaces that can be rendered to,
- * <code>false</code> if the GraphicsConfiguration can not be used
- * to create a drawing surface usable by this API.
- */
- public abstract boolean
- isGraphicsConfigSupported(GraphicsConfiguration gc);
-
- }
-
-