Pass a Graphics2D to AnimatedPanel.render() so that sub-classes needn't
explicitly typecast it on their own, as they are almost invariably wont to do. git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@890 542714f4-19e9-0310-aa3c-eee0fc999fb1
This commit is contained in:
@@ -1,5 +1,5 @@
|
|||||||
//
|
//
|
||||||
// $Id: AnimatedPanel.java,v 1.3 2002/01/19 07:09:55 mdb Exp $
|
// $Id: AnimatedPanel.java,v 1.4 2002/01/23 17:10:41 shaper Exp $
|
||||||
|
|
||||||
package com.threerings.media.animation;
|
package com.threerings.media.animation;
|
||||||
|
|
||||||
@@ -7,6 +7,7 @@ import java.awt.AWTException;
|
|||||||
import java.awt.BufferCapabilities;
|
import java.awt.BufferCapabilities;
|
||||||
import java.awt.Canvas;
|
import java.awt.Canvas;
|
||||||
import java.awt.Graphics;
|
import java.awt.Graphics;
|
||||||
|
import java.awt.Graphics2D;
|
||||||
import java.awt.ImageCapabilities;
|
import java.awt.ImageCapabilities;
|
||||||
import java.awt.Rectangle;
|
import java.awt.Rectangle;
|
||||||
|
|
||||||
@@ -65,7 +66,7 @@ public class AnimatedPanel extends Canvas implements AnimatedView
|
|||||||
* should override this method to paint their panel-specific
|
* should override this method to paint their panel-specific
|
||||||
* contents.
|
* contents.
|
||||||
*/
|
*/
|
||||||
protected void render (Graphics g)
|
protected void render (Graphics2D gfx)
|
||||||
{
|
{
|
||||||
// nothing for now
|
// nothing for now
|
||||||
}
|
}
|
||||||
@@ -103,7 +104,7 @@ public class AnimatedPanel extends Canvas implements AnimatedView
|
|||||||
Graphics g = null;
|
Graphics g = null;
|
||||||
try {
|
try {
|
||||||
g = _strategy.getDrawGraphics();
|
g = _strategy.getDrawGraphics();
|
||||||
render(g);
|
render((Graphics2D)g);
|
||||||
} finally {
|
} finally {
|
||||||
if (g != null) {
|
if (g != null) {
|
||||||
g.dispose();
|
g.dispose();
|
||||||
|
|||||||
@@ -1,10 +1,10 @@
|
|||||||
//
|
//
|
||||||
// $Id: SceneViewPanel.java,v 1.24 2002/01/19 07:04:46 mdb Exp $
|
// $Id: SceneViewPanel.java,v 1.25 2002/01/23 17:10:41 shaper Exp $
|
||||||
|
|
||||||
package com.threerings.miso.scene;
|
package com.threerings.miso.scene;
|
||||||
|
|
||||||
import java.awt.Dimension;
|
import java.awt.Dimension;
|
||||||
import java.awt.Graphics;
|
import java.awt.Graphics2D;
|
||||||
import java.awt.Rectangle;
|
import java.awt.Rectangle;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
@@ -80,9 +80,9 @@ public class SceneViewPanel extends AnimatedPanel
|
|||||||
}
|
}
|
||||||
|
|
||||||
// documentation inherited
|
// documentation inherited
|
||||||
protected void render (Graphics g)
|
protected void render (Graphics2D gfx)
|
||||||
{
|
{
|
||||||
_view.paint(g);
|
_view.paint(gfx);
|
||||||
}
|
}
|
||||||
|
|
||||||
// documentation inherited
|
// documentation inherited
|
||||||
|
|||||||
Reference in New Issue
Block a user