java.awt
Class Component.BltBufferStrategy

java.lang.Object sample code for java.lang.Object definition code for java.lang.Object 
  extended by java.awt.image.BufferStrategy sample code for java.awt.image.BufferStrategy definition code for java.awt.image.BufferStrategy 
      extended by java.awt.Component.BltBufferStrategy
Enclosing class:
Component sample code for java.awt.Component definition code for java.awt.Component

protected class Component.BltBufferStrategy
extends BufferStrategy sample code for java.awt.image.BufferStrategy definition code for java.awt.image.BufferStrategy

Inner class for blitting offscreen surfaces to a component.

Since:
1.4

Field Summary
protected  VolatileImage sample code for java.awt.image.VolatileImage definition code for java.awt.image.VolatileImage [] backBuffers sample code for java.awt.Component.BltBufferStrategy.backBuffers definition code for java.awt.Component.BltBufferStrategy.backBuffers
          The back buffers
protected  BufferCapabilities sample code for java.awt.BufferCapabilities definition code for java.awt.BufferCapabilities caps sample code for java.awt.Component.BltBufferStrategy.caps definition code for java.awt.Component.BltBufferStrategy.caps
          The buffering capabilities
protected  int height sample code for java.awt.Component.BltBufferStrategy.height definition code for java.awt.Component.BltBufferStrategy.height
           
protected  boolean validatedContents sample code for java.awt.Component.BltBufferStrategy.validatedContents definition code for java.awt.Component.BltBufferStrategy.validatedContents
          Whether or not the drawing buffer has been recently restored from a lost state.
protected  int width sample code for java.awt.Component.BltBufferStrategy.width definition code for java.awt.Component.BltBufferStrategy.width
          Size of the back buffers
 
Constructor Summary
protected Component.BltBufferStrategy sample code for java.awt.Component.BltBufferStrategy.Component.BltBufferStrategy(int, java.awt.BufferCapabilities) definition code for java.awt.Component.BltBufferStrategy.Component.BltBufferStrategy(int, java.awt.BufferCapabilities) (int numBuffers, BufferCapabilities sample code for java.awt.BufferCapabilities definition code for java.awt.BufferCapabilities  caps)
          Creates a new blt buffer strategy around a component
 
Method Summary
 boolean contentsLost sample code for java.awt.Component.BltBufferStrategy.contentsLost() definition code for java.awt.Component.BltBufferStrategy.contentsLost() ()
          Returns whether the drawing buffer was lost since the last call to getDrawGraphics.
 boolean contentsRestored sample code for java.awt.Component.BltBufferStrategy.contentsRestored() definition code for java.awt.Component.BltBufferStrategy.contentsRestored() ()
          Returns whether the drawing buffer was recently restored from a lost state and reinitialized to the default background color (white).
protected  void createBackBuffers sample code for java.awt.Component.BltBufferStrategy.createBackBuffers(int) definition code for java.awt.Component.BltBufferStrategy.createBackBuffers(int) (int numBuffers)
          Creates the back buffers
 BufferCapabilities sample code for java.awt.BufferCapabilities definition code for java.awt.BufferCapabilities getCapabilities sample code for java.awt.Component.BltBufferStrategy.getCapabilities() definition code for java.awt.Component.BltBufferStrategy.getCapabilities() ()
           
 Graphics sample code for java.awt.Graphics definition code for java.awt.Graphics getDrawGraphics sample code for java.awt.Component.BltBufferStrategy.getDrawGraphics() definition code for java.awt.Component.BltBufferStrategy.getDrawGraphics() ()
           
protected  void revalidate sample code for java.awt.Component.BltBufferStrategy.revalidate() definition code for java.awt.Component.BltBufferStrategy.revalidate() ()
          Restore the drawing buffer if it has been lost
 void show sample code for java.awt.Component.BltBufferStrategy.show() definition code for java.awt.Component.BltBufferStrategy.show() ()
          Makes the next available buffer visible.
 
Methods inherited from class java.lang.Object sample code for java.lang.Object definition code for java.lang.Object
clone sample code for java.lang.Object.clone() definition code for java.lang.Object.clone() , equals sample code for java.lang.Object.equals(java.lang.Object) definition code for java.lang.Object.equals(java.lang.Object) , finalize sample code for java.lang.Object.finalize() definition code for java.lang.Object.finalize() , getClass sample code for java.lang.Object.getClass() definition code for java.lang.Object.getClass() , hashCode sample code for java.lang.Object.hashCode() definition code for java.lang.Object.hashCode() , notify sample code for java.lang.Object.notify() definition code for java.lang.Object.notify() , notifyAll sample code for java.lang.Object.notifyAll() definition code for java.lang.Object.notifyAll() , toString sample code for java.lang.Object.toString() definition code for java.lang.Object.toString() , wait sample code for java.lang.Object.wait() definition code for java.lang.Object.wait() , wait sample code for java.lang.Object.wait(long) definition code for java.lang.Object.wait(long) , wait sample code for java.lang.Object.wait(long, int) definition code for java.lang.Object.wait(long, int)
 

Field Detail

caps sample code for java.awt.Component.BltBufferStrategy.caps

protected BufferCapabilities sample code for java.awt.BufferCapabilities definition code for java.awt.BufferCapabilities  caps
The buffering capabilities


backBuffers sample code for java.awt.Component.BltBufferStrategy.backBuffers

