1 7 8 package java.awt; 9 10 18 public class BufferCapabilities implements Cloneable { 19 20 private ImageCapabilities frontCaps; 21 private ImageCapabilities backCaps; 22 private FlipContents flipContents; 23 24 35 public BufferCapabilities(ImageCapabilities frontCaps, 36 ImageCapabilities backCaps, FlipContents flipContents) { 37 if (frontCaps == null || backCaps == null) { 38 throw new IllegalArgumentException ( 39 "Image capabilities specified cannot be null"); 40 } 41 this.frontCaps = frontCaps; 42 this.backCaps = backCaps; 43 this.flipContents = flipContents; 44 } 45 46 49 public ImageCapabilities getFrontBufferCapabilities() { 50 return frontCaps; 51 } 52 53 57 public ImageCapabilities getBackBufferCapabilities() { 58 return backCaps; 59 } 60 61 71 public boolean isPageFlipping() { 72 return (getFlipContents() != null); 73 } 74 75 89 public FlipContents getFlipContents() { 90 return flipContents; 91 } 92 93 100 public boolean isFullScreenRequired() { 101 return false; 102 } 103 104 110 public boolean isMultiBufferAvailable() { 111 return false; 112 } 113 114 117 public Object clone() { 118 try { 119 return super.clone(); 120 } catch (CloneNotSupportedException e) { 121 throw new InternalError (); 123 } 124 } 125 126 131 public static final class FlipContents extends AttributeValue { 132 133 private static int I_UNDEFINED = 0; 134 private static int I_BACKGROUND = 1; 135 private static int I_PRIOR = 2; 136 private static int I_COPIED = 3; 137 138 private static final String NAMES[] = 139 { "undefined", "background", "prior", "copied" }; 140 141 150 public static final FlipContents UNDEFINED = 151 new FlipContents(I_UNDEFINED); 152 153 163 public static final FlipContents BACKGROUND = 164 new FlipContents(I_BACKGROUND); 165 166 176 public static final FlipContents PRIOR = 177 new FlipContents(I_PRIOR); 178 179 189 public static final FlipContents COPIED = 190 new FlipContents(I_COPIED); 191 192 private FlipContents(int type) { 193 super(type, NAMES); 194 } 195 196 } 198 } 199 | Popular Tags |