1/* 2 * Licensed to the Apache Software Foundation (ASF) under one or more 3 * contributor license agreements. See the NOTICE file distributed with 4 * this work for additional information regarding copyright ownership. 5 * The ASF licenses this file to You under the Apache License, Version 2.0 6 * (the "License"); you may not use this file except in compliance with 7 * the License. You may obtain a copy of the License at 8 * 9 * http://www.apache.org/licenses/LICENSE-2.0 10 * 11 * Unless required by applicable law or agreed to in writing, software 12 * distributed under the License is distributed on an "AS IS" BASIS, 13 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 * See the License for the specific language governing permissions and 15 * limitations under the License. 16 */ 17/** 18 * @author Igor V. Stolyarov 19 * @version $Revision$ 20 */ 21 22package java.awt.image; 23 24import java.awt.BufferCapabilities; 25import java.awt.Graphics; 26 27/** 28 * The BufferStrategy abstract class provides an opportunity to organize the 29 * buffers for a Canvas or Window. The BufferStrategy implementation depends on 30 * hardware and software limitations. These limitations are detectable through 31 * the capabilities object which can be obtained by the GraphicsConfiguration of 32 * the Canvas or Window. 33 * 34 * @since Android 1.0 35 */ 36public abstract class BufferStrategy { 37 38 /** 39 * Returns true if the drawing buffer was lost since the last call of 40 * getDrawGraphics. 41 * 42 * @return true if the drawing buffer was lost since the last call of 43 * getDrawGraphics, false otherwise. 44 */ 45 public abstract boolean contentsLost(); 46 47 /** 48 * Returns true if the drawing buffer is restored from a lost state. 49 * 50 * @return true if the drawing buffer is restored from a lost state, false 51 * otherwise. 52 */ 53 public abstract boolean contentsRestored(); 54 55 /** 56 * Gets the BufferCapabilities of BufferStrategy. 57 * 58 * @return the BufferCapabilities of BufferStrategy. 59 */ 60 public abstract BufferCapabilities getCapabilities(); 61 62 /** 63 * Gets the Graphics object to use to draw to the buffer. 64 * 65 * @return the Graphics object to use to draw to the buffer. 66 */ 67 public abstract Graphics getDrawGraphics(); 68 69 /** 70 * Shows the next available buffer. 71 */ 72 public abstract void show(); 73 74} 75