java.awt
Class Component.BltBufferStrategy

java.lang.Object
  extended by java.awt.image.BufferStrategy
      extended by java.awt.Component.BltBufferStrategy
Enclosing class:
Component

protected class Component.BltBufferStrategy
extends BufferStrategy

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

Since:
1.4
See Also:
BufferStrategy

Field Summary
protected  VolatileImage[] backBuffers
          The back buffers used in this strategy.
protected  BufferCapabilities caps
          The capabilities of the image buffer.
protected  int height
          The height of the back buffers.
protected  boolean validatedContents
          Whether or not the image buffer resources are allocated and ready to be drawn into.
protected  int width
          The width of the back buffers.
 
Constructor Summary
protected Component.BltBufferStrategy(int numBuffers, BufferCapabilities caps)
          Creates a blitting buffer strategy.
 
Method Summary
 boolean contentsLost()
          Returns whether or not the image buffer resources have been lost.
 boolean contentsRestored()
          Returns whether or not the image buffer resources have been restored.
protected  void createBackBuffers(int numBuffers)
          Initializes the backBuffers field with an array of numBuffers VolatileImages.
 BufferCapabilities getCapabilities()
          Retrieves the capabilities of this buffer strategy.
 Graphics getDrawGraphics()
          Retrieves a graphics object that can be used to draw into this strategy's image buffer.
protected  void revalidate()
          Re-create the image buffer resources if they've been lost.
 void show()
          Bring the contents of the back buffer to the front buffer.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

caps

protected BufferCapabilities caps
The capabilities of the image buffer.


backBuffers

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


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.


height

protected int height
The height of the back buffers.

Constructor Detail

Component.BltBufferStrategy

protected Component.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

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.

Specified by:
getCapabilities in class BufferStrategy
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.

Specified by:
getDrawGraphics in class BufferStrategy
Returns:
a graphics object

show

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

Specified by:
show in class BufferStrategy

revalidate

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


contentsLost

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

Specified by:
contentsLost in class BufferStrategy
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.

Specified by:
contentsRestored in class BufferStrategy
Returns:
true if the resources have been restored, false otherwise