Double buffering is a technique that
is used to prevent the screen from flickering in an unpleasant
manner when many objects are being manipulated. Since the manager
view is implemented as a lightweight component, that is, as a
direct subclass of
java.awt.Container
, it cannot handle double buffering by itself. To use double
buffering in an AWT environment, the manager view must be the
child of a heavyweight component, specially designed to handle
double-buffering for instances of
IlvManagerView
. These components can be of the IlvManagerViewPanel or of the IlvScrollManagerView class.
The methods of the
IlvManagerViewPanel
and the
IlvScrollManagerView
class that handle double-buffering are:
boolean isDoubleBuffering()
void setDoubleBuffering(boolean set)
In a Swing application, the manager view is embedded in a
JComponent
.
JComponent
objects have their own double-buffering mechanism:
jcomponent.setDoubleBuffered(true);
When you add an IlvManagerView into an IlvJManagerViewPanel or an IlvJScrollManagerView, local double buffering
in the IlvManagerView instance is disabled and Swing
double buffering is used instead. In specific situations, when
Swing double buffering is disabled, enable IlvManagerView local double buffering by
calling setDoubleBuffering after the view has been
added to the Swing component.
Example: Using double buffering
This example creates a standard
IlvManagerView
, associates it with an
IlvManagerViewPanel
, and sets the double-buffering mode:
IlvManager mgr = new IlvManager(); IlvManagerView v = new IlvManagerView(mgr); IlvManagerViewPanel panel = new IlvManagerViewPanel(v); panel.setDoubleBuffering(true);