1. /*
  2. * @(#)GraphicsConfigTemplate.java 1.13 00/02/02
  3. *
  4. * Copyright 1997-2000 Sun Microsystems, Inc. All Rights Reserved.
  5. *
  6. * This software is the proprietary information of Sun Microsystems, Inc.
  7. * Use is subject to license terms.
  8. *
  9. */
  10. package java.awt;
  11. import java.awt.Component;
  12. import java.io.*;
  13. /**
  14. * The <code>GraphicsConfigTemplate</code> class is used to obtain a valid
  15. * {@link GraphicsConfiguration}. A user instantiates one of these
  16. * objects and then sets all non-default attributes as desired. The
  17. * {@link GraphicsDevice#getBestConfiguration} method found in the
  18. * {@link GraphicsDevice} class is then called with this
  19. * <code>GraphicsConfigTemplate</code>. A valid
  20. * <code>GraphicsConfiguration</code> is returned that meets or exceeds
  21. * what was requested in the <code>GraphicsConfigTemplate</code>.
  22. * @see GraphicsDevice
  23. * @see GraphicsConfiguration
  24. *
  25. * @version 1.13, 02/02/00
  26. * @since 1.2
  27. */
  28. public abstract class GraphicsConfigTemplate implements Serializable {
  29. /**
  30. * This class is an abstract class so only subclasses can be
  31. * instantiated.
  32. */
  33. public GraphicsConfigTemplate() {
  34. }
  35. /**
  36. * Value used for "Enum" (Integer) type. States that this
  37. * feature is required for the <code>GraphicsConfiguration</code>
  38. * object. If this feature is not available, do not select the
  39. * <code>GraphicsConfiguration</code> object.
  40. */
  41. public static final int REQUIRED = 1;
  42. /**
  43. * Value used for "Enum" (Integer) type. States that this
  44. * feature is desired for the <code>GraphicsConfiguration</code>
  45. * object. A selection with this feature is preferred over a
  46. * selection that does not include this feature, although both
  47. * selections can be considered valid matches.
  48. */
  49. public static final int PREFERRED = 2;
  50. /**
  51. * Value used for "Enum" (Integer) type. States that this
  52. * feature is not necessary for the selection of the
  53. * <code>GraphicsConfiguration</code> object. A selection
  54. * without this feature is preferred over a selection that
  55. * includes this feature since it is not used.
  56. */
  57. public static final int UNNECESSARY = 3;
  58. /**
  59. * Returns the "best" configuration possible that passes the
  60. * criteria defined in the <code>GraphicsConfigTemplate</code>.
  61. * @param gc the array of <code>GraphicsConfiguration</code>
  62. * objects to choose from.
  63. * @return a <code>GraphicsConfiguration</code> object that is
  64. * the best configuration possible.
  65. * @see GraphicsConfiguration
  66. */
  67. public abstract GraphicsConfiguration
  68. getBestConfiguration(GraphicsConfiguration[] gc);
  69. /**
  70. * Returns a <code>boolean</code> indicating whether or
  71. * not the specified <code>GraphicsConfiguration</code> can be
  72. * used to create a drawing surface that supports the indicated
  73. * features.
  74. * @param gc the <code>GraphicsConfiguration</code> object to test
  75. * @return <code>true</code> if this
  76. * <code>GraphicsConfiguration</code> object can be used to create
  77. * surfaces that support the indicated features;
  78. * <code>false</code> if the <code>GraphicsConfiguration</code> can
  79. * not be used to create a drawing surface usable by this Java(tm)
  80. * API.
  81. */
  82. public abstract boolean
  83. isGraphicsConfigSupported(GraphicsConfiguration gc);
  84. }