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:
@@ -28,6 +28,7 @@ import java.awt.Rectangle;
|
|||||||
import java.awt.Shape;
|
import java.awt.Shape;
|
||||||
import java.awt.Window;
|
import java.awt.Window;
|
||||||
import javax.swing.JApplet;
|
import javax.swing.JApplet;
|
||||||
|
import javax.swing.RepaintManager;
|
||||||
|
|
||||||
import com.threerings.media.Log;
|
import com.threerings.media.Log;
|
||||||
|
|
||||||
@@ -62,35 +63,5 @@ public class ManagedJApplet extends JApplet
|
|||||||
return _fmgr;
|
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;
|
protected FrameManager _fmgr;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user