From 207a1f9e1a9ae4a0fa84e86b2ecc1e6d43d37a80 Mon Sep 17 00:00:00 2001 From: Michael Bayne Date: Fri, 6 Jan 2006 04:42:39 +0000 Subject: [PATCH] Switch to the stylesheet world. git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@3801 542714f4-19e9-0310-aa3c-eee0fc999fb1 --- .../com/threerings/jme/client/JabberApp.java | 19 +++++++++++++++++++ .../com/threerings/jme/client/JabberView.java | 3 +-- 2 files changed, 20 insertions(+), 2 deletions(-) diff --git a/tests/src/java/com/threerings/jme/client/JabberApp.java b/tests/src/java/com/threerings/jme/client/JabberApp.java index a7aa13b1e..2259bb543 100644 --- a/tests/src/java/com/threerings/jme/client/JabberApp.java +++ b/tests/src/java/com/threerings/jme/client/JabberApp.java @@ -21,6 +21,9 @@ package com.threerings.jme.client; +import java.io.InputStream; +import java.io.InputStreamReader; + import com.jme.bounding.BoundingBox; import com.jme.math.FastMath; import com.jme.math.Matrix3f; @@ -29,6 +32,7 @@ import com.jme.renderer.ColorRGBA; import com.jme.scene.shape.Box; import com.jme.util.LoggingSystem; import com.jme.util.geom.BufferUtils; +import com.jmex.bui.BStyleSheet; import com.threerings.util.Name; @@ -45,6 +49,9 @@ import com.threerings.jme.JmeApp; */ public class JabberApp extends JmeApp { + /** Used to configure our user interface. */ + public BStyleSheet stylesheet; + // documentation inherited public boolean init () { @@ -138,6 +145,18 @@ public class JabberApp extends JmeApp } } + // load up the default BUI stylesheet + try { + InputStream stin = getClass().getClassLoader(). + getResourceAsStream("rsrc/style.bss"); + stylesheet = new BStyleSheet( + new InputStreamReader(stin), + new BStyleSheet.DefaultResourceProvider()); + } catch (Exception e) { + e.printStackTrace(System.err); + System.exit(-1); + } + String username = (args.length > 2) ? args[2] : null; String password = (args.length > 3) ? args[3] : null; diff --git a/tests/src/java/com/threerings/jme/client/JabberView.java b/tests/src/java/com/threerings/jme/client/JabberView.java index 3804f6983..c0c810fd2 100644 --- a/tests/src/java/com/threerings/jme/client/JabberView.java +++ b/tests/src/java/com/threerings/jme/client/JabberView.java @@ -4,7 +4,6 @@ package com.threerings.jme.client; import com.jmex.bui.BLabel; -import com.jmex.bui.BLookAndFeel; import com.jmex.bui.BWindow; import com.jmex.bui.layout.BorderLayout; @@ -23,7 +22,7 @@ public class JabberView extends BWindow { public JabberView (CrowdContext ctx) { - super(BLookAndFeel.getDefaultLookAndFeel(), new BorderLayout()); + super(JabberApp.stylesheet, new BorderLayout()); _ctx = ctx; _jctx = (JmeContext)ctx;