java.lang.Object | |||
↳ | java.awt.Image | ||
↳ | java.awt.image.VolatileImage | ||
↳ | sun.awt.image.SunVolatileImage |
This class is the base implementation of the VolatileImage abstract class. The class implements most of the standard Image methods (width, height, etc.) but delegates all surface management issues to a platform-specific VolatileSurfaceManager. When a new instance of SunVolatileImage is created, it automatically creates an appropriate VolatileSurfaceManager for the GraphicsConfiguration under which this SunVolatileImage was created.
[Expand]
Inherited Constants | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
![]() | |||||||||||
![]() | |||||||||||
![]() |
Fields | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
comp | |||||||||||
volSurfaceManager |
[Expand]
Inherited Fields | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
![]() | |||||||||||
![]() |
Public Constructors | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Returns
true if rendering data was lost since last
validate call. | |||||||||||
Creates a
Graphics2D , which can be used to draw into
this VolatileImage . | |||||||||||
This method creates a BufferedImage intended for use as a "snapshot"
or a backup surface.
| |||||||||||
Returns an ImageCapabilities object which can be
inquired as to the specific capabilities of this
VolatileImage.
| |||||||||||
Returns the height of the
VolatileImage . | |||||||||||
Determines the height of the image.
| |||||||||||
Gets a property of this image by name.
| |||||||||||
Returns a static snapshot image of this object.
| |||||||||||
Returns the width of the
VolatileImage . | |||||||||||
Determines the width of the image.
| |||||||||||
Attempts to restore the drawing surface of the image if the surface
had been lost since the last
validate call. |
Protected Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
![]() | |||||||||||
![]() | |||||||||||
![]() | |||||||||||
![]() |
Returns true
if rendering data was lost since last
validate
call. This method should be called by the
application at the end of any series of rendering operations to
or from the image to see whether
the image needs to be validated and the rendering redone.
true
if the drawing surface needs to be restored;
false
otherwise.
Creates a Graphics2D
, which can be used to draw into
this VolatileImage
.
Graphics2D
, used for drawing into this
image.
This method creates a BufferedImage intended for use as a "snapshot" or a backup surface.
Returns an ImageCapabilities object which can be inquired as to the specific capabilities of this VolatileImage. This would allow programmers to find out more runtime information on the specific VolatileImage object that they have created. For example, the user might create a VolatileImage but the system may have no video memory left for creating an image of that size, so although the object is a VolatileImage, it is not as accelerated as other VolatileImage objects on this platform might be. The user might want that information to find other solutions to their problem.
ImageCapabilities
object that contains
the capabilities of this VolatileImage
.Returns the height of the VolatileImage
.
VolatileImage
.
Determines the height of the image. If the height is not yet known,
this method returns -1
and the specified
ImageObserver
object is notified later.
observer | an object waiting for the image to be loaded. |
---|
-1
if the height is not yet known.Gets a property of this image by name.
Individual property names are defined by the various image
formats. If a property is not defined for a particular image, this
method returns the UndefinedProperty
object.
If the properties for this image are not yet known, this method
returns null
, and the ImageObserver
object is notified later.
The property name "comment"
should be used to store
an optional comment which can be presented to the application as a
description of the image, its source, or its author.
name | a property name. |
---|---|
observer | an object waiting for this image to be loaded. |
Returns a static snapshot image of this object. The
BufferedImage
returned is only current with
the VolatileImage
at the time of the request
and will not be updated with any future changes to the
VolatileImage
.
BufferedImage
representation of this
VolatileImage
Returns the width of the VolatileImage
.
VolatileImage
.
Determines the width of the image. If the width is not yet known,
this method returns -1
and the specified
ImageObserver
object is notified later.
observer | an object waiting for the image to be loaded. |
---|
-1
if the width is not yet known.Attempts to restore the drawing surface of the image if the surface
had been lost since the last validate
call. Also
validates this image against the given GraphicsConfiguration
parameter to see whether operations from this image to the
GraphicsConfiguration are compatible. An example of an
incompatible combination might be a situation where a VolatileImage
object was created on one graphics device and then was used
to render to a different graphics device. Since VolatileImage
objects tend to be very device-specific, this operation might
not work as intended, so the return code from this validate
call would note that incompatibility. A null or incorrect
value for gc may cause incorrect values to be returned from
validate
and may cause later problems with rendering.
gc | a GraphicsConfiguration object for this
image to be validated against. A null gc implies that the
validate method should skip the compatibility test. |
---|
IMAGE_OK
if the image did not need validationIMAGE_RESTORED
if the image needed restoration.
Restoration implies that the contents of the image may have
been affected and the image may need to be re-rendered.IMAGE_INCOMPATIBLE
if the image is incompatible
with the GraphicsConfiguration
object passed
into the validate
method. Incompatibility
implies that the image may need to be recreated with a
new Component
or
GraphicsConfiguration
in order to get an image
that can be used successfully with this
GraphicsConfiguration
.
An incompatible image is not checked for whether restoration
was necessary, so the state of the image is unchanged
after a return value of IMAGE_INCOMPATIBLE
and this return value implies nothing about whether the
image needs to be restored.