protected VolatileImage sample code for java.awt.image.VolatileImage definition code for java.awt.image.VolatileImage [] backBuffers
The back buffers


validatedContents sample code for java.awt.Component.BltBufferStrategy.validatedContents

protected boolean validatedContents
Whether or not the drawing buffer has been recently restored from a lost state.


width sample code for java.awt.Component.BltBufferStrategy.width

protected int width
Size of the back buffers


height sample code for java.awt.Component.BltBufferStrategy.height

protected int height
Constructor Detail

Component.BltBufferStrategy sample code for java.awt.Component.BltBufferStrategy(int, java.awt.BufferCapabilities) definition code for java.awt.Component.BltBufferStrategy(int, java.awt.BufferCapabilities)

protected Component.BltBufferStrategy(int numBuffers,
                                      BufferCapabilities sample code for java.awt.BufferCapabilities definition code for java.awt.BufferCapabilities  caps)
Creates a new blt buffer strategy around a component

Parameters:
numBuffers - the component to use as the front buffer
caps - the capabilities of the buffers
Method Detail

createBackBuffers sample code for java.awt.Component.BltBufferStrategy.createBackBuffers(int) definition code for java.awt.Component.BltBufferStrategy.createBackBuffers(int)

protected void createBackBuffers(int numBuffers)
Creates the back buffers


getCapabilities sample code for java.awt.Component.BltBufferStrategy.getCapabilities() definition code for java.awt.Component.BltBufferStrategy.getCapabilities()

public BufferCapabilities sample code for java.awt.BufferCapabilities definition code for java.awt.BufferCapabilities  getCapabilities()
Specified by:
getCapabilities sample code for java.awt.image.BufferStrategy.getCapabilities() definition code for java.awt.image.BufferStrategy.getCapabilities() in class BufferStrategy sample code for java.awt.image.BufferStrategy definition code for java.awt.image.BufferStrategy
Returns:
the buffering capabilities of this strategy

getDrawGraphics sample code for java.awt.Component.BltBufferStrategy.getDrawGraphics() definition code for java.awt.Component.BltBufferStrategy.getDrawGraphics()

public Graphics sample code for java.awt.Graphics definition code for java.awt.Graphics  getDrawGraphics()
Specified by:
getDrawGraphics sample code for java.awt.image.BufferStrategy.getDrawGraphics() definition code for java.awt.image.BufferStrategy.getDrawGraphics() in class BufferStrategy sample code for java.awt.image.BufferStrategy definition code for java.awt.image.BufferStrategy
Returns:
the draw graphics

show sample code for java.awt.Component.BltBufferStrategy.show() definition code for java.awt.Component.BltBufferStrategy.show()

public void show()
Makes the next available buffer visible.

Specified by:
show sample code for java.awt.image.BufferStrategy.show() definition code for java.awt.image.BufferStrategy.show() in class BufferStrategy sample code for java.awt.image.BufferStrategy definition code for java.awt.image.BufferStrategy

revalidate sample code for java.awt.Component.BltBufferStrategy.revalidate() definition code for java.awt.Component.BltBufferStrategy.revalidate()

protected void revalidate()
Restore the drawing buffer if it has been lost


contentsLost sample code for java.awt.Component.BltBufferStrategy.contentsLost() definition code for java.awt.Component.BltBufferStrategy.contentsLost()

public boolean contentsLost()
Description copied from class: BufferStrategy sample code for java.awt.image.BufferStrategy.contentsLost() definition code for java.awt.image.BufferStrategy.contentsLost()
Returns whether the drawing buffer was lost since the last call to getDrawGraphics. Since the buffers in a buffer strategy are usually type VolatileImage, they may become lost. For a discussion on lost buffers, see VolatileImage.

Specified by:
contentsLost sample code for java.awt.image.BufferStrategy.contentsLost() definition code for java.awt.image.BufferStrategy.contentsLost() in class BufferStrategy sample code for java.awt.image.BufferStrategy definition code for java.awt.image.BufferStrategy
Returns:
whether the drawing buffer was lost since the last call to getDrawGraphics
See Also:
VolatileImage sample code for java.awt.image.VolatileImage definition code for java.awt.image.VolatileImage

contentsRestored sample code for java.awt.Component.BltBufferStrategy.contentsRestored() definition code for java.awt.Component.BltBufferStrategy.contentsRestored()

public boolean contentsRestored()
Description copied from class: BufferStrategy sample code for java.awt.image.BufferStrategy.contentsRestored() definition code for java.awt.image.BufferStrategy.contentsRestored()
Returns whether the drawing buffer was recently restored from a lost state and reinitialized to the default background color (white). Since the buffers in a buffer strategy are usually type VolatileImage, they may become lost. If a surface has been recently restored from a lost state since the last call to getDrawGraphics, it may require repainting. For a discussion on lost buffers, see VolatileImage.

Specified by:
contentsRestored sample code for java.awt.image.BufferStrategy.contentsRestored() definition code for java.awt.image.BufferStrategy.contentsRestored() in class BufferStrategy sample code for java.awt.image.BufferStrategy definition code for java.awt.image.BufferStrategy
Returns:
whether the drawing buffer was recently restored from a lost state and reinitialized to the default background color (white)
See Also:
VolatileImage sample code for java.awt.image.VolatileImage definition code for java.awt.image.VolatileImage