com.tensegrity.composite.util
Interface RepaintBuffer

All Known Implementing Classes:
RamRepaintBuffer

public interface RepaintBuffer

This interface is an abstraction from a raster or image buffer.

Version:
$Id: RepaintBuffer.java,v 1.2 2004/02/09 13:06:51 sr Exp $
Author:
StepanRutz

Method Summary
 void drawBufferContents(java.lang.Object graphicsContext, int x, int y)
          Draws the contents of the buffer.
 void drawIntoBuffer(Renderer renderer, CompositeView compositeview, int drawflags)
          Draws the specified items from the given CompositeView into the buffer.
 void flush()
          Tells the RepaintBuffer instance to let go of system resources.
 java.lang.Object getBuffer()
          Returns the internal buffer object, which may be of an arbitrary type
 int getContent()
          Returns the mask of flags that indicates what has been drawn into the buffer up to this point in time.
 int getHeight()
          Returns the height of the buffer in pixels.
 int getWidth()
          Returns the width of the buffer in pixels.
 void prepare()
          Prepares sets up the buffer for rendering.
 void unprepare()
          Unprepares closes the buffer for rendering.
 

Method Detail

getContent

public int getContent()
Returns the mask of flags that indicates what has been drawn into the buffer up to this point in time.

The mask is assembled from the bits defined in CompositeView. The valid bits are prefixed with DRAWFLAG*.

Returns:
current contents of the buffer as a bitmask.

getWidth

public int getWidth()
Returns the width of the buffer in pixels.

Returns:
the width of the buffer in pixels.

getHeight

public int getHeight()
Returns the height of the buffer in pixels.

Returns:
the height of the buffer in pixels.

getBuffer

public java.lang.Object getBuffer()
Returns the internal buffer object, which may be of an arbitrary type

Returns:
the internal buffer object, which may be of an arbitrary type.

flush

public void flush()
Tells the RepaintBuffer instance to let go of system resources. Details are up to the concrete implementation.


prepare

public void prepare()
Prepares sets up the buffer for rendering. A call to this method should be made before invoking drawIntoBuffer(Renderer, CompositeView, int) one of more times.


unprepare

public void unprepare()
Unprepares closes the buffer for rendering. A call to this method should be made after invoking drawIntoBuffer(Renderer, CompositeView, int) one of more times.


drawIntoBuffer

public void drawIntoBuffer(Renderer renderer,
                           CompositeView compositeview,
                           int drawflags)
Draws the specified items from the given CompositeView into the buffer. The parameter drawflags defines what to draw and is assembled from the bitmasks defined in CompositeView and prefixed with DRAWFLAG.

Parameters:
renderer - the Renderer to use for drawing.
compositeview - the CompositeView whose contents should be drawn into the buffer.
drawflags - determines what is to be drawn into the buffer.

drawBufferContents

public void drawBufferContents(java.lang.Object graphicsContext,
                               int x,
                               int y)
Draws the contents of the buffer.

Parameters:
graphicsContext - a graphics context, the type depends on the drawing subsystem.
x - x position where to draw the buffer.
y - y position where to draw the buffer.


Copyright © 2005 Tensegrity Software GmbH. All Rights Reserved. Date of creation: 09.06.2006.