Altered animation manager to separate construction from the start of

actual animation so that animating components can call
AnimationManager.start() when they know they're fully laid out and
ready to be regularly re-painted.  Return desired dimensions based on
requested scene bounds in SceneViewPanel.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@186 542714f4-19e9-0310-aa3c-eee0fc999fb1
This commit is contained in:
Walter Korman
2001-08-06 18:57:39 +00:00
parent 17135945d1
commit c09986bab0
5 changed files with 53 additions and 12 deletions
@@ -1,5 +1,5 @@
//
// $Id: IsoSceneView.java,v 1.25 2001/08/04 00:22:19 shaper Exp $
// $Id: IsoSceneView.java,v 1.26 2001/08/06 18:57:39 shaper Exp $
package com.threerings.miso.scene;
@@ -51,6 +51,8 @@ public class IsoSceneView implements EditableSceneView
*/
public void paint (Graphics g)
{
if (_scene == null) return;
Graphics2D gfx = (Graphics2D)g;
// clip the drawing region to our desired bounds since we
@@ -1,5 +1,5 @@
//
// $Id: SceneViewPanel.java,v 1.1 2001/08/04 01:41:02 shaper Exp $
// $Id: SceneViewPanel.java,v 1.2 2001/08/06 18:57:39 shaper Exp $
package com.threerings.miso.scene;
@@ -52,6 +52,15 @@ public class SceneViewPanel extends JPanel
_view.paint(g);
}
/**
* Return the desired size for the panel based on the requested
* and calculated bounds of the scene view.
*/
public Dimension getPreferredSize ()
{
return (_smodel == null) ? super.getPreferredSize() : _smodel.bounds;
}
/** Tile width in pixels. */
protected static final int TWIDTH = 64;