java.awt
Class BufferCapabilities

java.lang.Object
  extended by java.awt.BufferCapabilities
All Implemented Interfaces:
Cloneable

public class BufferCapabilities
extends Object
implements Cloneable

A double-buffering capability descriptor. This class exposes details about the double-buffering algorithms used by image buffers. BufferCapabilities represents algorithms that involve at least two buffers but it can also specify so-called "multi-buffer" schemes involving more than two buffers. This class describes the capabilities of the front and back buffers as well as the results of "flipping" -- that is, what happens when an image is transferred from the back buffer to the front buffer. Flipping may or may not be supported or may be supported only in fullscreen mode. If it is not supported then "blitting" is implied -- that is, the contents of the back buffer are copied using a fast block transfer operation from the back buffer to the front buffer. The front buffer is the one that is displayed.

Since:
1.4
See Also:
BufferStrategy.getCapabilities(), GraphicsConfiguration.getBufferCapabilities()

Nested Class Summary
static class BufferCapabilities.FlipContents
          A type-safe enumeration of buffer flipping results.
 
Constructor Summary
BufferCapabilities(ImageCapabilities frontCaps, ImageCapabilities backCaps, BufferCapabilities.FlipContents flip)
          Creates a buffer capabilities object.
 
Method Summary
 Object clone()
          Clone this buffering capability descriptor.
 ImageCapabilities getBackBufferCapabilities()
          Retrieve the back buffer's image capabilities.
 BufferCapabilities.FlipContents getFlipContents()
          Retrieve the result of a flipping operation.
 ImageCapabilities getFrontBufferCapabilities()
          Retrieve the front buffer's image capabilities.
 boolean isFullScreenRequired()
          Returns true if flipping is only supported in fullscreen mode.
 boolean isMultiBufferAvailable()
          Returns true if flipping can involve more than two buffers.
 boolean isPageFlipping()
          Return whether or not flipping is supported.
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BufferCapabilities

public BufferCapabilities(ImageCapabilities frontCaps,
                          ImageCapabilities backCaps,
                          BufferCapabilities.FlipContents flip)
Creates a buffer capabilities object.

Parameters:
frontCaps - front buffer capabilities descriptor
backCaps - back buffer capabilities descriptor
flip - the results of a flip operation or null if flipping is not supported
Throws:
IllegalArgumentException - if frontCaps or backCaps is null
Method Detail

getFrontBufferCapabilities

public ImageCapabilities getFrontBufferCapabilities()
Retrieve the front buffer's image capabilities.

Returns:
the front buffer's image capabilities

getBackBufferCapabilities

public ImageCapabilities getBackBufferCapabilities()
Retrieve the back buffer's image capabilities.

Returns:
the back buffer's image capabilities

isPageFlipping

public boolean isPageFlipping()
Return whether or not flipping is supported.

Returns:
true if flipping is supported, false otherwise

getFlipContents

public BufferCapabilities.FlipContents getFlipContents()
Retrieve the result of a flipping operation. If this method returns null then flipping is not supported. This implies that "blitting", a fast block transfer, is used to copy the contents of the back buffer to the front buffer. Other possible return values are:

Returns:
the result of a flipping operation or null if flipping is not supported

isFullScreenRequired

public boolean isFullScreenRequired()
Returns true if flipping is only supported in fullscreen mode.

Returns:
true if flipping is only supported in fullscreen mode, false otherwise

isMultiBufferAvailable

public boolean isMultiBufferAvailable()
Returns true if flipping can involve more than two buffers. One or more intermediate buffers may be available in addition to the front and back buffers.

Returns:
true if there are more than two buffers available for flipping, false otherwise

clone

public Object clone()
Clone this buffering capability descriptor.

Overrides:
clone in class Object
Returns:
a clone of this buffer capability descriptor
See Also:
Cloneable