rcx.rcxtools.filebrowser
Class DoubleBuffering

java.lang.Object
  extended by rcx.rcxtools.filebrowser.DoubleBuffering

public class DoubleBuffering
extends java.lang.Object

A smart implementation of double buffering that shares one offscreen image. Set the property "DBdebug" to true to disable double buffering and debug drawings.

Double buffering works only with native container (Panel, Canvas, etc.). To enable double buffering on a Panel, create a Panel like this:

 Panel panel = new Panel () {
      public void update(Graphics g) {
        DoubleBuffering.update(this, g);
      }
    };
 

Version:
1.1
Author:
Philippe.Kaplan@sophia.inria.fr

Field Summary
static boolean debug
          The debug flag.
 
Constructor Summary
DoubleBuffering()
           
 
Method Summary
static void update(java.awt.Component area, java.awt.Graphics g)
          Call area.paint() on an offscreen copy of Graphics g.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

debug

public static boolean debug
The debug flag. Automatically set on init whether DBdebug property is true. Default is false.

Constructor Detail

DoubleBuffering

public DoubleBuffering()
Method Detail

update

public static void update(java.awt.Component area,
                          java.awt.Graphics g)
Call area.paint() on an offscreen copy of Graphics g. Example of use in a Component:
            public void update(Graphics g) {
              DoubleBuffering.update(this, g);
            }