所有类


java.awt
类 Component.FlipBufferStrategy

java.lang.Object
  继承者 java.awt.image.BufferStrategy
      继承者 java.awt.Component.FlipBufferStrategy
正在封闭类:
Component

protected class Component.FlipBufferStrategy
   
   
   
   
   
extends BufferStrategy

在组件上翻转缓冲区的内部类。该组件必须是 CanvasWindow

从以下版本开始:
1.4
另请参见:
Canvas, Window, BufferStrategy

字段摘要
protected  BufferCapabilitiescaps
          缓冲容量。
protected  ImagedrawBuffer
          绘制缓冲区。
protected  VolatileImagedrawVBuffer
          作为可变图像的绘制缓冲区。
protected  intnumBuffers
          缓冲区的数目。
protected  booleanvalidatedContents
          绘制缓冲区是否已从最近的丢失状态还原。
 
构造方法摘要
protected Component.FlipBufferStrategy(int numBuffers, BufferCapabilities caps)
          为此组件创建新的反转缓冲区策略。
 
方法摘要
 booleancontentsLost()
          返回上次调用 getDrawGraphics 后绘制缓冲区是否丢失。
 booleancontentsRestored()
          返回绘制缓冲区最近是否从丢失状态恢复,并重新初始化为默认背景色(白色)。
protected  voidcreateBuffers(int numBuffers, BufferCapabilities caps)
          创建一个或多个具有给定容量的、复杂的反转缓冲区。
protected  voiddestroyBuffers()
          销毁通过此对象所创建的缓冲区。
protected  voidflip(BufferCapabilities.FlipContents flipAction)
          将底层缓冲区的内容反转移动到前台缓冲区,可通过复制或移动视频指针来执行。
protected  ImagegetBackBuffer()
           
 BufferCapabilitiesgetCapabilities()
           
 GraphicsgetDrawGraphics()
           
protected  voidrevalidate()
          如果绘制缓冲区已丢失,将其还原。
 voidshow()
          通过位图传送或反转,使下一个可用的缓冲区可见。
 
从类 java.lang.Object 继承的方法
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

字段详细信息

numBuffers

protected int numBuffers
缓冲区的数目。


caps

protected BufferCapabilities caps
缓冲容量。


drawBuffer

protected Image drawBuffer
绘制缓冲区。


drawVBuffer

protected VolatileImage drawVBuffer
作为可变图像的绘制缓冲区。


validatedContents

protected boolean validatedContents
绘制缓冲区是否已从最近的丢失状态还原。

构造方法详细信息

Component.FlipBufferStrategy

protected Component.FlipBufferStrategy(int numBuffers,
                                       BufferCapabilities caps)
                                throws AWTException
为此组件创建新的反转缓冲区策略。该组件必须是 CanvasWindow

参数:
numBuffers - 缓冲区的数目
caps - 缓冲区的容量
抛出:
AWTException - 如果不支持或无法满足所提供的容量
ClassCastException - 如果该组件不是 canvas 或 window。
另请参见:
Canvas, Window
方法详细信息

createBuffers

protected void createBuffers(int numBuffers,
                             BufferCapabilities caps)
                      throws AWTException
创建一个或多个具有给定容量的、复杂的反转缓冲区。

参数:
numBuffers - 要创建的缓冲区的数目;必须大于 1
caps - 缓冲区的容量。BufferCapabilities.isPageFlipping 必须为 true
抛出:
AWTException - 如果不支持或无法满足所提供的容量
IllegalStateException - 如果组件没有同位体
IllegalArgumentException - 如果 numBuffers 小于 2,或者 BufferCapabilities.isPageFlipping 不为 true
另请参见:
BufferCapabilities.isPageFlipping()

getBackBuffer

protected Image getBackBuffer()
返回:
直接访问作为图像的底层缓冲区。
抛出:
IllegalStateException - 如果尚未创建该缓冲区

flip

protected void flip(BufferCapabilities.FlipContents flipAction)
将底层缓冲区的内容反转移动到前台缓冲区,可通过复制或移动视频指针来执行。

参数:
flipAction - 一个整数值,用于描述底层缓冲区内容的反转操作。这应该是 BufferCapabilities.FlipContents 属性值之一。
抛出:
IllegalStateException - 如果尚未创建该缓冲区
另请参见:
BufferCapabilities.getFlipContents()