// Decompiled by Jad v1.5.8e. Copyright 2001 Pavel Kouznetsov.
// Jad home page: http://www.geocities.com/kpdus/jad.html
// Decompiler options: packimports(3) space 
// Source File Name:   DoubleBufferPanel.java

package lt.monarch.awt;

import java.awt.*;

public class DoubleBufferPanel extends Panel
{

    public DoubleBufferPanel()
    {
    }

    public void invalidate()
    {
        super.invalidate();
        cache = null;
    }

    public void paint(Graphics g)
    {
        if (cache == null)
            cache = createImage(size().width, size().height);
        Graphics g1 = cache.getGraphics();
        g1.clipRect(0, 0, size().width, size().height);
        super.paint(g1);
        g1.dispose();
        g.drawImage(cache, 0, 0, null);
    }

    public void update(Graphics g)
    {
        paint(g);
    }

    private Image cache;
}
