KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > java > awt > ImageCapabilities


1 /*
2  * @(#)ImageCapabilities.java 1.6 03/12/19
3  *
4  * Copyright 2004 Sun Microsystems, Inc. All rights reserved.
5  * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
6  */

7
8 package java.awt;
9
10 /**
11  * Capabilities and properties of images.
12  * @author Michael Martak
13  * @since 1.4
14  */

15 public class ImageCapabilities implements Cloneable JavaDoc {
16     
17     private boolean accelerated = false;
18     
19     /**
20      * Creates a new object for specifying image capabilities.
21      * @param accelerated whether or not an accelerated image is desired
22      */

23     public ImageCapabilities(boolean accelerated) {
24         this.accelerated = accelerated;
25     }
26     
27     /**
28      * Returns <code>true</code> if the object whose capabilities are
29      * encapsulated in this <code>ImageCapabilities</code> can be or is
30      * accelerated.
31      * @return whether or not an image can be, or is, accelerated. There are
32      * various platform-specific ways to accelerate an image, including
33      * pixmaps, VRAM, AGP. This is the general acceleration method (as
34      * opposed to residing in system memory).
35      */

36     public boolean isAccelerated() {
37         return accelerated;
38     }
39     
40     /**
41      * Returns <code>true</code> if the <code>VolatileImage</code>
42      * described by this <code>ImageCapabilities</code> can lose
43      * its surfaces.
44      * @return whether or not a volatile image is subject to losing its surfaces
45      * at the whim of the operating system.
46      */

47     public boolean isTrueVolatile() {
48         return false;
49     }
50
51     /**
52      * @return a copy of this ImageCapabilities object.
53      */

54     public Object JavaDoc clone() {
55         try {
56             return super.clone();
57         } catch (CloneNotSupportedException JavaDoc e) {
58             // Since we implement Cloneable, this should never happen
59
throw new InternalError JavaDoc();
60         }
61     }
62
63 }
64
Popular Tags