It turns out that we can just let our normal RepaintManager stuff repaint the

applet. We don't need to do the same restore from back buffer stuff we do for a
ManagedJFrame.


git-svn-id: svn+ssh://src.earth.threerings.net/nenya/trunk@43 ed5b42cb-e716-0410-a449-f6a68f950b19
This commit is contained in:
Michael Bayne
2006-10-06 20:14:01 +00:00
parent a1a7e349bb
commit 24b2d86f64
@@ -28,6 +28,7 @@ import java.awt.Rectangle;
import java.awt.Shape;
import java.awt.Window;
import javax.swing.JApplet;
import javax.swing.RepaintManager;
import com.threerings.media.Log;
@@ -62,35 +63,5 @@ public class ManagedJApplet extends JApplet
return _fmgr;
}
@Override // from Component
public void paint (Graphics g)
{
// we catch paint requests and forward them on to the repaint
// infrastructure
update(g);
}
@Override // from Component
public void update (Graphics g)
{
Shape clip = g.getClip();
Rectangle dirty;
if (clip != null) {
dirty = clip.getBounds();
} else {
dirty = getRootPane().getBounds();
// account for our frame insets
Insets insets = getInsets();
dirty.x += insets.left;
dirty.y += insets.top;
}
if (_fmgr != null) {
_fmgr.restoreFromBack(dirty);
} else {
Log.info("Dropping AWT dirty rect " + dirty + " (" + clip + ").");
}
}
protected FrameManager _fmgr;
}