1 7 8 package java.awt.image; 9 10 import java.awt.Color ; 11 import java.awt.Graphics ; 12 import java.awt.Graphics2D ; 13 import java.awt.GraphicsConfiguration ; 14 import java.awt.GraphicsDevice ; 15 import java.awt.Image ; 16 import java.awt.ImageCapabilities ; 17 import java.awt.Toolkit ; 18 import java.awt.Transparency ; 19 20 94 public abstract class VolatileImage extends Image implements Transparency 95 { 96 97 99 102 public static final int IMAGE_OK = 0; 103 104 108 public static final int IMAGE_RESTORED = 1; 109 110 117 public static final int IMAGE_INCOMPATIBLE = 2; 118 119 129 public abstract BufferedImage getSnapshot(); 130 131 135 public abstract int getWidth(); 136 137 141 public abstract int getHeight(); 142 143 145 167 public ImageProducer getSource() { 168 return getSnapshot().getSource(); 180 } 181 182 185 212 public void flush() { 213 } 214 215 223 public Graphics getGraphics() { 224 return createGraphics(); 225 } 226 227 233 public abstract Graphics2D createGraphics(); 234 235 236 238 279 public abstract int validate(GraphicsConfiguration gc); 280 281 290 public abstract boolean contentsLost(); 291 292 308 public abstract ImageCapabilities getCapabilities(); 309 310 319 protected int transparency = TRANSLUCENT; 320 321 330 public int getTransparency() { 331 return transparency; 332 } 333 } 334 335 | Popular Tags |