com.tensegrity.composite.util
Class RamRepaintBuffer

java.lang.Object
  extended bycom.tensegrity.composite.util.RamRepaintBuffer
All Implemented Interfaces:
RepaintBuffer

public class RamRepaintBuffer
extends java.lang.Object
implements RepaintBuffer

This class is a concrete implementation of the RepaintBuffer interface.

This implementation is for jdk1.3 and uses a BufferedImage internally.

Version:
$Id: RamRepaintBuffer.java,v 1.3 2004/02/13 10:38:43 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.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getContent

public final int getContent()
Description copied from interface: RepaintBuffer
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*.

Specified by:
getContent in interface RepaintBuffer
Returns:
current contents of the buffer as a bitmask.

getWidth

public final int getWidth()
Description copied from interface: RepaintBuffer
Returns the width of the buffer in pixels.

Specified by:
getWidth in interface RepaintBuffer
Returns:
the width of the buffer in pixels.

getHeight

public final int getHeight()
Description copied from interface: RepaintBuffer
Returns the height of the buffer in pixels.

Specified by:
getHeight in interface RepaintBuffer
Returns:
the height of the buffer in pixels.

getBuffer

public java.lang.Object getBuffer()
Description copied from interface: RepaintBuffer
Returns the internal buffer object, which may be of an arbitrary type

Specified by:
getBuffer in interface RepaintBuffer
Returns:
the internal buffer object, which may be of an arbitrary type.

flush

public final void flush()
Description copied from interface: RepaintBuffer
Tells the RepaintBuffer instance to let go of system resources. Details are up to the concrete implementation.

Specified by:
flush in interface RepaintBuffer

prepare

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

Specified by:
prepare in interface RepaintBuffer

unprepare

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

Specified by:
unprepare in interface RepaintBuffer

drawIntoBuffer

public final void drawIntoBuffer(Renderer renderer,
                                 CompositeView compositeview,
                                 int drawflags)
Description copied from interface: RepaintBuffer
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.

Specified by:
drawIntoBuffer in interface RepaintBuffer
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 final void drawBufferContents(java.lang.Object graphicsContext,
                                     int x,
                                     int y)
Description copied from interface: RepaintBuffer
Draws the contents of the buffer.

Specified by:
drawBufferContents in interface RepaintBuffer
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.