APIdia Launch Partner
Top Description Fields Constructors Methods
sun.awt.image

public Class SunVolatileImage

extends VolatileImage
implements DestSurfaceProvider
Class Inheritance
All Implemented Interfaces
sun.java2d.DestSurfaceProvider
Known Direct Subclasses
sun.java2d.pipe.hw.AccelTypedVolatileImage
Imports
java.awt.AlphaComposite, .Color, .Component, .Font, .Graphics2D, .GraphicsConfiguration, .ImageCapabilities, .Transparency, java.awt.image.BufferedImage, .ImageObserver, .VolatileImage, sun.java2d.SunGraphics2D, .DestSurfaceProvider, .Surface, sun.java2d.pipe.Region

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.

Field Summary

Modifier and TypeField and Description
protected Component
private Font
private int
private GraphicsConfiguration
private int
protected VolatileSurfaceManager
private int
Inherited from java.awt.image.VolatileImage:
IMAGE_INCOMPATIBLEIMAGE_OKIMAGE_RESTOREDtransparency

Constructor Summary

AccessConstructor and Description
protected
SunVolatileImage(Component comp, GraphicsConfiguration graphicsConfig, int width, int height, Object context, int transparency, ImageCapabilities caps, int accType)

private
SunVolatileImage(Component comp, GraphicsConfiguration graphicsConfig, int width, int height, Object context, ImageCapabilities caps)

public
SunVolatileImage(Component comp, int width, int height)

public
SunVolatileImage(Component comp, int width, int height, Object context)

public
SunVolatileImage(GraphicsConfiguration graphicsConfig, int width, int height, int transparency, ImageCapabilities caps)

Method Summary

Modifier and TypeMethod and Description
public boolean
contentsLost()

Implements abstract java.awt.image.VolatileImage.contentsLost.

Returns true if rendering data was lost since last validate call.

public Graphics2D
createGraphics()

Implements abstract java.awt.image.VolatileImage.createGraphics.

Creates a Graphics2D, which can be used to draw into this VolatileImage.

private VolatileSurfaceManager
private Color
public BufferedImage
getBackupImage()

This method creates a BufferedImage intended for use as a "snapshot" or a backup surface.

public BufferedImage
getBackupImage(double scaleX, double scaleY)

This method creates a BufferedImage intended for use as a "snapshot" or a backup surface with the given horizontal and vertical scale factors.

public ImageCapabilities
getCapabilities()

Implements abstract java.awt.image.VolatileImage.getCapabilities.

Returns an ImageCapabilities object which can be inquired as to the specific capabilities of this VolatileImage.

public Component
public Surface
getDestSurface()

Implements sun.java2d.DestSurfaceProvider.getDestSurface.

Returns a surface currently used as a destination surface for rendering.

private Font
public int
private Color
public GraphicsConfiguration
public int
getHeight()

Implements abstract java.awt.image.VolatileImage.getHeight.

Returns the height of the VolatileImage.

public int
getHeight(ImageObserver observer)

Implements abstract java.awt.Image.getHeight.

Determines the height of the image.

public Object
getProperty(String name, ImageObserver observer)

Implements abstract java.awt.Image.getProperty.

Gets a property of this image by name.

public BufferedImage
getSnapshot()

Implements abstract java.awt.image.VolatileImage.getSnapshot.

Returns a static snapshot image of this object.

public int
getWidth()

Implements abstract java.awt.image.VolatileImage.getWidth.

Returns the width of the VolatileImage.

public int
getWidth(ImageObserver observer)

Implements abstract java.awt.Image.getWidth.

Determines the width of the image.

public void
public int
validate(GraphicsConfiguration gc)

Implements abstract java.awt.image.VolatileImage.validate.

Attempts to restore the drawing surface of the image if the surface had been lost since the last validate call.

Inherited from java.awt.image.VolatileImage:
getGraphicsgetSourcegetTransparency

Field Detail

compback to summary
protected Component comp
defaultFontback to summary
private Font defaultFont
forcedAccelSurfaceTypeback to summary
private int forcedAccelSurfaceType
graphicsConfigback to summary
private GraphicsConfiguration graphicsConfig
heightback to summary
private int height
volSurfaceManagerback to summary
protected VolatileSurfaceManager volSurfaceManager
widthback to summary
private int width

