Modifications to bring things up to speed with interface changes in the
animation base classes. git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@1022 542714f4-19e9-0310-aa3c-eee0fc999fb1
This commit is contained in:
@@ -1,9 +1,9 @@
|
||||
//
|
||||
// $Id: SceneView.java,v 1.24 2002/02/17 23:45:36 mdb Exp $
|
||||
// $Id: SceneView.java,v 1.25 2002/02/19 01:24:59 mdb Exp $
|
||||
|
||||
package com.threerings.miso.scene;
|
||||
|
||||
import java.awt.Graphics;
|
||||
import java.awt.Graphics2D;
|
||||
import java.awt.Point;
|
||||
import java.awt.Rectangle;
|
||||
import java.awt.event.MouseEvent;
|
||||
@@ -18,22 +18,6 @@ import com.threerings.media.sprite.Path;
|
||||
*/
|
||||
public interface SceneView
|
||||
{
|
||||
/**
|
||||
* Invalidate a list of rectangles in screen pixel coordinates in the
|
||||
* scene view for later repainting.
|
||||
*
|
||||
* @param rects the list of {@link java.awt.Rectangle} objects.
|
||||
*/
|
||||
public void invalidateRects (List rects);
|
||||
|
||||
/**
|
||||
* Invalidate a rectangle in screen pixel coordinates in the scene
|
||||
* view for later repainting.
|
||||
*
|
||||
* @param rect the {@link java.awt.Rectangle} object.
|
||||
*/
|
||||
public void invalidateRect (Rectangle rect);
|
||||
|
||||
/**
|
||||
* Scrolls the view by the requested number of pixels. As the view is
|
||||
* not responsible for maintaining the back buffer, this will simply
|
||||
@@ -46,9 +30,10 @@ public interface SceneView
|
||||
/**
|
||||
* Renders the scene to the given graphics context.
|
||||
*
|
||||
* @param g the graphics context.
|
||||
* @param gfx the graphics context.
|
||||
* @param invalidRects the list of invalid regions to be repainted.
|
||||
*/
|
||||
public void paint (Graphics g);
|
||||
public void paint (Graphics2D gfx, List invalidRects);
|
||||
|
||||
/**
|
||||
* Sets the scene that we're rendering.
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
//
|
||||
// $Id: SceneViewPanel.java,v 1.29 2002/02/18 00:40:58 mdb Exp $
|
||||
// $Id: SceneViewPanel.java,v 1.30 2002/02/19 01:24:59 mdb Exp $
|
||||
|
||||
package com.threerings.miso.scene;
|
||||
|
||||
@@ -16,6 +16,8 @@ import java.util.List;
|
||||
import com.threerings.media.animation.AnimationManager;
|
||||
import com.threerings.media.animation.AnimatedPanel;
|
||||
import com.threerings.media.sprite.SpriteManager;
|
||||
|
||||
import com.threerings.miso.Log;
|
||||
import com.threerings.miso.util.MisoUtil;
|
||||
|
||||
/**
|
||||
@@ -145,16 +147,16 @@ public class SceneViewPanel extends AnimatedPanel
|
||||
}
|
||||
|
||||
// documentation inherited
|
||||
protected void render (Graphics2D gfx)
|
||||
protected void render (Graphics2D gfx, List invalidRects)
|
||||
{
|
||||
// translate into happy space
|
||||
gfx.translate(-_tx, -_ty);
|
||||
|
||||
// render the view
|
||||
_view.paint(gfx);
|
||||
_view.paint(gfx, invalidRects);
|
||||
|
||||
// give derived classes a chance to render on top of the view
|
||||
renderOnView(gfx);
|
||||
renderOnView(gfx, invalidRects);
|
||||
|
||||
// translate back out of happy space
|
||||
gfx.translate(_tx, _ty);
|
||||
@@ -166,23 +168,10 @@ public class SceneViewPanel extends AnimatedPanel
|
||||
* called after the view is rendered, so things drawn here appear on
|
||||
* top of the scene view.
|
||||
*/
|
||||
protected void renderOnView (Graphics2D gfx)
|
||||
protected void renderOnView (Graphics2D gfx, List invalidRects)
|
||||
{
|
||||
}
|
||||
|
||||
// documentation inherited
|
||||
public void invalidateRects (List rects)
|
||||
{
|
||||
// pass the invalid rects on to our scene view
|
||||
_view.invalidateRects(rects);
|
||||
}
|
||||
|
||||
// documentation inherited
|
||||
public void invalidateRect (Rectangle rect)
|
||||
{
|
||||
_view.invalidateRect(rect);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the desired size for the panel based on the requested
|
||||
* and calculated bounds of the scene view.
|
||||
|
||||
Reference in New Issue
Block a user