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. package java.awt;
  8. /**
  9. * Capabilities and properties of images.
  10. * @author Michael Martak
  11. * @since 1.4
  12. */
  13. public class ImageCapabilities implements Cloneable {
  14. private boolean accelerated = false;
  15. /**
  16. * Creates a new object for specifying image capabilities.
  17. * @param accelerated whether or not an accelerated image is desired
  18. */
  19. public ImageCapabilities(boolean accelerated) {
  20. this.accelerated = accelerated;
  21. }
  22. /**
  23. * Returns <code>true</code> if the object whose capabilities are
  24. * encapsulated in this <code>ImageCapabilities</code> can be or is
  25. * accelerated.
  26. * @return whether or not an image can be, or is, accelerated. There are
  27. * various platform-specific ways to accelerate an image, including
  28. * pixmaps, VRAM, AGP. This is the general acceleration method (as
  29. * opposed to residing in system memory).
  30. */
  31. public boolean isAccelerated() {
  32. return accelerated;
  33. }
  34. /**
  35. * Returns <code>true</code> if the <code>VolatileImage</code>
  36. * described by this <code>ImageCapabilities</code> can lose
  37. * its surfaces.
  38. * @return whether or not a volatile image is subject to losing its surfaces
  39. * at the whim of the operating system.
  40. */
  41. public boolean isTrueVolatile() {
  42. return false;
  43. }
  44. /**
  45. * @return a copy of this ImageCapabilities object.
  46. */
  47. public Object clone() {
  48. try {
  49. return super.clone();
  50. } catch (CloneNotSupportedException e) {
  51. // Since we implement Cloneable, this should never happen
  52. throw new InternalError();
  53. }
  54. }
  55. }