|
JavaTM 2 Platform Standard Ed. 6 |
|||||||||
| 上一個類別 下一個類別 | 框架 無框架 | |||||||||
| 摘要: 巢狀 | 欄位 | 建構子 | 方法 | 詳細資訊: 欄位 | 建構子 | 方法 | |||||||||
java.lang.Objectjava.awt.image.BufferStrategy
java.awt.Component.FlipBufferStrategy
protected class Component.FlipBufferStrategy
在元件上翻轉緩衝區的內部類別。該元件必須是 Canvas 或 Window。
Canvas,
Window,
BufferStrategy| 欄位摘要 | |
|---|---|
protected BufferCapabilities |
caps
緩衝能力。 |
protected Image |
drawBuffer
繪製緩衝區。 |
protected VolatileImage |
drawVBuffer
作為可變圖像的繪製緩衝區。 |
protected int |
numBuffers
緩衝區的數目。 |
protected boolean |
validatedContents
繪製緩衝區是否已從最近的丟失狀態還原。 |
| 建構子摘要 | |
|---|---|
protected |
Component.FlipBufferStrategy(int numBuffers,
BufferCapabilities caps)
為此元件創建新的翻轉緩衝區策略。 |
| 方法摘要 | |
|---|---|
boolean |
contentsLost()
返回上次調用 getDrawGraphics 後繪製緩衝區是否丟失。 |
boolean |
contentsRestored()
返回繪製緩衝區最近是否從丟失狀態恢復,並重新初始化為預設背景色(白色)。 |
protected void |
createBuffers(int numBuffers,
BufferCapabilities caps)
創建一個或多個具有給定能力的、複雜的翻轉緩衝區。 |
protected void |
destroyBuffers()
銷毀通過此物件所創建的緩衝區。 |
void |
dispose()
釋放當前由此 BufferStrategy 使用的系統資源,並從關聯 Component 中移除它們。 |
protected void |
flip(BufferCapabilities.FlipContents flipAction)
將底層緩衝區的內容翻轉移動到前台緩衝區,可通過複製或移動視頻指針來執行。 |
protected Image |
getBackBuffer()
|
BufferCapabilities |
getCapabilities()
返回此 BufferStrategy 的 BufferCapabilities。 |
Graphics |
getDrawGraphics()
創建用於繪製緩衝區的圖形上下文。 |
protected void |
revalidate()
如果繪製緩衝區已丟失,則將其還原。 |
void |
show()
通過位圖傳送或翻轉,使下一個可用的緩衝區可見。 |
| 從類別 java.lang.Object 繼承的方法 |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| 欄位詳細資訊 |
|---|
protected int numBuffers
protected BufferCapabilities caps
protected Image drawBuffer
protected VolatileImage drawVBuffer
protected boolean validatedContents
| 建構子詳細資訊 |
|---|
protected Component.FlipBufferStrategy(int numBuffers,
BufferCapabilities caps)
throws AWTException
Canvas 或 Window。
numBuffers - 緩衝區的數目caps - 緩衝區的能力
AWTException - 如果不支持或無法滿足所提供的能力
ClassCastException - 如果該元件不是 canvas 或 window。Canvas,
Window| 方法詳細資訊 |
|---|
protected void createBuffers(int numBuffers,
BufferCapabilities caps)
throws AWTException
numBuffers - 要創建的緩衝區數;必須大於 1caps - 緩衝區的能力。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。
BufferStrategy 中的 getCapabilitiespublic Graphics getDrawGraphics()
BufferStrategy 複製的描述
BufferStrategy 中的 getDrawGraphicsprotected void revalidate()
public boolean contentsLost()
BufferStrategy 複製的描述getDrawGraphics 後繪製緩衝區是否丟失。由於使用緩衝區策略的緩衝區通常是 VolatileImage 型別的,因此它們有可能丟失。有關對丟失緩衝區的討論,請參閱 VolatileImage。
BufferStrategy 中的 contentsLostgetDrawGraphics 後是否丟失了繪製緩衝區。VolatileImagepublic boolean contentsRestored()
BufferStrategy 複製的描述VolatileImage 型別的,因此它們有可能丟失。如果上次調用 getDrawGraphics 後,緩衝區最近已從丟失狀態恢復,則緩衝區可能要求重新繪製。有關對丟失緩衝區的討論,請參閱 VolatileImage。
BufferStrategy 中的 contentsRestoredVolatileImagepublic void show()
BufferStrategy 中的 showpublic void dispose()
BufferStrategy 使用的系統資源,並從關聯 Component 中移除它們。在調用此方法之後,getBufferStrategy 將返回 null。試圖在釋放 BufferStrategy 後使用它將導致不確定的行為。
BufferStrategy 中的 disposeComponent.createBufferStrategy(int),
Component.getBufferStrategy()
|
JavaTM 2 Platform Standard Ed. 6 |
|||||||||
| 上一個類別 下一個類別 | 框架 無框架 | |||||||||
| 摘要: 巢狀 | 欄位 | 建構子 | 方法 | 詳細資訊: 欄位 | 建構子 | 方法 | |||||||||
版權所有 2008 Sun Microsystems, Inc. 保留所有權利。請遵守GNU General Public License, version 2 only。