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

  1. /*
  2.  * @(#)GraphicsDevice.java    1.12 98/03/18
  3.  *
  4.  * Copyright 1997, 1998 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.  
  16. package java.awt;
  17.  
  18. /**
  19.  * This class describes the graphics devices that may be available
  20.  * in a graphics environment.  These include screen and printer devices.
  21.  * Note that there may be many screens and many printers in an instance
  22.  * of GraphicsEnvironment. Each graphics
  23.  * device has one or more GraphicsConfiguration objects associated with it.  
  24.  * These specify the different configurations in which the GraphicsDevice
  25.  * can be used.  
  26.  * @see GraphicsEnvironment
  27.  * @see GraphicsConfiguration
  28.  * @version 10 Feb 1997
  29.  */
  30. public abstract class GraphicsDevice {
  31.     /**
  32.      * Device is a raster screen.
  33.      */
  34.     public final static int TYPE_RASTER_SCREEN        = 0;
  35.  
  36.     /**
  37.      * Device is a printer.
  38.      */
  39.     public final static int TYPE_PRINTER        = 1;
  40.  
  41.     /**
  42.      * Device is an image buffer.  This buffer may reside in device
  43.      * or system memory but it is not visible to the user.
  44.      */
  45.     public final static int TYPE_IMAGE_BUFFER           = 2;
  46.     
  47.     /**
  48.      * Returns the type of the graphics device.
  49.      * @see #TYPE_RASTER_SCREEN
  50.      * @see #TYPE_PRINTER
  51.      * @see #TYPE_IMAGE_BUFFER
  52.      */
  53.     public abstract int getType();
  54.  
  55.     /**
  56.      * Returns the identification string associated with this graphics
  57.      * device.
  58.      */
  59.     public abstract String getIDstring();
  60.     
  61.     /**
  62.      * Returns all of the graphics
  63.      * configurations associated with this graphics device.
  64.      */
  65.     public abstract GraphicsConfiguration[] getConfigurations();
  66.  
  67.     /**
  68.      * Returns the default graphics configuration
  69.      * associated with this graphics device.
  70.      */
  71.     public abstract GraphicsConfiguration getDefaultConfiguration();
  72.  
  73.     /**
  74.      * Returns the "best" configuration possible that passes the
  75.      * criteria defined in the GraphicsTemplate.
  76.      * @see GraphicsConfigTemplate
  77.      */
  78.     public GraphicsConfiguration
  79.            getBestConfiguration(GraphicsConfigTemplate gct) {
  80.         GraphicsConfiguration[] configs = getConfigurations();
  81.         return gct.getBestConfiguration(configs);
  82.     }
  83.  
  84. }
  85.