FileDocCategorySizeDatePackage
BufferCapabilities.javaAPI DocJava SE 6 API6508Tue Jun 10 00:25:12 BST 2008java.awt

BufferCapabilities

public class BufferCapabilities extends Object implements Cloneable
Capabilities and properties of buffers.
see
java.awt.image.BufferStrategy#getCapabilities()
see
GraphicsConfiguration#getBufferCapabilities
author
Michael Martak
since
1.4

Fields Summary
private ImageCapabilities
frontCaps
private ImageCapabilities
backCaps
private FlipContents
flipContents
Constructors Summary
public BufferCapabilities(ImageCapabilities frontCaps, ImageCapabilities backCaps, FlipContents flipContents)
Creates a new object for specifying buffering capabilities

param
frontCaps the capabilities of the front buffer; cannot be null
param
backCaps the capabilities of the back and intermediate buffers; cannot be null
param
flipContents the contents of the back buffer after page-flipping, null if page flipping is not used (implies blitting)
exception
IllegalArgumentException if frontCaps or backCaps are null

        if (frontCaps == null || backCaps == null) {
            throw new IllegalArgumentException(
                "Image capabilities specified cannot be null");
        }
        this.frontCaps = frontCaps;
        this.backCaps = backCaps;
        this.flipContents = flipContents;
    
Methods Summary
public java.lang.Objectclone()

return
a copy of this BufferCapabilities object.

        try {
            return super.clone();
        } catch (CloneNotSupportedException e) {
            // Since we implement Cloneable, this should never happen
            throw new InternalError();
        }
    
public java.awt.ImageCapabilitiesgetBackBufferCapabilities()

return
the image capabilities of all back buffers (intermediate buffers are considered back buffers)

        return backCaps;
    
public java.awt.BufferCapabilities$FlipContentsgetFlipContents()

return
the resulting contents of the back buffer after page-flipping. This value is null when the isPageFlipping returns false, implying blitting. It can be one of FlipContents.UNDEFINED (the assumed default), FlipContents.BACKGROUND, FlipContents.PRIOR, or FlipContents.COPIED.
see
#isPageFlipping
see
FlipContents#UNDEFINED
see
FlipContents#BACKGROUND
see
FlipContents#PRIOR
see
FlipContents#COPIED

        return flipContents;
    
public java.awt.ImageCapabilitiesgetFrontBufferCapabilities()

return
the image capabilities of the front (displayed) buffer

        return frontCaps;
    
public booleanisFullScreenRequired()

return
whether page flipping is only available in full-screen mode. If this is true, full-screen exclusive mode is required for page-flipping.
see
#isPageFlipping
see
GraphicsDevice#setFullScreenWindow

        return false;
    
public booleanisMultiBufferAvailable()

return
whether or not page flipping can be performed using more than two buffers (one or more intermediate buffers as well as the front and back buffer).
see
#isPageFlipping

        return false;
    
public booleanisPageFlipping()

return
whether or not the buffer strategy uses page flipping; a set of buffers that uses page flipping can swap the contents internally between the front buffer and one or more back buffers by switching the video pointer (or by copying memory internally). A non-flipping set of buffers uses blitting to copy the contents from one buffer to another; when this is the case, getFlipContents returns null

        return (getFlipContents() != null);