|
Java example source code file (BufferCapabilities.java)
The BufferCapabilities.java Java example source code/*
* Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
package java.awt;
/**
* Capabilities and properties of buffers.
*
* @see java.awt.image.BufferStrategy#getCapabilities()
* @see GraphicsConfiguration#getBufferCapabilities
* @author Michael Martak
* @since 1.4
*/
public class BufferCapabilities implements Cloneable {
private ImageCapabilities frontCaps;
private ImageCapabilities backCaps;
private FlipContents flipContents;
/**
* Creates a new object for specifying buffering capabilities
* @param frontCaps the capabilities of the front buffer; cannot be
* <code>null
* @param backCaps the capabilities of the back and intermediate buffers;
* cannot be <code>null
* @param flipContents the contents of the back buffer after page-flipping,
* <code>null if page flipping is not used (implies blitting)
* @exception IllegalArgumentException if frontCaps or backCaps are
* <code>null
*/
public BufferCapabilities(ImageCapabilities frontCaps,
ImageCapabilities backCaps, FlipContents flipContents) {
if (frontCaps == null || backCaps == null) {
throw new IllegalArgumentException(
"Image capabilities specified cannot be null");
}
this.frontCaps = frontCaps;
this.backCaps = backCaps;
this.flipContents = flipContents;
}
/**
* @return the image capabilities of the front (displayed) buffer
*/
public ImageCapabilities getFrontBufferCapabilities() {
return frontCaps;
}
/**
* @return the image capabilities of all back buffers (intermediate buffers
* are considered back buffers)
*/
public ImageCapabilities getBackBufferCapabilities() {
return backCaps;
}
/**
* @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, <code>getFlipContents returns
* <code>null
*/
public boolean isPageFlipping() {
return (getFlipContents() != null);
}
/**
* @return the resulting contents of the back buffer after page-flipping.
* This value is <code>null when the
Other Java examples (source code examples)Here is a short list of links related to this Java BufferCapabilities.java source code file: |
... this post is sponsored by my books ... | |
#1 New Release! |
FP Best Seller |
Copyright 1998-2021 Alvin Alexander, alvinalexander.com
All Rights Reserved.
A percentage of advertising revenue from
pages under the /java/jwarehouse
URI on this website is
paid back to open source projects.