|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.awt.Image
java.awt.image.VolatileImage
public abstract class VolatileImage
VolatileImage represents a hardware-accelerated graphics buffer. The native graphics system may free or damage the resources occupied by a VolatileImage at any time. As such, one must frequently check the "validity" of the image buffer's resources. A volatile image's "validity" depends on multiple factors. Its resources may have become unavailble in which case you must reallocate them. If you move the image from one output device to another, you may need to recreate the image's resources if the new output device's capabilities don't match the old one's. Finally, if the contents of the image's buffer have been damaged you must re-render the image. VolatileImages should always be created using either Component.createVolatileImage or GraphicsConfiguration.createCompatibleVolatileImage.
Field Summary | |
---|---|
static int |
IMAGE_INCOMPATIBLE
One of validate's possible return values. |
static int |
IMAGE_OK
One of validate's possible return values. |
static int |
IMAGE_RESTORED
One of validate's possible return values. |
protected int |
transparency
This image's transparency type. |
Fields inherited from class java.awt.Image |
---|
accelerationPriority, SCALE_AREA_AVERAGING, SCALE_DEFAULT, SCALE_FAST, SCALE_REPLICATE, SCALE_SMOOTH, UndefinedProperty |
Fields inherited from interface java.awt.Transparency |
---|
BITMASK, OPAQUE, TRANSLUCENT |
Constructor Summary | |
---|---|
VolatileImage()
Default constructor. |
Method Summary | |
---|---|
abstract boolean |
contentsLost()
Returns true if the contents of the image buffer have been damaged or if the image buffer's resources have been reclaimed by the graphics system. |
abstract Graphics2D |
createGraphics()
Returns a Graphics2D object that can be used to draw onto this image. |
void |
flush()
Releases the system resources taken by this image. |
abstract ImageCapabilities |
getCapabilities()
Returns the capabilities of this image buffer. |
Graphics |
getGraphics()
Returns a Graphics2D object that can be used to draw onto this image. |
abstract int |
getHeight()
Returns the height of this image buffer. |
abstract BufferedImage |
getSnapshot()
Returns an image representing the current state of the volatile image buffer. |
ImageProducer |
getSource()
Calling this method is equivalent to calling getSnapshot().getSource(). |
int |
getTransparency()
Returns the transparency type of this image. |
abstract int |
getWidth()
Returns the width of this image buffer. |
abstract int |
validate(GraphicsConfiguration gc)
Validates and restores this image. |
Methods inherited from class java.awt.Image |
---|
getAccelerationPriority, getHeight, getProperty, getScaledInstance, getWidth, setAccelerationPriority |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final int IMAGE_OK
public static final int IMAGE_RESTORED
public static final int IMAGE_INCOMPATIBLE
protected int transparency
Constructor Detail |
---|
public VolatileImage()
Method Detail |
---|
public abstract BufferedImage getSnapshot()
public abstract int getWidth()
public abstract int getHeight()
public ImageProducer getSource()
getSource
in class Image
public void flush()
flush
in class Image
public Graphics getGraphics()
getGraphics
in class Image
public abstract Graphics2D createGraphics()
public abstract int validate(GraphicsConfiguration gc)
gc
- graphics configuration against which to validate or
NULL
IMAGE_OK
if the image did not need to be
validated and didn't need to be restoredIMAGE_RESTORED
if the image may need to be
re-rendered.IMAGE_INCOMPATIBLE
if this image's
requirements are not fulfilled by the graphics configuration
parameter. This implies that you need to create a new
VolatileImage for the different GraphicsConfiguration or
Component. This return value implies nothing about whether the
image is valid or needs to be re-rendered.public abstract boolean contentsLost()
public abstract ImageCapabilities getCapabilities()
public int getTransparency()
getTransparency
in interface Transparency
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |