More work on character components.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@579 542714f4-19e9-0310-aa3c-eee0fc999fb1
This commit is contained in:
@@ -0,0 +1,77 @@
|
||||
//
|
||||
// $Id: TestApp.java,v 1.1 2001/10/30 16:16:01 shaper Exp $
|
||||
|
||||
package com.threerings.cast.builder.test;
|
||||
|
||||
import java.io.IOException;
|
||||
import javax.swing.JFrame;
|
||||
|
||||
import com.samskivert.util.Config;
|
||||
import com.samskivert.swing.util.SwingUtil;
|
||||
|
||||
import com.threerings.cast.Log;
|
||||
import com.threerings.cast.CharacterManager;
|
||||
import com.threerings.media.tile.TileManager;
|
||||
|
||||
import com.threerings.miso.util.MisoContext;
|
||||
import com.threerings.miso.util.MisoUtil;
|
||||
|
||||
public class TestApp
|
||||
{
|
||||
public TestApp (String[] args)
|
||||
{
|
||||
_frame = new TestFrame();
|
||||
_frame.setSize(800, 600);
|
||||
SwingUtil.centerWindow(_frame);
|
||||
|
||||
// create the handles on our various services
|
||||
_config = MisoUtil.createConfig();
|
||||
_tilemgr = MisoUtil.createTileManager(_config, _frame);
|
||||
|
||||
CharacterManager charmgr =
|
||||
MisoUtil.createCharacterManager(_config, _tilemgr);
|
||||
|
||||
// create the context object
|
||||
_ctx = new TestContextImpl();
|
||||
|
||||
// initialize the frame
|
||||
((TestFrame)_frame).init(charmgr);
|
||||
}
|
||||
|
||||
public void run ()
|
||||
{
|
||||
_frame.pack();
|
||||
_frame.show();
|
||||
}
|
||||
|
||||
public static void main (String[] args)
|
||||
{
|
||||
TestApp app = new TestApp(args);
|
||||
app.run();
|
||||
}
|
||||
|
||||
protected class TestContextImpl implements MisoContext
|
||||
{
|
||||
public Config getConfig ()
|
||||
{
|
||||
return _config;
|
||||
}
|
||||
|
||||
public TileManager getTileManager ()
|
||||
{
|
||||
return _tilemgr;
|
||||
}
|
||||
}
|
||||
|
||||
/** The test frame. */
|
||||
protected JFrame _frame;
|
||||
|
||||
/** The test context. */
|
||||
protected MisoContext _ctx;
|
||||
|
||||
/** The config object. */
|
||||
protected Config _config;
|
||||
|
||||
/** The tile manager object. */
|
||||
protected TileManager _tilemgr;
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
//
|
||||
// $Id: TestFrame.java,v 1.1 2001/10/30 16:16:01 shaper Exp $
|
||||
|
||||
package com.threerings.cast.builder.test;
|
||||
|
||||
import javax.swing.JFrame;
|
||||
|
||||
import com.threerings.cast.CharacterManager;
|
||||
import com.threerings.cast.builder.BuilderPanel;
|
||||
|
||||
public class TestFrame extends JFrame
|
||||
{
|
||||
public TestFrame ()
|
||||
{
|
||||
super("Character Builder");
|
||||
|
||||
setResizable(false);
|
||||
setDefaultCloseOperation(EXIT_ON_CLOSE);
|
||||
}
|
||||
|
||||
public void init (CharacterManager charmgr)
|
||||
{
|
||||
getContentPane().add(new BuilderPanel(charmgr));
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user