Switched the chat view and test app over to BUI. Modifide the build script

to create a narya-jme.jar file.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@3529 542714f4-19e9-0310-aa3c-eee0fc999fb1
This commit is contained in:
Michael Bayne
2005-04-29 03:24:07 +00:00
parent 16322b1422
commit 357ed12b9f
7 changed files with 140 additions and 153 deletions
@@ -21,6 +21,12 @@
package com.threerings.jme.client;
import com.jme.bounding.BoundingBox;
import com.jme.math.FastMath;
import com.jme.math.Matrix3f;
import com.jme.math.Vector3f;
import com.jme.renderer.ColorRGBA;
import com.jme.scene.shape.Box;
import com.jme.util.LoggingSystem;
import com.threerings.util.Name;
@@ -46,6 +52,35 @@ public class JabberApp extends JmeApp
// initialize our client instance
_client = new JabberClient();
_client.init(this);
// add some simple geometry for kicks
Vector3f max = new Vector3f(15, 15, 15);
Vector3f min = new Vector3f(5, 5, 5);
Box t = new Box("Box", min, max);
t.setModelBound(new BoundingBox());
t.updateModelBound();
t.setLocalTranslation(new Vector3f(0, 0, -15));
ColorRGBA[] colors = new ColorRGBA[24];
for (int i = 0; i < 24; i++) {
colors[i] = ColorRGBA.randomColor();
}
t.setColors(colors);
_root.attachChild(t);
_root.updateRenderState();
// set up the camera
Vector3f loc = new Vector3f(0, -200, 200);
_camera.setLocation(loc);
Matrix3f rotm = new Matrix3f();
rotm.fromAngleAxis(-FastMath.PI/5, _camera.getLeft());
rotm.mult(_camera.getDirection(), _camera.getDirection());
rotm.mult(_camera.getUp(), _camera.getUp());
rotm.mult(_camera.getLeft(), _camera.getLeft());
_camera.update();
// speed up key input
_input.setKeySpeed(100f);
}
public void run (String server, int port, String username, String password)
@@ -21,11 +21,10 @@
package com.threerings.jme.client;
import com.jme.bui.event.InputDispatcher;
import com.jme.input.InputHandler;
import com.jme.renderer.Renderer;
import com.jme.scene.Node;
import com.jme.ui.UIColorScheme;
import com.jme.ui.UIFonts;
import com.samskivert.util.Config;
import com.threerings.util.MessageManager;
@@ -186,20 +185,16 @@ public class JabberClient
return _app.getContext().getRoot();
}
public InputHandler getInputHandler () {
return _app.getContext().getInputHandler();
}
// public InputHandler getInputHandler () {
// return _app.getContext().getInputHandler();
// }
public InputHandler getBufferedInputHandler () {
return _app.getContext().getBufferedInputHandler();
}
// public InputHandler getBufferedInputHandler () {
// return _app.getContext().getBufferedInputHandler();
// }
public UIColorScheme getColorScheme () {
return _app.getContext().getColorScheme();
}
public UIFonts getFonts () {
return _app.getContext().getFonts();
public InputDispatcher getInputDispatcher () {
return _app.getContext().getInputDispatcher();
}
}
@@ -3,6 +3,11 @@
package com.threerings.jme.client;
import com.jme.bui.BLabel;
import com.jme.bui.BLookAndFeel;
import com.jme.bui.BWindow;
import com.jme.bui.layout.BorderLayout;
import com.threerings.crowd.client.PlaceView;
import com.threerings.crowd.data.PlaceObject;
import com.threerings.crowd.util.CrowdContext;
@@ -13,15 +18,22 @@ import com.threerings.jme.chat.ChatView;
/**
* Manages the "view" when we're in the chat room.
*/
public class JabberView
public class JabberView extends BWindow
implements PlaceView
{
public JabberView (CrowdContext ctx)
{
super(BLookAndFeel.getDefaultLookAndFeel(), new BorderLayout());
_ctx = ctx;
_jctx = (JmeContext)ctx;
_chat = new ChatView(_jctx, _ctx.getChatDirector());
_jctx.getRoot().attachChild(_chat);
addChild(_chat, BorderLayout.CENTER);
setBounds(0, 40, 640, 240);
layout();
_jctx.getRoot().attachChild(this);
_jctx.getInputDispatcher().addWindow(this);
}
// documentation inherited from interface PlaceView