java.awt

Class Component.BltBufferStrategy

protected class Component.BltBufferStrategy extends BufferStrategy

This class provides support for blitting offscreen surfaces to a component.

Since: 1.4

See Also:

Field Summary
protected VolatileImage[]backBuffers
The back buffers used in this strategy.
protected BufferCapabilitiescaps
The capabilities of the image buffer.
protected intheight
The height of the back buffers.
protected booleanvalidatedContents
Whether or not the image buffer resources are allocated and ready to be drawn into.
protected intwidth
The width of the back buffers.
Constructor Summary
protected BltBufferStrategy(int numBuffers, BufferCapabilities caps)
Creates a blitting buffer strategy.
Method Summary
booleancontentsLost()
Returns whether or not the image buffer resources have been lost.
booleancontentsRestored()
Returns whether or not the image buffer resources have been restored.
protected voidcreateBackBuffers(int numBuffers)
Initializes the backBuffers field with an array of numBuffers VolatileImages.
BufferCapabilitiesgetCapabilities()
Retrieves the capabilities of this buffer strategy.
GraphicsgetDrawGraphics()
Retrieves a graphics object that can be used to draw into this strategy's image buffer.
protected voidrevalidate()
Re-create the image buffer resources if they've been lost.
voidshow()
Bring the contents of the back buffer to the front buffer.

Field Detail

backBuffers

protected VolatileImage[] backBuffers
The back buffers used in this strategy.

caps

protected BufferCapabilities caps
The capabilities of the image buffer.

height

protected int height
The height of the back buffers.

validatedContents

protected boolean validatedContents
Whether or not the image buffer resources are allocated and ready to be drawn into.

width

protected int width
The width of the back buffers.

Constructor Detail

BltBufferStrategy

protected BltBufferStrategy(int numBuffers, BufferCapabilities caps)
Creates a blitting buffer strategy.

Parameters: numBuffers the number of buffers, including the front buffer caps the capabilities of this strategy

Method Detail

contentsLost

public boolean contentsLost()
Returns whether or not the image buffer resources have been lost.

Returns: true if the resources have been lost, false otherwise

contentsRestored

public boolean contentsRestored()
Returns whether or not the image buffer resources have been restored.

Returns: true if the resources have been restored, false otherwise

createBackBuffers

protected void createBackBuffers(int numBuffers)
Initializes the backBuffers field with an array of numBuffers VolatileImages.

Parameters: numBuffers the number of backbuffers to create

getCapabilities

public BufferCapabilities getCapabilities()
Retrieves the capabilities of this buffer strategy.

Returns: the capabilities of this buffer strategy

getDrawGraphics

public Graphics getDrawGraphics()
Retrieves a graphics object that can be used to draw into this strategy's image buffer.

Returns: a graphics object

revalidate

protected void revalidate()
Re-create the image buffer resources if they've been lost.

show

public void show()
Bring the contents of the back buffer to the front buffer.