Merge from mainline.
[official-gcc.git] / libjava / classpath / java / awt / GraphicsConfiguration.java
blobf68a1e6ba4feee81fb88b9369a1eaeb66ee3e1d3
1 /* GraphicsConfiguration.java -- describes characteristics of graphics
2 Copyright (C) 2000, 2001, 2002 Free Software Foundation
4 This file is part of GNU Classpath.
6 GNU Classpath is free software; you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation; either version 2, or (at your option)
9 any later version.
11 GNU Classpath is distributed in the hope that it will be useful, but
12 WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 General Public License for more details.
16 You should have received a copy of the GNU General Public License
17 along with GNU Classpath; see the file COPYING. If not, write to the
18 Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
19 02110-1301 USA.
21 Linking this library statically or dynamically with other modules is
22 making a combined work based on this library. Thus, the terms and
23 conditions of the GNU General Public License cover the whole
24 combination.
26 As a special exception, the copyright holders of this library give you
27 permission to link this library with independent modules to produce an
28 executable, regardless of the license terms of these independent
29 modules, and to copy and distribute the resulting executable under
30 terms of your choice, provided that you also meet, for each linked
31 independent module, the terms and conditions of the license of that
32 module. An independent module is a module which is not derived from
33 or based on this library. If you modify this library, you may extend
34 this exception to your version of the library, but you are not
35 obligated to do so. If you do not wish to do so, delete this
36 exception statement from your version. */
39 package java.awt;
41 import gnu.classpath.NotImplementedException;
43 import java.awt.geom.AffineTransform;
44 import java.awt.image.BufferedImage;
45 import java.awt.image.ColorModel;
46 import java.awt.image.VolatileImage;
48 /**
49 * This class describes the configuration of various graphics devices, such
50 * as a monitor or printer. Different configurations may exist for the same
51 * device, according to the different native modes supported.
53 * <p>Virtual devices are supported (for example, in a multiple screen
54 * environment, a virtual device covers all screens simultaneously); the
55 * configuration will have a non-zero relative coordinate system in such
56 * a case.
58 * @author Eric Blake (ebb9@email.byu.edu)
59 * @see Window
60 * @see Frame
61 * @see GraphicsEnvironment
62 * @see GraphicsDevice
63 * @since 1.0
64 * @status updated to 1.4
66 public abstract class GraphicsConfiguration
68 /**
69 * The default constructor.
71 * @see GraphicsDevice#getConfigurations()
72 * @see GraphicsDevice#getDefaultConfiguration()
73 * @see GraphicsDevice#getBestConfiguration(GraphicsConfigTemplate)
74 * @see Graphics2D#getDeviceConfiguration()
76 protected GraphicsConfiguration ()
80 /**
81 * Gets the associated device that this configuration describes.
83 * @return the device
85 public abstract GraphicsDevice getDevice();
87 /**
88 * Returns a buffered image optimized to this device, so that blitting can
89 * be supported in the buffered image.
91 * @param w the width of the buffer
92 * @param h the height of the buffer
93 * @return the buffered image, or null if none is supported
95 public abstract BufferedImage createCompatibleImage(int w, int h);
97 /**
98 * Returns a buffered volatile image optimized to this device, so that
99 * blitting can be supported in the buffered image. Because the buffer is
100 * volatile, it can be optimized by native graphics accelerators.
102 * @param w the width of the buffer
103 * @param h the height of the buffer
104 * @return the buffered image, or null if none is supported
105 * @see Component#createVolatileImage(int, int)
106 * @since 1.4
108 public abstract VolatileImage createCompatibleVolatileImage(int w, int h);
111 * Returns a buffered volatile image optimized to this device, and with the
112 * given capabilities, so that blitting can be supported in the buffered
113 * image. Because the buffer is volatile, it can be optimized by native
114 * graphics accelerators.
116 * @param w the width of the buffer
117 * @param h the height of the buffer
118 * @param caps the desired capabilities of the image buffer
119 * @return the buffered image, or null if none is supported
120 * @throws AWTException if the capabilities cannot be met
121 * @since 1.4
123 public VolatileImage createCompatibleVolatileImage(int w, int h,
124 ImageCapabilities caps)
125 throws AWTException
127 throw new AWTException("not implemented");
131 * Returns a buffered volatile image optimized to this device, and
132 * with the given transparency. Because the buffer is volatile, it
133 * can be optimized by native graphics accelerators.
135 * @param width the width of the buffer
136 * @param height the height of the buffer
137 * @param transparency the transparency value for the buffer
138 * @return the buffered image, or null if none is supported
139 * @since 1.5
141 public abstract VolatileImage createCompatibleVolatileImage(int width,
142 int height,
143 int transparency);
146 * Returns a buffered image optimized to this device, and with the specified
147 * transparency, so that blitting can be supported in the buffered image.
149 * @param w the width of the buffer
150 * @param h the height of the buffer
151 * @param transparency the transparency of the buffer
152 * @return the buffered image, or null if none is supported
153 * @see Transparency#OPAQUE
154 * @see Transparency#BITMASK
155 * @see Transparency#TRANSLUCENT
157 public abstract BufferedImage createCompatibleImage(int w, int h,
158 int transparency);
161 * Gets the color model of the corresponding device.
163 * @return the color model
165 public abstract ColorModel getColorModel();
168 * Gets a color model for the corresponding device which supports the desired
169 * transparency level.
171 * @param transparency the transparency of the model
172 * @return the color model, with transparency
173 * @see Transparency#OPAQUE
174 * @see Transparency#BITMASK
175 * @see Transparency#TRANSLUCENT
177 public abstract ColorModel getColorModel(int transparency);
180 * Returns a transform that maps user coordinates to device coordinates. The
181 * preferred mapping is about 72 user units to 1 inch (2.54 cm) of physical
182 * space. This is often the identity transform. The device coordinates have
183 * the origin at the upper left, with increasing x to the right, and
184 * increasing y to the bottom.
186 * @return the transformation from user space to device space
187 * @see #getNormalizingTransform()
189 public abstract AffineTransform getDefaultTransform();
192 * Returns a transform that maps user coordinates to device coordinates. The
193 * exact mapping is 72 user units to 1 inch (2.54 cm) of physical space.
194 * This is often the identity transform. The device coordinates have the
195 * origin at the upper left, with increasing x to the right, and increasing
196 * y to the bottom. Note that this is more accurate (and thus, sometimes more
197 * costly) than the default transform.
199 * @return the normalized transformation from user space to device space
200 * @see #getDefaultTransform()
202 public abstract AffineTransform getNormalizingTransform();
205 * Returns the bounds of the configuration, in device coordinates. If this
206 * is a virtual device (for example, encompassing several screens), the
207 * bounds may have a non-zero origin.
209 * @return the device bounds
210 * @since 1.3
212 public abstract Rectangle getBounds();
215 * Returns the buffering capabilities of this configuration.
217 * @return the buffer capabilities
218 * @since 1.4
220 public BufferCapabilities getBufferCapabilities()
221 throws NotImplementedException
223 throw new Error("not implemented");
227 * Returns the imaging capabilities of this configuration.
229 * @return the image capabilities
230 * @since 1.4
232 public ImageCapabilities getImageCapabilities()
233 throws NotImplementedException
235 throw new Error("not implemented");
237 } // class GraphicsConfiguration