public abstract class VolatileImage extends Image implements Transparency
Modifier and Type | Field and Description |
---|---|
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.
|
accelerationPriority, SCALE_AREA_AVERAGING, SCALE_DEFAULT, SCALE_FAST, SCALE_REPLICATE, SCALE_SMOOTH, UndefinedProperty
BITMASK, OPAQUE, TRANSLUCENT
Constructor and Description |
---|
VolatileImage()
Default constructor.
|
Modifier and Type | Method and Description |
---|---|
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.
|
getAccelerationPriority, getHeight, getProperty, getScaledInstance, getWidth, setAccelerationPriority
public static final int IMAGE_OK
public static final int IMAGE_RESTORED
public static final int IMAGE_INCOMPATIBLE
protected int transparency
public VolatileImage()
public abstract BufferedImage getSnapshot()
public abstract int getWidth()
public abstract int getHeight()
public ImageProducer getSource()
public void flush()
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
NULLIMAGE_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