protected class Component.FlipBufferStrategy extends BufferStrategy
Canvas
或
Window
。
Canvas
,
Window
,
BufferStrategy
Modifier and Type | Field and Description |
---|---|
protected BufferCapabilities |
caps
缓冲能力
|
protected Image |
drawBuffer
牵引缓冲装置
|
protected VolatileImage |
drawVBuffer
作为一个波动图像的绘制缓冲区
|
protected int |
numBuffers
缓冲区数
|
protected boolean |
validatedContents
是否绘图缓冲区最近已从一个丢失的状态恢复。
|
Modifier | Constructor and Description |
---|---|
protected |
FlipBufferStrategy(int numBuffers, BufferCapabilities caps)
为该组件创建一个新的翻转缓冲策略。
|
Modifier and Type | Method and Description |
---|---|
boolean |
contentsLost()
返回是否绘制缓冲区是因为
getDrawGraphics 最后呼叫丢失。
|
boolean |
contentsRestored()
返回是否绘制缓冲区最近从迷失状态和初始化为默认背景色恢复(白色)。
|
protected void |
createBuffers(int numBuffers, BufferCapabilities caps)
创建一个或多个复杂的,具有给定功能的翻转缓冲区。
|
protected void |
destroyBuffers()
破坏通过此对象创建的缓冲区
|
void |
dispose()
释放系统资源的消耗,目前这
BufferStrategy 删除它的相关部件。
|
protected void |
flip(BufferCapabilities.FlipContents flipAction)
翻转将缓冲区的内容移动到前缓冲区,通过复制或通过移动视频指针。
|
protected Image |
getBackBuffer() |
BufferCapabilities |
getCapabilities()
返回此
BufferStrategy 的
BufferCapabilities 。
|
Graphics |
getDrawGraphics()
为绘图缓冲区创建一个图形上下文。
|
protected void |
revalidate()
恢复绘图缓冲区,如果它已丢失
|
void |
show()
使下一个可用的缓冲区的位图或翻转可见。
|
protected int numBuffers
protected BufferCapabilities caps
protected Image drawBuffer
protected VolatileImage drawVBuffer
protected boolean validatedContents
protected FlipBufferStrategy(int numBuffers, BufferCapabilities caps) throws AWTException
Canvas
或
Window
。
numBuffers
-缓冲区数
caps
的缓冲能力
AWTException
如果能力提供不能支持或遇到
ClassCastException
如果组件不是帆布或窗口。
IllegalStateException
如果组件没有同伴
IllegalArgumentException
-如果
numBuffers
小于2,或如果
BufferCapabilities.isPageFlipping
不
true
。
Canvas
,
Window
,
createBuffers(int, BufferCapabilities)
protected void createBuffers(int numBuffers, BufferCapabilities caps) throws AWTException
numBuffers
-数量的缓冲区创建;必须大于一个
caps
的缓冲能力。
BufferCapabilities.isPageFlipping
必须
true
。
AWTException
如果能力提供不能支持或遇到
IllegalStateException
如果组件没有同伴
IllegalArgumentException
-如果numbuffers小于2,或如果
BufferCapabilities.isPageFlipping
不
true
。
BufferCapabilities.isPageFlipping()
protected Image getBackBuffer()
IllegalStateException
如果还没有创建
protected void flip(BufferCapabilities.FlipContents flipAction)
flipAction
-一个整数描述的后台缓冲区的内容翻转动作。这应该是对
BufferCapabilities.FlipContents
属性值。
IllegalStateException
如果还没有创建
BufferCapabilities.getFlipContents()
protected void destroyBuffers()
public BufferCapabilities getCapabilities()
BufferStrategy
BufferStrategy
的
BufferCapabilities
。
getCapabilities
方法重写,继承类
BufferStrategy
public Graphics getDrawGraphics()
BufferStrategy
getDrawGraphics
方法重写,继承类
BufferStrategy
protected void revalidate()
public boolean contentsLost()
BufferStrategy
getDrawGraphics
最后呼叫丢失。因为在缓冲战略缓冲区通常型
VolatileImage
,他们可能会失去。在失去了缓冲区的讨论,看
VolatileImage
。
contentsLost
方法重写,继承类
BufferStrategy
getDrawGraphics
最后呼叫丢失
VolatileImage
public boolean contentsRestored()
BufferStrategy
VolatileImage
,他们可能会失去。如果一个表面最近已经从失去的状态因为
getDrawGraphics
最后呼吁恢复,可能需要重新粉刷。在失去了缓冲区的讨论,看
VolatileImage
。
contentsRestored
方法重写,继承类
BufferStrategy
VolatileImage
public void show()
show
方法重写,继承类
BufferStrategy
public void dispose()
BufferStrategy
删除它的相关部件。调用此方法后,
getBufferStrategy
将返回null。试图在已设置使用
BufferStrategy
将导致未定义的行为。
dispose
方法重写,继承类
BufferStrategy
Window.createBufferStrategy(int)
,
Canvas.createBufferStrategy(int)
,
Window.getBufferStrategy()
,
Canvas.getBufferStrategy()
Submit a bug or feature
For further API reference and developer documentation, see Java SE Documentation. That documentation contains more detailed, developer-targeted descriptions, with conceptual overviews, definitions of terms, workarounds, and working code examples.
Copyright © 1993, 2014, Oracle and/or its affiliates. All rights reserved.