Constructor Detail

SunVolatileImageback to summary
protected SunVolatileImage(Component comp, GraphicsConfiguration graphicsConfig, int width, int height, Object context, int transparency, ImageCapabilities caps, int accType)
SunVolatileImageback to summary
private SunVolatileImage(Component comp, GraphicsConfiguration graphicsConfig, int width, int height, Object context, ImageCapabilities caps)
SunVolatileImageback to summary
public SunVolatileImage(Component comp, int width, int height)
SunVolatileImageback to summary
public SunVolatileImage(Component comp, int width, int height, Object context)
SunVolatileImageback to summary
public SunVolatileImage(GraphicsConfiguration graphicsConfig, int width, int height, int transparency, ImageCapabilities caps)

Method Detail

contentsLostback to summary
public boolean contentsLost()

Implements abstract java.awt.image.VolatileImage.contentsLost.

Doc from java.awt.image.VolatileImage.contentsLost.

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.

createGraphicsback to summary
public Graphics2D createGraphics()

Implements abstract java.awt.image.VolatileImage.createGraphics.

Doc from java.awt.image.VolatileImage.createGraphics.

Creates a Graphics2D, which can be used to draw into this VolatileImage.

createSurfaceManagerback to summary
private VolatileSurfaceManager createSurfaceManager(Object context, ImageCapabilities caps)
getBackgroundback to summary
private Color getBackground()
getBackupImageback to summary
public BufferedImage getBackupImage()

This method creates a BufferedImage intended for use as a "snapshot" or a backup surface.

getBackupImageback to summary
public BufferedImage getBackupImage(double scaleX, double scaleY)

This method creates a BufferedImage intended for use as a "snapshot" or a backup surface with the given horizontal and vertical scale factors.

getCapabilitiesback to summary
public ImageCapabilities getCapabilities()

Implements abstract java.awt.image.VolatileImage.getCapabilities.

Doc from java.awt.image.VolatileImage.getCapabilities.

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.

getComponentback to summary
public Component getComponent()
getDestSurfaceback to summary
public Surface getDestSurface()

Implements sun.java2d.DestSurfaceProvider.getDestSurface.

Doc from sun.java2d.DestSurfaceProvider.getDestSurface.

Returns a surface currently used as a destination surface for rendering.

Annotations
@Override
See Also
sun.java2d.DestSurfaceProvider#getDestSurface
getFontback to summary
private Font getFont()
getForcedAccelSurfaceTypeback to summary
public int getForcedAccelSurfaceType()
getForegroundback to summary
private Color getForeground()
getGraphicsConfigback to summary
public GraphicsConfiguration getGraphicsConfig()
getHeightback to summary
public int getHeight()

Implements abstract java.awt.image.VolatileImage.getHeight.

Doc from java.awt.image.VolatileImage.getHeight.

Returns the height of the VolatileImage.

getHeightback to summary
public int getHeight(ImageObserver observer)

Implements abstract java.awt.Image.getHeight.

Doc from java.awt.Image.getHeight.

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.

getPropertyback to summary
public Object getProperty(String name, ImageObserver observer)

Implements abstract java.awt.Image.getProperty.

Doc from java.awt.Image.getProperty.

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.

getSnapshotback to summary
public BufferedImage getSnapshot()

Implements abstract java.awt.image.VolatileImage.getSnapshot.

Doc from java.awt.image.VolatileImage.getSnapshot.

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.

getWidthback to summary
public int getWidth()

Implements abstract java.awt.image.VolatileImage.getWidth.

Doc from java.awt.image.VolatileImage.getWidth.

Returns the width of the VolatileImage.

getWidthback to summary
public int getWidth(ImageObserver observer)

Implements abstract java.awt.Image.getWidth.

Doc from java.awt.Image.getWidth.

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.

updateGraphicsConfigback to summary
public void updateGraphicsConfig()
validateback to summary
public int validate(GraphicsConfiguration gc)

Implements abstract java.awt.image.VolatileImage.validate.

Doc from java.awt.image.VolatileImage.validate.

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.