java.awt
Class Component.SingleBufferStrategy
java.lang.Object
java.awt.image.BufferStrategy
java.awt.Component.SingleBufferStrategy
- Enclosing class:
- Component
- private class Component.SingleBufferStrategy
- extends BufferStrategy
Inner class for flipping buffers on a component. That component must
be a Canvas
or Window
.
- Since:
- 1.4
- Author:
- Michael Martak
- See Also:
Canvas
,
Window
,
BufferStrategy
Method Summary |
boolean |
contentsLost()
Returns whether the drawing buffer was lost since the last call to
getDrawGraphics . |
boolean |
contentsRestored()
Returns whether the drawing buffer was recently restored from a lost
state and reinitialized to the default background color (white).
|
BufferCapabilities |
getCapabilities()
|
Graphics |
getDrawGraphics()
|
void |
show()
Makes the next available buffer visible by either copying the memory
(blitting) or changing the display pointer (flipping). |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
caps
private BufferCapabilities caps
Component.SingleBufferStrategy
public Component.SingleBufferStrategy(BufferCapabilities caps)
getCapabilities
public BufferCapabilities getCapabilities()
- Specified by:
getCapabilities
in class BufferStrategy
- Returns:
- the buffering capabilities of this strategy
getDrawGraphics
public Graphics getDrawGraphics()
- Specified by:
getDrawGraphics
in class BufferStrategy
- Returns:
- the graphics on the drawing buffer. This method may not
be synchronized for performance reasons; use of this method by multiple
threads should be handled at the application level. Disposal of the
graphics object obtained must be handled by the application.
contentsLost
public boolean contentsLost()
- Description copied from class:
BufferStrategy
- Returns whether the drawing buffer was lost since the last call to
getDrawGraphics
. Since the buffers in a buffer strategy
are usually type VolatileImage
, they may become lost.
For a discussion on lost buffers, see VolatileImage
.
- Specified by:
contentsLost
in class BufferStrategy
- See Also:
VolatileImage
contentsRestored
public boolean contentsRestored()
- Description copied from class:
BufferStrategy
- Returns whether the drawing buffer was recently restored from a lost
state and reinitialized to the default background color (white).
Since the buffers in a buffer strategy are usually type
VolatileImage
, they may become lost. If a surface has
been recently restored from a lost state since the last call to
getDrawGraphics
, it may require repainting.
For a discussion on lost buffers, see VolatileImage
.
- Specified by:
contentsRestored
in class BufferStrategy
- See Also:
VolatileImage
show
public void show()
- Description copied from class:
BufferStrategy
- Makes the next available buffer visible by either copying the memory
(blitting) or changing the display pointer (flipping).
- Specified by:
show
in class BufferStrategy