Now creates a bundled component repository and fixed up some other stuff.

git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@645 542714f4-19e9-0310-aa3c-eee0fc999fb1
This commit is contained in:
Michael Bayne
2001-11-27 08:41:49 +00:00
parent 67b388cadc
commit 1bf37c0129
2 changed files with 20 additions and 13 deletions
@@ -1,7 +1,7 @@
//
// $Id: TestApp.java,v 1.6 2001/11/21 02:42:16 mdb Exp $
// $Id: TestApp.java,v 1.7 2001/11/27 08:41:49 mdb Exp $
package com.threerings.cast.tools.builder;
package com.threerings.cast.builder;
import java.io.IOException;
import javax.swing.JFrame;
@@ -14,6 +14,7 @@ import com.threerings.resource.ResourceManager;
import com.threerings.cast.Log;
import com.threerings.cast.CharacterManager;
import com.threerings.cast.ComponentRepository;
import com.threerings.cast.bundle.BundledComponentRepository;
import com.threerings.miso.scene.MisoCharacterSprite;
import com.threerings.miso.util.MisoUtil;
@@ -21,6 +22,7 @@ import com.threerings.miso.util.MisoUtil;
public class TestApp
{
public TestApp (String[] args)
throws IOException
{
_frame = new TestFrame();
_frame.setSize(800, 600);
@@ -29,15 +31,14 @@ public class TestApp
// create the handles on our various services
_config = MisoUtil.createConfig();
ResourceManager rsrcmgr = new ResourceManager(null, "rsrc");
// TBD: sort out component repository
ComponentRepository crepo = null;
ResourceManager rmgr = new ResourceManager(null, "rsrc");
ComponentRepository crepo =
new BundledComponentRepository(rmgr, "components");
CharacterManager charmgr = new CharacterManager(crepo);
charmgr.setCharacterClass(MisoCharacterSprite.class);
// initialize the frame
((TestFrame)_frame).init(charmgr);
((TestFrame)_frame).init(charmgr, crepo);
}
public void run ()
@@ -48,8 +49,13 @@ public class TestApp
public static void main (String[] args)
{
TestApp app = new TestApp(args);
app.run();
try {
TestApp app = new TestApp(args);
app.run();
} catch (IOException ioe) {
System.err.println("Error initializing app.");
ioe.printStackTrace();
}
}
/** The test frame. */
@@ -1,11 +1,12 @@
//
// $Id: TestFrame.java,v 1.3 2001/11/18 04:09:20 mdb Exp $
// $Id: TestFrame.java,v 1.4 2001/11/27 08:41:49 mdb Exp $
package com.threerings.cast.tools.builder;
package com.threerings.cast.builder;
import javax.swing.JFrame;
import com.threerings.cast.CharacterManager;
import com.threerings.cast.ComponentRepository;
public class TestFrame extends JFrame
{
@@ -17,8 +18,8 @@ public class TestFrame extends JFrame
setDefaultCloseOperation(EXIT_ON_CLOSE);
}
public void init (CharacterManager charmgr)
public void init (CharacterManager charmgr, ComponentRepository crepo)
{
getContentPane().add(new BuilderPanel(charmgr));
getContentPane().add(new BuilderPanel(charmgr, crepo));
}
}