home *** CD-ROM | disk | FTP | other *** search
/ Java 1.2 How-To / JavaHowTo.iso / 3rdParty / jbuilder / unsupported / JDK1.2beta3 / SOURCE / SRC.ZIP / java / awt / GraphicsConfigTemplate.java < prev    next >
Encoding:
Java Source  |  1998-03-20  |  3.0 KB  |  90 lines

  1. /*
  2.  * @(#)GraphicsConfigTemplate.java    1.2 98/03/18
  3.  *
  4.  * Copyright 1997 by Sun Microsystems, Inc.,
  5.  * 901 San Antonio Road, Palo Alto, California, 94303, U.S.A.
  6.  * All rights reserved.
  7.  *
  8.  * This software is the confidential and proprietary information
  9.  * of Sun Microsystems, Inc. ("Confidential Information").  You
  10.  * shall not disclose such Confidential Information and shall use
  11.  * it only in accordance with the terms of the license agreement
  12.  * you entered into with Sun.
  13.  */
  14.  
  15. package java.awt;
  16.  
  17. import java.awt.Component;
  18. import java.io.*;
  19.  
  20. /**
  21.  * This class is used to obtain a valid GraphicsConfiguration.
  22.  * A user instantiates one of these objects and then sets all
  23.  * non-default attributes as desired.  The getGraphicsConfiguration
  24.  * method found in the GraphicsDevice class is then called with this
  25.  * GraphicsConfigTemplate.  A valid GraphicsConfiguration is returned
  26.  * that meets or exceeds what was requested in the GraphicsConfigTemplate.
  27.  * @see GraphicsDevice
  28.  * @see GraphicsConfiguration
  29.  *
  30.  * @version     1.2 03/18/98
  31.  * @since       JDK1.2
  32.  */
  33. public abstract class GraphicsConfigTemplate implements Serializable {
  34.  
  35.     /**
  36.      * Value used for "Enum" (Integer) type.  States that this
  37.      * feature is required for the CraphicsConfiguration object.
  38.      * If this feature is not available do not select the
  39.      * CraphicsConfiguration object.
  40.      */
  41.     public static final int REQUIRED    = 1;
  42.  
  43.     /**
  44.      * Value used for "Enum" (Integer) type.  States that this
  45.      * feature is desired for the CraphicsConfiguration object.
  46.      * Try to select the CraphicsConfiguration object with this
  47.      * feature, if unable to do so then this feature can be disabled
  48.      * and the selection of the CraphicsConfiguration object can be
  49.      * attempted again.
  50.      */
  51.     public static final int PREFERRED    = 2;
  52.  
  53.     /**
  54.      * Value used for "Enum" (Integer) type.  States that this
  55.      * feature is not necessary for the selection of the
  56.      * CraphicsConfiguration object.  Try to select a valid
  57.      * CraphicsConfiguration without this feature as it will not
  58.      * be used.
  59.      */
  60.     public static final int UNNECESSARY    = 3;
  61.  
  62.     /**
  63.      * Returns the "best" configuration possible that passes the
  64.      * criteria defined in the GraphicsConfigTemplate.
  65.      *
  66.      * @param gc the array of GraphicsConfigurations to choose from.
  67.      *
  68.      * @see GraphicsConfiguration
  69.      */
  70.     public abstract GraphicsConfiguration
  71.       getBestConfiguration(GraphicsConfiguration[] gc); 
  72.  
  73.     /**
  74.      * Returns a boolean indicating whether or not the given
  75.      * GraphicsConfiguration can be used to create a drawing
  76.      * surface that can be rendered to.
  77.      *
  78.      * @param gc the GraphicsConfiguration object to test.
  79.      *
  80.      * @return <code>true</code> if this GraphicsConfiguration object
  81.      *  can be used to create surfaces that can be rendered to,
  82.      *  <code>false</code> if the GraphicsConfiguration can not be used
  83.      *  to create a drawing surface usable by this API.
  84.      */
  85.     public abstract boolean
  86.       isGraphicsConfigSupported(GraphicsConfiguration gc);
  87.  
  88. }
  89.  
  90.