1 7 8 package java.awt; 9 10 import java.awt.geom.AffineTransform ; 11 import java.awt.image.BufferedImage ; 12 import java.awt.image.ColorModel ; 13 import java.awt.image.VolatileImage ; 14 15 78 87 88 89 public abstract class GraphicsConfiguration { 90 91 private static BufferCapabilities defaultBufferCaps; 92 private static ImageCapabilities defaultImageCaps; 93 94 103 protected GraphicsConfiguration() { 104 } 105 106 112 public abstract GraphicsDevice getDevice(); 113 114 127 public abstract BufferedImage createCompatibleImage(int width, int height); 128 129 142 public abstract VolatileImage createCompatibleVolatileImage(int width, 143 int height); 144 145 164 public abstract VolatileImage 165 createCompatibleVolatileImage(int width, int height, int transparency); 166 167 184 public VolatileImage createCompatibleVolatileImage(int width, int height, 185 ImageCapabilities caps) throws AWTException { 186 return createCompatibleVolatileImage(width, height); 188 } 189 190 213 public VolatileImage createCompatibleVolatileImage(int width, int height, 214 ImageCapabilities caps, int transparency) throws AWTException 215 { 216 return createCompatibleVolatileImage(width, height, transparency); 218 } 219 220 239 public abstract BufferedImage createCompatibleImage(int width, int height, 240 int transparency); 241 242 248 public abstract ColorModel getColorModel(); 249 250 263 public abstract ColorModel getColorModel(int transparency); 264 265 284 public abstract AffineTransform getDefaultTransform(); 285 286 314 public abstract AffineTransform getNormalizingTransform(); 315 316 325 public abstract Rectangle getBounds(); 326 327 private static class DefaultBufferCapabilities extends BufferCapabilities { 328 public DefaultBufferCapabilities(ImageCapabilities imageCaps) { 329 super(imageCaps, imageCaps, null); 330 } 331 } 332 333 340 public BufferCapabilities getBufferCapabilities() { 341 if (defaultBufferCaps == null) { 342 defaultBufferCaps = new DefaultBufferCapabilities( 343 getImageCapabilities()); 344 } 345 return defaultBufferCaps; 346 } 347 348 355 public ImageCapabilities getImageCapabilities() { 356 if (defaultImageCaps == null) { 357 defaultImageCaps = new ImageCapabilities (false); 358 } 359 return defaultImageCaps; 360 } 361 } 362 363 364 | Popular Tags |